Monday, January 30, 2006

Monday 30th

I'm now getting down to the final few tasks before beta, two of which - Map Rotation and Undo/Redo - are old friends as far as the development process goes. After trying, without success, to write a fast and shorthand map rotation algorithm, I settled with slower/reliable (after all, it works for Brush rotation, so why reinvent the wheel?).

After toiling for a couple of hours, I managed to get the arrays and buffers talking to each other, but during the debugging process I encountered a bug when small maps (ie. smaller in width/height than the screen) are loaded back into the Editor. This then led me to discover a teensy bug in the Project I/O routine, and for a moment I felt a very overwhelming sense of foreboding.

However, patience was the key, and after fixing the Project I/O (which, thankfully, didn't have an adverse effect on existing project files), I tracked down the map problem to a couple of calls within an existing routine which were resetting variables I was trying to change.

With that out of the way, and after putting in some failsafe checks to ensure that all routines that read the map data are reset properly, the rotation code was in and working. As an afterthought, I added the option to rotate the tiles along with the map - thanks to the way I'd structured my code, this took just a couple of minutes to add, and in the space of a day the Editor has become even more feature-packed and powerful.