The window scaling has been proving a little tricky, as I reached one of those classic coding moments: my code was working perfectly, then I changed a single line of code and suddenly everything seemed to break. Ultimately it took about an hour to get the code working again, and thankfully it seems a lot more robust than before. Things happen for a reason, I suppose.
The next step was to re-size the canvas properly, which took a little bit of tweaking to get right, but now I have the option of either resizing the canvas on the fly, or when the user resizes the window border and lets go of the mouse (the latter ties in nicely with canvas resizing when the window is maximized and minimized).
As the canvas was being re-sized in chunks of 32x32 pixels (the default tile size for my testbed code), it suddenly occurred to me that this would change according to whatever tile size the user is currently, er, using. Thus, I needed a quick way of changing the current tile size, which at the moment is impossible as many of the old FishEd routines haven't been transposed into FishEd Max just yet.
However, the tile size issue also ties in with the current tile size for the main window; I plan to make the Zoom feature in FishEd Max a proper zoom, in the sense that the user can zoom in or out and still make edits (the zoom feature in FishEd was purely for map inspection purposes). This feature was largely inspired by feedback from "Robin", an artist who had been using FishEd on commercial projects and wanted 8x8 tiles and the ability to zoom up the edit window to avoid going blind thanks to the contrast of the teensy tile size on a huge monitor.
And thus, I decided to wade in and tackle the viewport scaling at the same time; regardless of the current actual tile size, there is now a viewport tilesize, which may or may not be a scaled up/scaled down version of the current tilesize. When the window/canvas are re-sized, the routine now takes into account the viewport tilesize, and adjusts accordingly. I spent a little bit of time adjusting the relevant routines, and barring a few little tweaks, the user can now quickly zoom in and out and make edits to the map. Already, the new editor feels much smoother, slicker, and faster than FishEd.
Mid way through the coding session, I dedcided to add Tracker bars (yum!) to control the scaling; after about an hour of tinkering and head-scratching, my tracker gadgets still wouldn't appear. After a quick trip to the Blitz forums, it transpired that a new build was available. A click or two later, and after rebuilding all my modules, the trackers were working and my editor was running much faster. Result!
Note to self: check for updates a little more often...!
