Wednesday, August 31, 2005

Wednesday 31st

Today saw the arrival of a wee message in my Inbox from none other than Mark "I Made Blitz!" Sibly (I'd dropped him a line as nobody seemed to be able to help with my dilemma). Essentially, using certain gadgets, such as checkboxes and buttons, meant that the keyboard focus was lost (and thus, none of the keys would work).

The trick was to use the ActivateGadget command to restore keyboard focus but, rather than call this every frame (as I was doing, to no avail), the command was called only if a button or checkbox was manipulated. After 5 minutes cutting and pasting, full functionality was restored. :)

Tuesday, August 30, 2005

Tuesday 30th

Eased back into Editor mode with a few minor tweaks and bug fixes. First off was a small bug in the control routine, which made the Editor think that Shift was being held constantly. I then tweaked the tile cursor routine, so that when + and - are used to select a tile, the tile window scrolls accordingly.

Rounded off the night's session by tweaking the Mouse Wheel functionality; previously, the Wheel button was used to grab the tile under the cursor in Pen Mode. I tweaked the code to ensure this function was available in all drawing modes, and also as a way of jumping quickly out of Brush Mode back into Pen Mode.

Thursday, August 18, 2005

Thursday 18th

Another day of avoiding the bigger tasks saw me plucking more titbits from the To Do list. First up was the colour selector for the various grids that the User can select (the standard resizeable grid, the Brush grid, and the Tile grid). The main reason I wanted the colours to be user-definable was purely for reasons of clarity (it's not always easy to see a cyan grid if your tiles/map contain mostly blues!). Thankfully, these were easy enough to implement.

Next up came the inclusion of a proper parallax layer, complete with adjustable speeds. The Static layer is a fixed bitmap picture which sits behind the other layers; the parallax layer, as its name suggests, scrolls in parallax, and combined with the Static layer, allows the User to very quickly build up a good representation of how their finished map will look.

I'd experimented with the parallax code previously, so all that remained was to implement the I/O routine, display routine, and speed controls, as well as adding a checkbox to the main display window.

The next task was a fairly simple addition, but something that had been lacking for too long: the ability to change the Layer names (a la PhotoShop). In the end, this was a relatively simple process of reading the User input and changing the relevant Gadget name.

The final couple of tasks on today's agenda involved a simple toggle to display which tiles are currently used/unused, and a menu option to control the way Meta Data is displayed (ie. with or without flag numbers).

Monday, August 15, 2005

Monday 15th

Found a small bug yesterday, while tinkering with the Mini Map code; basically, a couple of values (which relate to the number of tiles that can fit on the screen) weren't being calculated properly, which was causing a few routines to malfunction occasionally.

I tracked the problem down to a section of code that initialises the map - the resize routine - but the code wasn't being called on startup because there was no map to resize. A few slaps of the forehead later, everything was working properly.

While I was knee-deep in setup code, I took the liberty of adding an "Open" button to the startup screen; now the User can choose to set the map dimensions, accept the default values, or load up an existing project.

Another task was plucked off the to-do list, mainly because I fancied coding but didn't want to get too bogged down in a big routine, so I decided to tackle the Mask Colour function (this allows the User to specify which colour will be masked when a Tileset is loaded). The colour picker was easy enough to add, and the code was working beautifully in just a few minutes.

Flushed with that small success, I decided to tweak the Toolbar and add the "Continuous Pen" drawing mode (this basically increments the currently selected Left / Right tiles every time you plot a Tile, allowing you to plot continuous sequences of tiles very easily).

Wednesday, August 10, 2005

Wednesday 10th

The past couple of days have been spent hammering away at the Mini Map code, which has never really worked properly since its addition (and subtle changes to the Editor - such as dynamic map sizes - have meant that the Mini Map code needed a severe overhaul anyway).

The Mini Map is basically a thumbnail version of the current Layer; Tiles are represented by different colours, and the user can choose what information is used to generate the Mini Map (e.g. only masked Tiles are shown, only Tiles with certain Meta Data, Tiles within a certain range, etc.).

The first tweak involved the Mini Map scrolling, for maps bigger than the Mini Map window - I spent a good few hours staring blankly at my code trying to get results (and failing miserably), until yesterday I sat down for a quick coding session and managed to rewrite the whole routine from scratch in 20 minutes! Code is like that sometimes. :)

Today saw me tweaking the mouse control, which allows the user to click on the Mini Map and have the main Editor window reflect the change (indeed, it's possible to drag the mouse around to scroll around the Map a little more easily).

As an afterthought, I took the liberty of tweaking the canvas setup code, so the Mini Map now appears neatly in the centre of the relevant panel. I'm nothing if neat. ;)

Monday, August 1, 2005

Monday 1st

Another overhaul for the animation panel was on today's agenda - I just wasn't 100% happy with the version in place, so another stint with PhotoShop saw the creation of a design which (finally) seems to fit the bill. It also included a Tileset selector, something I'd forgotten to include in the original design. I also added a Ping-Pong option checkbox (see below).

Added a Loop Delay system to the animation code, which allows the user to specify a delay before the animation loops back to the start. This also ties in nicely with the Ping-Pong option, which allows the animation to cycle backwards and forwards through the frames (the Loop Delay in this case is the delay at the start and end of the sequence).

Spent the bulk of the evening ironing out a few bugs in the Add/Remove frame code, as well as a couple of quirks when a set of frames is imported.

The remainder of the night was spent tweaking some of the panel/canvas code; since the Meta panel had been changed a few weeks ago, it was still using its own canvas. However, a few tweaks later it was happily sharing its canvas with the Tile panel, thus saving a weensy chunk of video memory.