From f5fa6651d71929163b08fb4e758ab022b186b1ee Mon Sep 17 00:00:00 2001
From: Gregory Montoir
Date: Tue, 14 Oct 2003 19:06:25 +0000
Subject: commented a bit various structures
svn-id: r10801
---
queen/structs.h | 174 +++++++++++++++++++++++++++++++++++++++++++++++++-------
1 file changed, 153 insertions(+), 21 deletions(-)
(limited to 'queen')
diff --git a/queen/structs.h b/queen/structs.h
index 7823162d4f..21bc44bacd 100644
--- a/queen/structs.h
+++ b/queen/structs.h
@@ -54,10 +54,13 @@ struct Box {
struct Area {
+ //! bitmask of connected areas
int16 mapNeighbours;
+ //! coordinates defining area limits
Box box;
- uint16 bottomScaleFactor;
- uint16 topScaleFactor;
+ //! scaling factors for bobs actors
+ uint16 bottomScaleFactor, topScaleFactor;
+ //! entry in ObjectData, object lying in this area
uint16 object;
void readFrom(byte *&ptr) {
@@ -85,9 +88,10 @@ struct Area {
struct WalkOffData {
+ //! entry in ObjectData
int16 entryObj;
- uint16 x;
- uint16 y;
+ //! coordinates to reach
+ uint16 x, y;
void readFrom(byte *& ptr) {
entryObj = (int16)READ_BE_UINT16(ptr); ptr += 2;
@@ -98,8 +102,11 @@ struct WalkOffData {
struct GraphicData {
+ //! coordinates of object
uint16 x, y;
+ //! bank bobframes
int16 firstFrame, lastFrame;
+ //! moving speed of object
uint16 speed;
void readFrom(byte *& ptr) {
@@ -113,13 +120,51 @@ struct GraphicData {
struct ObjectData {
- int16 name; // FIXME: rename to 'object'
- uint16 x;
- uint16 y;
+ //! entry in OBJECT_NAME
+ int16 name;
+ //! coordinates of object
+ uint16 x, y;
+ //! entry in OBJECT_DESCR
uint16 description;
+ //! associated object
int16 entryObj;
+ //! room in which this object is available
uint16 room;
+ //! state of the object (grab direction, on/off, default command...)
int16 state;
+ //! entry in GraphicData (can be negative)
+ /*!
+
+
+ value |
+ description |
+
+
+ -4 |
+ person object (right facing) |
+
+
+ -3 |
+ person object (left facing) |
+
+
+ -2 |
+ animated bob (off) |
+
+
+ -1 |
+ static bob (off) |
+
+
+ [0..5000] |
+ static or animated bob (on) |
+
+
+ ]5000.. [ |
+ 'paste down' bob |
+
+
+ */
int16 image;
void readFrom(byte *& ptr) {
@@ -136,49 +181,90 @@ struct ObjectData {
struct ObjectDescription {
+ //! entry in ObjectData or ItemData
uint16 object;
- uint16 type; // see select.c l.75-101
+ //! type of the description
+ /*!
+ refer to select.c l.75-101
+
+
+ value |
+ description |
+
+
+ 0 |
+ random but starts at first description |
+
+ 1 |
+ random |
+
+
+ 2 |
+ sequential with loop |
+
+
+ 3 |
+ sequential and set description to last |
+
+
+ */
+ uint16 type;
+ //! last entry possible in OBJECT_DESCR for this object
uint16 lastDescription;
- uint16 seenCount;
+ //! last description number used (in order to avoid re-using it)
+ uint16 lastSeenNumber;
void readFrom(byte *&ptr) {
object = READ_BE_UINT16(ptr); ptr += 2;
type = READ_BE_UINT16(ptr); ptr += 2;
lastDescription = READ_BE_UINT16(ptr); ptr += 2;
- seenCount = READ_BE_UINT16(ptr); ptr += 2;
+ lastSeenNumber = READ_BE_UINT16(ptr); ptr += 2;
}
};
struct ItemData {
+ //! entry in OBJECT_NAME
int16 item;
- int16 description;
+ //! entry in OBJECT_DESCR
+ uint16 description;
+ //! state of the object
int16 state;
+ //! bank bobframe
uint16 bobFrame;
- uint16 sfxDescription;
+ //! entry in OBJECT_DESCR (>0 if available)
+ int16 sfxDescription;
void readFrom(byte *&ptr) {
item = (int16)READ_BE_UINT16(ptr); ptr += 2;
- description = (int16)READ_BE_UINT16(ptr); ptr += 2;
+ description = READ_BE_UINT16(ptr); ptr += 2;
state = (int16)READ_BE_UINT16(ptr); ptr += 2;
bobFrame = READ_BE_UINT16(ptr); ptr += 2;
- sfxDescription = READ_BE_UINT16(ptr); ptr += 2;
+ sfxDescription = (int16)READ_BE_UINT16(ptr); ptr += 2;
}
};
struct ActorData {
+ //! room in which the actor is
int16 room;
+ //! bob number associated to this actor
int16 bobNum;
+ //! entry in ACTOR_NAME
uint16 name;
- int16 gameStateSlot;
- int16 gameStateValue;
+ //! gamestate entry/value, actor is valid if GAMESTATE[slot] == value
+ int16 gameStateSlot, gameStateValue;
+ //! spoken text color
uint16 color;
+ //! bank bobframe for standing position of the actor
uint16 bobFrameStanding;
- uint16 x;
- uint16 y;
+ //! initial coordinates in the room
+ uint16 x, y;
+ //! entry in ACTOR_ANIM
uint16 anim;
+ //! bank to use to load the actor file
uint16 bankNum;
+ //! entry in ACTOR_FILE
uint16 actorFile;
void readFrom(byte *&ptr) {
@@ -200,16 +286,51 @@ struct ActorData {
struct CmdListData {
+ //! action to perform
int16 verb;
+ //! first object used in the action
int16 nounObj1;
+ //! second object used in the action
int16 nounObj2;
- int16 song; // >0: playbefore, <0: playafter
+ //! song to play (>0: playbefore, <0: playafter)
+ int16 song;
+ //! if set, P2_SET_AREAS must be called (using CmdArea)
bool setAreas;
+ //! if set, P3_SET_OBJECTS must be called (using CmdObject)
bool setObjects;
+ //! if set, P4_SET_ITEMS must be called (using CmdInventory)
bool setItems;
+ //! if set, P1_SET_CONDITIONS must be called (using CmdGameState)
bool setConditions;
+ //! graphic image of object
int16 image;
- int16 specialSection; // see execute.c l.423-451
+ //! special section to execute
+ /*!
+ refer to execute.c l.423-451
+
+
+ value |
+ description |
+
+
+ 1 |
+ use journal |
+
+
+ 2 |
+ use dress |
+
+
+ 3 |
+ use normal clothes |
+
+
+ 4 |
+ use underwear |
+
+
+ */
+ int16 specialSection;
void readFrom(byte *&ptr) {
verb = (int16)READ_BE_UINT16(ptr); ptr += 2;
@@ -227,8 +348,11 @@ struct CmdListData {
struct CmdArea {
+ //! identifier of the command
int16 id;
- int16 area; // <0: turn off, >0: turn on
+ //! area to turn off/on (<0: off, >0: on)
+ int16 area;
+ //! room in which the area must be changed
int16 room;
void readFrom(byte *&ptr) {
@@ -240,6 +364,7 @@ struct CmdArea {
struct CmdObject {
+ //! identifier of the command
int16 id;
int16 dstObj; // >0: show, <0: hide
int16 srcObj; // >0: copy from srcObj, -1: delete dstObj
@@ -253,6 +378,7 @@ struct CmdObject {
struct CmdInventory {
+ //! identifier of the command
int16 id;
int16 dstItem; // <0: delete, >0: add
int16 srcItem; // >0: valid
@@ -266,6 +392,7 @@ struct CmdInventory {
struct CmdGameState {
+ //! identifier of the command
int16 id;
int16 gameStateSlot;
int16 gameStateValue;
@@ -281,7 +408,9 @@ struct CmdGameState {
struct FurnitureData {
+ //! room in which the furniture are
int16 room;
+ //! value to store in GAMESTATE
int16 gameStateValue;
void readFrom(byte *&ptr) {
@@ -305,8 +434,11 @@ struct GraphicAnim {
struct Person {
+ //! actor settings to use
const ActorData *actor; // P_ROOM, P_BNUM, P_GAMES, P_VALUE, P_COLOR, P_STAND, P_X, P_Y
+ //! name of the actor
const char *name; // P_NAMEstr
+ //! string animation
const char *anim; // P_ANIMstr
uint16 bobFrame; // SFRAME
//! As the bank number may change, we can't re-use actor->bankNum
--
cgit v1.2.3