Friday, June 17, 2005

Friday 17th

Bit of a slow start today, thanks to an eyeful of soap (which seemed like God's way of saying, "don't code today"). Not that I believe in God, or indeed, believe that God, if he existed, would have time to send messages about my code. But I digress.

The first task on today's list was to tweak the resize function; one of my test pilots pointed out that if a map is smaller than the screen, it's hard to tell where the edges of the map are because it's surrounded by blank tiles. I therefore popped in a small piece of code that resizes the canvas should the map drop below a certain size, and certainly makes editing smaller maps a little more intuitive.

Next up came a tweak to the Mask system; currently the user can activate a simple on/off mask, which allows tiles to be masked (in the same way that DPaint stencils worked) to prevent them from being drawn over. Masks will also be used to quickly generate collision maps and so forth. In response to feedback, however, it became apparent that one Mask per tileset would be preferable to just a single Mask.

This was no simple task, as I not only had to tweak the Mask display routine, I also needed to convert the array-based system to a more flexible bank-based one, and then convert all the drawing functions accordingly. Surprisingly, the additions and tweaks took about 25 minutes, and left me time to add Mask functionality to Fill Mode (something I'd previously neglected to do).

While I was tinkering with Masks, I hit upon the idea of displaying the masked tiles on the map (as opposed to just on the tile panel), which makes it easier to see which tiles are masked and which aren't. After a few tiny adjustments (mainly to ensure that only masked tiles from the current layer are displayed, and in the correct order), the system was in and working beautifully.