Thursday, December 8, 2005

Thursday 8th

Started off by stripping out the last few bits of code I'd written last night (I wanted the Zoom system to use its own canvas, but for some reason the code wouldn't co-operate so I decided to do it the tried and tested way instead).

Next came the task of adding Zoom control to the two buttons I'd already prepared on the Toolbar; this meant encapsulating all of yesterday's (test) code into a small function which could be called from either the menu or the Toolbar.

At the same time, I also added a small check to prevent the zoom initialisation form taking place if the Zoom level is already at the one currently being selected, as well as a small check to ensure that Zoom mode always returns to the Layer that was previously being edited (this is because most of the controls and drawing tools are disabled in Zoom mode, though it's still possible to mess around with the Tabbers and suchlike).

Next on the list was to tweak the Tile Panel so that animating tiles are displayed properly (I'd forgotten to add this to my ToDo list and thus, slipped through the net when I was developing the animation system last week). I considered adding an option to toggle this new function, but due to the way the animation system works, I think it's pretty important to see which tiles on the tileset have animations assigned to them.

While tinkering with the Tile Panel, I noticed that I'd neglected to add Tile Grab Mode to the toolbar; hastily booted up PhotoShop and added an appropriate icon, then added a few extra checks to the Toolbar routine. There, nobody will ever notice. :)

In another shoddy attempt to avoid tackling the Project I/O, I set up all of the necessary variables to keep track of any edits made throughout the program; currently, each Layer/Map has a small flag associated with it - whenever an edit is made (e.g. drawing a line), the flag is set. Shoudl the user then choose to exit the program, they are alerted that there are unsaved changes (naturally, this flag is cleared if the map/map set is saved).

Essentially, I'd like to expand this system so that any changes, be they Tiles, Animations, Meta Data, Mask Data, Brushes, or Grab Buffers, are automatically logged and the user prompted on exit (or indeed, if they try to load a file over the existing data).

Decided to bite the bull by the scruff of the horns and do some more work on the Project I/O routines, which involved tracing through each and every one of my variables and working out which ones need to be loaded, cleared, or initialised.

The final task of the night was the creation of the Create Tileset function; while playing around with some of the Grab functions, it occurred to me that, for the purpose of grabbing tiles and quickly trying out ideas, it'd be useful to be able to create a blank Tileset (rather than import an existing one). Thankfully, this was straightforward enough to write. :)