Sunday, September 25, 2005

Sunday 25th

Started off by tweaking my Tile Masking colour picker so that the Tileset is automatically refreshed when a new masking colour is chosen. Quickly changed my mind, however, as it was no longer possible to have different colours for different Tilesets. D'oh!

Moved on to the thumbnail code, which generates a smaller (or bigger) version of the Tileset if the tile size is above or below 32x32 - the reason being, the Anim and Grab Panels both rely on tiles of 32x32 in order to fit all of the required information on the relatively small panel. Got the code working, but I need to finish up by tweaking the cursor and ensuring that any Tilesets loaded into the Editor have thumbnails generated automatically.

Implemented the Grab Panel functionality today, and tidied up a few loose ends (label positions, etc.), and also took the liberty of refining my Text Display routine so that only labels currently in use are updated. Also hit upon a way of avoiding flicker on my text labels, which has been sitting on my bug list for way too long.

Started tackling the various functions for the Grab panel, and hit a couple of problems when locking buffers - as it turns out, in operations that involve writing or reading pixels, you need to lock both the source buffer and the destination buffer; with that little quirk sorted, I wrote a copy/paste routine for tiles, then expanded my Brush Rotate code to add flipping and rotation to the tile functions.

Finally came the Clear routines, which allow the user to pick a colour to clear the current tile, or click the Quick button to clear with the last colour you 'picked'.

Saturday, September 17, 2005

Saturday 17th

Tinkered with PhotoShop today, in an attempt to bash out a design for the Grab Panel. In order to avoid the redesign headaches I had with the Anim Panel, I based the design on that of the Anim Panel (it was a fairly complex layout that worked well, so why deviate too far from a winning solution?). That done, I spent a chunk of time implementing the various gadgets, canvases, and panels, ready to add the functionality next time.

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.