Tuesday, September 13, 2005

Tuesday 13th

After a brief hiatus, I returned to the Editor to tackle a few more jobs. First up was the function to allow the user to change the Mask Tile colour (the Mask Tile is displayed over the top of the tiles if a Tile is masked). The main reason for changing the colour is so that the Mask Tile is clearly distinguishable no matter what colour the Tile may be.

This was actually no easy task; the Mask Tile is a bitmap image and thus, in order to change its colour I needed to physically redraw the image within the bitmap. After a bit of head scratching (and a few crashes due to memory being overwritten), I finally discovered that it's easy enough to specify which frame of an AnimImage you wish to modify (and not using offsets, as I was).

With the code up and running, I took the liberty of tweaking the Tile Load routine to take advantage of this new discovery (and given the potential for writing to the wrong area of memory, I was surprised it'd even worked at all).

Next, I toyed with the idea of displaying the Map as either decimal or hex, which involved creating an alternate Tileset (mainly because printing the tile number using the Text command slows the Editor to a crawl). It seems that there's no graceful solution to this, so it's back to the drawing board for this particular function.

Took the liberty of making a few tweaks here and there, one of which involved changing the display order of the Grid and Brush Grid (for some reason, the Brush outline and cursors were being displayed behind the grids - far from useful).

I rounded off the day by designing the Grab panel, which will be the final big addition to this version of the Editor; the Grab panel will allow the user the grab tiles from the Static Layer, as well as manipulate existing tiles (flipping, rotation, scrolling, etc.). I may even tweak the Brush Grab function to allow chunks of tiles to be grabbed, but this will require a lot of thought and planning in order to avoid screwing up the existing code.