Thursday, February 17, 2005

Thursday 17th

The first task of the day was to track down a couple of bugs in yesterday's Brush masking code; for some reason, I'd neglected to implement the code properly, so unexpected problems occurred when the handling point of the Brush was toggled (if you recall, the Brush can be handled - like Brushes in Dpaint - from the top-left or the bottom-right, according to user preference).

Additionally, I also needed to tweak the clipping routine; when a Brush goes off the edge of the screen, Blitz automatically clips the image for me; in mask mode, however, the program reads the information underneath the brush before plotting it, so when the Brush goes off screen, erroneous data gets thrown into the mix and things start to go a little bit bonkers.

The next tweak on my list was to sort out the Tile window and specifically, choosing tiles with the +/- keys; although this is possibly a little redundant now (a throwback to the time when the tiles were displayed in a continuous strip across the bottom of the screen), it still has its uses. The problem was to get the cursor moving properly within the Tile window, but took just a few minutes.

The biggest task of the day was to start on the Undo / Redo routines; I've been putting these off for far too long, but the Editor has reached the point where they really do need to be added (I've lost count of the times I've screwed up my test map and had to reload it).

The routine, in theory, is reasonably simple: you hold a number of buffers in memory, each the size of the current map. When a change is made, you stash the contents of the map into a buffer, and if the Undo is activated, you copy this buffer back over to the map. With this in mind, I spent a little while writing a nice, modular routine to copy data from Bank to Bank. - and that was when I discovered Blitz's rather handy CopyBank command... D'oh!

I rounded off the day by adding a little Splash Screen when the program starts but, like all artistic endeavours, it took longer to draw the image than it did to implement the code. :)