Tackled a small bug this morning which was causing some unexpected crashes when maps were resized to make them considerably larger. I narrowed it down to the core of the Undo / Redo routine, which currently works with map buffers of a certain size - naturally I was neglecting to resize these buffers when the maps are resized.
Decided to bite the bullet and finish the map loading completely, specifically the force-load routine which loads a map with dimensions smaller / larger than the current map. I actually had the bulk of the code written already, but kept getting unexpected crashes.
After popping in a Stop command and tracing through using the debugger - something which I never knew was possible until recently - the problem dawned on me in an instant, and now all of the map I/O code is finally wrapped up.
Rounded off the day by tackling the Mask > Collision functionality, which was one of the first ideas I jotted down on my To Do list almost a year ago. Essentially, I wanted the user to have a very quick way to generate collision maps based on the current map (collision maps being 0 for pass-through tiles, and 1 for solid walls and suchlike). This is particularly useful for game engines which don't check the actual tile that the player is colliding with, they check the collision map.
Why? Sometimes it's useful to use collision maps as it allows different entities within the game to react differently to the same tile - specifying the collision properties for each tile takes away such flexibility.
After 20 minutes furious coding, the routine was up and running; choosing the Mask > Collision option now generates a collision map on the currently-selected Layer, with the pass-through tile the currently-selected Right tile, and the solid tile the currently-selected Left tile. Maximum flexibility, easy to use, and extremely useful, even if I do say so myself.
