Tuesday, November 29, 2005

Tuesday 29th

First on today's agenda was the Animation menu, which involved implementing all of the various commands from the actual Animation Tabber - this is often just a case of shoehorning the code into a function, then calling this function from both the menu and the panel code.

Also took the opportunity to finish off the Grab menu, which I'd neglected to do a couple of weeks ago (and for obvious reasons - it's a fairly tedious task).

Made a couple of tweaks to the Map Resize code, too - currently, the map resizing is done at a very specific point in the code loop; it dawned on me that this isn't actually necessary due to the modular way in which the code works, so a couple of tweaks and the whole shebang was working more efficiently (but, as is often the case, it looks exactly the same to the end user!).

Wanted to finish up by adding the Animation toggle button's functionality to the Toolbar code, until I noticed that the Toolbar wasn't working properly. As is the case with the previous two Blitz updates, the Toolbar always seems to break. After a quick visit to the Blitz+ forum, however, it was a relatively simple fix - my favourite kind :).

Next up came a few tweaks to the Grab code to prevent tiles being manipulated when there is no Tileset loaded into the current 'slot' - the error checking for this is relatively simple, but permeates into many different areas of the code (so much so, I'm certain I've probably missed a couple along the way - let's hope my Beta Testers are paying attention).

The final task of the day involved making a start on the Project I/O, which also goes hand-in-hand with the 'New' function. On close inspection, the New function is quite extensive, and needs to reset literally dozens of variables, data banks, and arrays (thankfully, this routine will be used twice, once by the New function and once by the Load function).

I also took the opportunity to add proper error handling to each I/O routine, to ensure that loads and saves are handled properly should the user jab the cancel button or enter an inappropriate filename.

Monday, November 28, 2005

Monday 28th

Another brief but productive session saw the implementation of the Animation Set I/O (as mentioned yesterday), which allows all animation data to be saved in one fell swoop. I also added a small function to ensure that the Loop and Ping-Pong checkboxes are correctly set when animation data is loaded (one of those small touches that is completely transparent to the user and thus, I'll never get any thanks or recognition for it).

Sunday, November 27, 2005

Sunday 27th

A quick delve into the Editor code saw me tackling the I/O routines for the animation system; essentially, I'd like this to work in much the same way as the Brush I/O, in that a single animation can be quickly saved to disk using a generic filename or given a filename by the user, and the actual Animation "set" (ie. all of the animation data) is loaded and saved in the standard fashion.

The actual routines had already been prototyped back when the Animation system was first written, so all that remained were a few little tweaks here and there.

Hit upon the idea of adding a Shift modifier to some of the buttons, as it became something of a pain to repeatedly click on the +/- buttons - with Shift held, the buttons increase the current index number by 10, instead of just 1, making it much easier to navigate. Now all I need to do is implement this throughout the code.

Saturday, November 26, 2005

Saturday 26th

Flushed with yesterday's successes, today I continued implementing a few more bits and pieces connected with the animation system, ostensibly the plotting of animating tiles on the various cursors and tools.

First up came a slight tweak to the main map plotting routine; when I tweaked the code yesterday to add animations, it dawned on me that I could make the main loop tighter and more efficient (and luckily, the whole thing didn't fall apart afterwards).

Next came the tool code, which involved revisiting the various tool functions in order to make sure that animated tiles get plotted. For example, with tile animation activated, it's nice to be able to see the tile animating as you're drawing with it; with the tweaks in place, animations are plotted as you draw lines and boxes (I may make this a toggle-able option just to cater for all tastes).

While delving into the Continuous Box function, I noticed that I'd neglected to include Right Mouse Button control - a few key-taps later and that was rectified, but it also exposed a small cursor-related bug (which, thankfully, was a quick-fix).

The final task of the night was to add animation plotting to Brush Mode, so that any brushes being used will also animate (if they contain animating tiles, of course). That completed, the animation system is virtually complete; all that remains are the I/O routines and a few tweaks to the animation menu, which I'll no doubt tackle tomorrow.

Friday, November 25, 2005

Friday 25th

Spent the last couple of days back in Editor Land, specifically, finishing off the animation system; the Anim panel functionality was developed in conjunction with test variables while I deliberated on the best way to store animations (and, if truth be told, until I fully got my head around using Types).

Thankfully, it dawned on me that I didn't necessarily have to use Types to store the data - simple arrays and DataBanks would be equally effective (and quicker to check when it came to developing the actual screen animation code), and so I decided to get the animation system wiped off my To-Do list for good.

Yesterday's session was pretty mundane, and involved setting up the variables, arrays, and DataBanks, as well as replacing all references to temporary variables with proper ones. With that out of the way, today I set about making sure all the frame addition/removal/import code had the desired effect (this involved tweaking several bits of code, as the test data used arrays while the new system uses a DataBank).

After methodically working through each routine, I finally had the system in and working (I may revisit the code at some point, however, as the logistics of adding a frame seem a bit cumbersome now that I've used it for more than a couple of minutes).

Thus, the next step was to write a routine that animates all of the tiles (ie. increments the frame index variables and triggers loops if appropriate), followed by a graceful way of reading each map tile, checking if it's an animation, and if so, plotting the next tile in the sequence instead of the one stored in the map data.

This was the part I'd been dreading the most, but thankfully it took mere seconds to write; indeed, the hardest part was tracking down why all of the animations wouldn't run at the same time - it suddenly dawned on me that I wasn't actually calling the animation routine (and lo, there was much slapping of the forehead).