Wednesday, December 21, 2005

Wednesday 21st

After a couple of days working on other projects, work resumed on the Editor and saw me adding the relevant calls to the "Undo Store" routine from the various tool routines. It became apparent that the Pen and Brush routines needed a little debounce code, mainly because every frame that the mouse button is depressed is counted as a separate edit.

The debounce was relatively simple to write, however, and merely involved incrementing a flag each frame if the button is held, and calling the Undo Store routine if it isn't - now the user can make huge swirling edits with the Pen or Brush, but the Undo Store routine only kicks in when the mouse button is released.

Continued with some housekeeping checks, specifically to stop Brush mode being activated or Brushes being stored if there is no Tileset assigned to the current Layer. Next came the various Tile functions (Copy, Rotate, Clear, etc.), which required a few little tweaks to ensure that empty memory isn't being tinkered with.