Tuesday, July 11, 2006

Tuesday 11th

Yesterday's session threw up a small bug in the system which allows Tile sizes to be changed; everything worked from going from 32x32 upwards, but not down to 16x16. More confusing still, the error was contained in the Map display routine, which should remain completely unaffected by the variables connected with Tile sizes.

I was dreading the impending hours of bug hunting, but luckily after tracing through the code a number of times, the solution suddenly presented itself (and was a quick fix, requiring a couple of variables to be reset). The problem stemmed from the fact that the Map offset wasn't being reset, and as the offsets change depending on the Tile size (because there are more/less Tiles on screen), this was causing the Map display to go a bit wonky.

After this I corrected an oversight in the Close Tileset function, which neglected to reset the Tileset's filename (and therefore, closing a Tileset then choosing Refresh Tileset caused it to pop back up again). This might actually be a nice way of bringing back a Tileset closed by accident, but for now it'll stay as-is.

Next on the agenda came a slight tweak to the Documentation, to include yesterday's new Brush grabbing system (I'm desperately keen to keep on top of these doc changes, as it's a royal pain to do lots of updates in one go).

Finished off today's session by tweaking the I/O routines. First came the task of adding error handling to the Static and Parallax loading code (when a Project file is loaded, the program needs to check that it can actually find the files specified in the paths that were saved when the project was saved). This was something of an oversight, as I'd added the code to do this for Tilesets but neglected Static and Parallax layers.

This also tied in nicely with a small tweak to allow me to specify file locations for the Tileset, Static, and Parallax images. When FishEd is released I want to include example images and an example project file; however, as the program stores the absolute path of all images loaded, and given that the actual installation drive and folder could be different on every machine, I needed to devise a way to always make my example project file look in the fished\graphics folder.

After scratching my head over this, the solution was both simple and elegant: when I save my example file, I can set a special flag that tells the program that this is my special example file. When the images are loaded in, it checks this flag and tweaks the directory so that the file is loaded from the correct place. And, rather neatly, the error handling is still in place just in case the user deletes or moves the example files.

With those tasks out of the way, I only have a handful of things left to do:

1. Finilase Project I/O to cope with any recently-added variables.

2. Remove menu options for incomplete or missing functions (which will probably appear in the next version).

3. The dreaded Undo / Redo functions

4. Test, test, test...

Hopefully I can get everything wrapped up by the weekend, which would give me and my loyal Beta Testers a couple of weeks to iron out any major bugs before the product goes gold. After that, beer and a holiday. :)