home *** CD-ROM | disk | FTP | other *** search
- Amnesia Flags - for Amnesia 1.00
- ================================
-
- Amnesia flags are contained in a 4 byte word at offset +4 from the start of
- an Amnesia object. Bit 0 is the least signifacant bit (it’s on the right
- when the number is written down).
-
- An Amnesia Object
- -----------------
-
- An Amnesia object is made up of 8 or more bytes in the following form:
-
- Offset | Use
- -------------------------
- 0 | sprite number - set to zero to indicate a dead object
- +4 | flags
- +8 | x position
- +12 | y position
- +16 | x velocity
- +20 | y velocity
- +24 | timer
- +28 | object size in pixels
- +32 | timer 2
-
- The following describes the meaning of the flags at offset +4. The bits
- determine what happens to the object on each process pass.
-
- Bit 0 - Plot with FastSpr
- -------------------------
-
- If this bit is set the object is plotted by FastSpr as a sprite. The first
- word of the object is passed to FastSpr as a sprite number in R0. The x and
- y positions are shifted right 12 places before being passed to the
- FastSpr_Plot SWI in R1 and R2.
-
- Bit 1 - User Plot
- -----------------
-
- If this bit is set the object is returned to the user for plotting. The user
- routine must extract the coordinates as necessary and plot the object itself.
-
- Bit 2 - Use velocities
- ----------------------
-
- If this bit is set the velocities at offsets +16 and +20 are added to the
- position values at +8 and +12 and the results stored back at +8 and +12.
- This is a simple way to move an object around.
-
- Bit 3 - Apply gravity
- ---------------------
-
- If this bit is set the current gravity value, set by Amnesia_SetGravity, is
- added to the velocity at +16 and +20, and the result stored back to +16 and
- +20. Note that gravity may be in any direction.
-
- Bit 4 - Use plot offsets
- ------------------------
-
- If this bit is set the plot offsets, set by Amnesia_SetPlotOffset, are added
- to the object coordinates before the object plotted by FastSpr. The offsets
- are added before the values are shifted right. Note that user plot routines
- must handle this for themselves.
-
- Bit 5 - Use timer for FastSpr animation
- ---------------------------------------
-
- If this bit is set the timer (offset +24) is used for animation. FastSpr
- supports animation using bits 23-16 of the sprite number. If this bit is
- set, Amnesia will ORR the top 8 bits of the timer value into this position so
- that an animation will run without user intervention. The help files in
- FSPConv have more information about FastSpr animation.
-
- Bit 6 - Make up the object size from FastSpr file
- -------------------------------------------------
-
- If this bit is set the object size (offset +28) is derived from the FastSpr
- file using the SWI FastSpr_ReadSize. This can be a handy timesaver in most
- cases. Note that the sprite number at offset 0 must be the number of a valid
- sprite, and that sprite must already be loaded when the object is made.
- FastSpr_ReadSize is called once when the object is created and the result
- stored at offset +28. Any subsequent changes in the sprite file or object
- will not update the size entry.
-
- Bit 7 - Object needs collision checking
- ---------------------------------------
-
- If this bit is set the position of the object (strictly speaking the bounding
- box) is added to the collision checking table. See the docs on collision
- checking for more details.
-
- Bit 8 - Generate attention request if timer expires
- ---------------------------------------------------
-
- If this bit is set Amnesia will generate an attention for the object when the
- timer value is negative - ie the timer expires. See the timer docs for
- further information. Note that care must be taken to ensure to stop this
- attention occuring repeatedly once the timer has expired.
-
- Bit 9 - Destroy object if timer expires
- ---------------------------------------
-
- If this bit is set the object will be destroyed if the timer becomes
- negative. The object is not returned for attention before the object is
- destroyed. Set bit 8 as well if you want this to happen.
-
- Bit 10 - Always request an attention
- ------------------------------------
-
- If this bit is set the object is returned for attention on each process pass.
-
- Bit 11 - Run timer 2
- --------------------
-
- If this bit is set Amnesia will run a second timer at offset +32. This timer
- will not generate attention or destroy objects regardless of the settings of
- bits 8 and 9.
-
- Bit 12 - Zero velocities
- ------------------------
-
- If this bit is set Amnesia will zero the object velocities at offsets +16 and
- +20 after they have been added to the positions (at +8 and +12) once. It
- will also zero this bit in the flags.
-
- Bit 13 and 14 - Object uses the game window
- -------------------------------------------
-
- If bit 13 is set the object will return for attention if it is outside the
- game window in the x (horizontal) direction. If bit 14 is set the object
- will return for attention if it is outside the game window in the y
- (vertical) direction. It is possible for both to occur at once. See the
- window docs for further information.
-
- Bit 15 - Object obeys the plot window
- -------------------------------------
-
- If this bit is set the object will only be plotted (either by FastSpr or a
- user routine) if any part of it is inside the plot window. The plot offset
- is added to the coordinates before the comparison. See the window docs for
- further information.
-
- Bit 16 - Object obeys the kill window
- -------------------------------------
-
- If this bit is set the object will be killed (deleted) if it is outside of
- the kill window. The object will be returned for attention before it is
- deleted. See the window docs for further information.
-
- Bit 17 - Add to collision checking table only if within plot window
- -------------------------------------------------------------------
-
- If this bit is set the object will only be added to the collision checking
- table if it is inside the plot window. It may be used to reduce the load on
- collision checking routines if necessary.
-
- Bit 18 - Object should be saved
- -------------------------------
-
- The objects in a table may be saved using the SWI Amnesia_SaveTable. Objects
- will only be saved if this bit is set in their flags.
-
- Bit 19 - Reserved for future expansion
- --------------------------------------
-
- Set this bit to zero.
-
- Bits 20-23 - User transient flags
- ---------------------------------
-
- These bits are set to zero on each process pass. They may be used for any
- purpose by the user. These flags were primarily intended to store collision
- handling information.
-
- Bits 24-31 - User attention flags
- ---------------------------------
-
- These bits can be set by the user to generate attention request for specified
- groups of objects. If, say, bit 27 is set in the table number passed to
- Amnesia_SelectTable all objects with bit 27 set in their flags will be
- returned for attention.
-
- ****************************************************
- This document is copyright A.Southgate 1994.
- It may be freely distibuted and copied but
- should not be modified, otherwise things will
- get very confusing.
- ****************************************************
-