Changes

Jump to navigation Jump to search

AGI/Specifications/Pic

18 bytes removed, 02:59, 23 January 2011
m
colour -> color
Pictures are drawn using nine different drawing actions. These actions are given values from 0xF0 to 0xFA and are defined as follows:
* 0xF0: Change picture colour color and enable picture draw.
* 0xF1: Disable picture draw.
* 0xF2: Change priority colour color and enable priority draw.
* 0xF3: Disable priority draw.
* 0xF4: Draw a Y corner.
===General actions===
====0xF0: Change picture colour color and enable picture draw====Function: Changes the current drawing colour color for the picture screen to that given by the one and only argument, and enables subsequent actions to draw to the picture screen.
Initially all pixels of the background are white and have priority 4. After this command is executed, all the subsequent graphic commands draw using the colour color set by the command.
Example: <tt>F0 0D</tt> changes picture screen drawing colour color to light magenta and enables drawing to the picture screen.
====0xF1: Disable picture draw====
Function: Disables drawing to the picture screen. This is done whenever there is something which only needs to be drawn on the priority screen such as the control lines. There are no arguments for this action.
====0xF2: Change priority colour color and enable priority draw====
Function: Changes the current drawing colour color for the priority screen to that given by the one and only argument, and enables subsequent actions to draw to the priority screen.
Example: <tt>F0 04</tt> changes priority screen drawing colour color to red and enables drawing to the priority screen.
====0xF3: Disable priority draw====
====0xF8: Fill====
Function: Flood fill from the locations given. Arguments are given in groups of two bytes which give the coordinates of the location to start the fill at. If picture drawing is enabled then it flood fills from that location on the picture screen to all pixels locations that it can reach which are white in colourcolor. The boundary is given by any pixels which are not white.
If priority drawing is enabled, and picture drawing is not enabled, then it flood fills from that location on the priority screen to all pixels that it can reach which are red in colourcolor. The boundary in this case is given by any pixels which are not red.
If both picture drawing and priority drawing are enabled, then a flood fill naturally enough takes place on both screens. In this case there is a difference in the way the fill takes place in the priority screen. The difference is that it not only looks for its own boundary, but also stops if it reaches a boundary that exists in the picture screen but does not necessarily exist in the priority screen.
Writing code to interpret the picture data in order to draw the picture on the screen is easier said than done. It turns out that you have to have a line drawing algorithm which exactly matches the one that Sierra uses. A pixel out of place can mean that a fill overflows or doesn't work at all.
You will also have to write your own fill routine because not many of the standard fill routines can stop at a multicoloured multicolored boundary. You are also dealing with two screens both of which will probably be stored in memory somewhere rather than the screen.
The picture screen has a starting state of being completely white. The priority screen has starting state of being completely red. It is important that you set all pixels in each screen to the relevant background colour color else you won't get the right result.
===General guidelines===
I have discovered that using a queue in a flood fill routine works quite well. It is also the easiest method to understand as far as I'm concerned. I just thought about what needed to be done and this method took shape.
Basically you start at a particular location. If its the desired background colour color (white or red depending on the screen), then set that pixel. You then check the pixels immediately up, left, down, and right to see if they are of the desired background colourcolor. If they are, store them in the queue. You then retrieve the first pixel position from the queue and repeat the above steps.
<span id="HiRes"></span>
Pri looks like it could be giving the current priority band that the cursor location is in. The above status lines are for the SCI Picture Editor. I ran these values past SQ3 and the values given for Pri are indeed the values of the priority band at the locations given.
I think that V, P, and C refer to the colours colors being used on the three different screens (the SCI games have a separate screen for the control lines rather than having both the priority bands and control lines on the same screen. This is why there were three screens and not the two that we are used to in AGI games). This would mean that V = Visual, P = Priority and C = Control.
In an AGI Picture Editor, there would only be the Visual screen and the Priority screen. The picture editor would obviously be able to switch between the two screens. I've also noticed that the early vector based SCI picture editor supports a feature which removes solid colours colors (Fills) with a single keystroke and I presume another keystroke puts them back. When the fills have been removed, they are represented as a tiny cross. Apparently removing the solid colours colors makes it easier to add small details like flowers.
<span id="Sample"></span>
2,051

edits

Navigation menu