From e25bda32ecb82a45acefaca5a31e1e6eba5e6dc5 Mon Sep 17 00:00:00 2001 From: Gregory Montoir Date: Sun, 19 Oct 2003 18:52:28 +0000 Subject: [PATCH] minor cleanup / comments update svn-id: r10908 --- queen/graphics.h | 8 -------- queen/logic.cpp | 19 ++++++++----------- queen/logic.h | 17 +++++++++++++---- queen/queen.cpp | 4 ++-- queen/structs.h | 38 +++++++++++++++++++++++++++++++++++++- 5 files changed, 60 insertions(+), 26 deletions(-) diff --git a/queen/graphics.h b/queen/graphics.h index 5da3e39663f..55205aa4ccf 100644 --- a/queen/graphics.h +++ b/queen/graphics.h @@ -101,14 +101,6 @@ struct TextSlot { }; -//struct Dynalum { -// uint8 msk[50 * 160]; // mask -// int8 lum[8 * 3]; // rgb -// int8 oldColMask; -// Dynalum(): oldColMask(-1) {} -//}; - - class Display; class Graphics { diff --git a/queen/logic.cpp b/queen/logic.cpp index e5ae97b1094..b4889a4bcc3 100644 --- a/queen/logic.cpp +++ b/queen/logic.cpp @@ -855,7 +855,6 @@ void Logic::roomSetupFurniture() { void Logic::roomSetupObjects() { - warning("Logic::roomSetupObjects() not fully implemented"); uint16 i; // furniture frames are reserved in ::roomSetupFurniture(), we append objects @@ -997,7 +996,7 @@ void Logic::roomSetupObjects() { uint16 Logic::roomRefreshObject(uint16 obj) { - warning("Logic::roomRefreshObject() not fully implemented"); + uint16 curImage = _numFrames; ObjectData *pod = &_objectData[obj]; @@ -1452,20 +1451,18 @@ int16 Logic::animFindAll(const GraphicData *gd, uint16 firstImage, AnimFrame *pa _graphics->bankUnpack(ABS(tempFrames[i]), firstImage + i, 15); } if (paf != NULL) { - uint16 frameNr = 0; for (i = 1; i <= _numGraphicAnim; ++i) { const GraphicAnim *pga = &_graphicAnim[i]; if (pga->keyFrame == gd->firstFrame) { + uint16 frameNr = 0; for (j = 1; j <= gd->lastFrame; ++j) { - int16 f = pga->frame; - if (f > 500) { - f -= 500; - } - if (f == tempFrames[j - 1]) { - frameNr = j + firstImage - 1; - } if (pga->frame > 500) { - frameNr += 500; + if (pga->frame - 500 == tempFrames[j - 1]) { + frameNr = j + firstImage - 1 + 500; + } + } + else if (pga->frame == tempFrames[j - 1]) { + frameNr = j + firstImage - 1; } } paf->frame = frameNr; diff --git a/queen/logic.h b/queen/logic.h index e69b4601777..3c684f77de4 100644 --- a/queen/logic.h +++ b/queen/logic.h @@ -225,13 +225,22 @@ protected: int16 _gameState[GAME_STATE_COUNT]; - uint16 _numFurnitureAnimated; // FMAXA + //! Number of animated furniture in current room (FMAXA) + uint16 _numFurnitureAnimated; + + //! Number of static furniture in current room (FMAX) uint16 _numFurnitureStatic; // FMAX - uint16 _numFurnitureAnimatedLen; // FMAXLEN - uint16 _numFrames; // FRAMES + + //! Total number of frames for the animated furniture (FMAXLEN) + uint16 _numFurnitureAnimatedLen; + + //! Current number of frames unpacked (FRAMES) + uint16 _numFrames; + + //! Last frame number used for person animation uint16 _personFrames[4]; - //! contains the animation frames (max 30) to use for a bob (whose number must be < 17) + //! Describe an string based animation (30 frames maximum, bob number must be < 17) AnimFrame _newAnim[17][30]; Resource *_resource; diff --git a/queen/queen.cpp b/queen/queen.cpp index d67d394bf16..4f84d22cec1 100644 --- a/queen/queen.cpp +++ b/queen/queen.cpp @@ -126,7 +126,7 @@ void QueenEngine::roomChanged() { // XXX R_MAP(); // XXX fadeout(0,223); } - else if (_logic->currentRoom() == 95 && _logic->gameState(117) == 0) { + else if (_logic->currentRoom() == 95 && _logic->gameState(VAR_INTRO_PLAYED) == 0) { char nextFilename[20]; _logic->roomDisplay(_logic->roomName(_logic->currentRoom()), RDM_FADE_NOJOE, 100, 2, true); @@ -157,7 +157,7 @@ void QueenEngine::roomChanged() { _logic->roomDisplay(_logic->roomName(_logic->currentRoom()), RDM_FADE_JOE, 100, 2, true); Cutaway::run("c70d.cut", nextFilename, _graphics, _logic, _resource); - _logic->gameState(117, 1); + _logic->gameState(VAR_INTRO_PLAYED, 1); // XXX setupItems(); // XXX inventory(); diff --git a/queen/structs.h b/queen/structs.h index 1c3d38605a0..dd55bf6405e 100644 --- a/queen/structs.h +++ b/queen/structs.h @@ -109,6 +109,26 @@ struct GraphicData { //! coordinates of object uint16 x, y; //! bank bobframes + /*! + + + + + + + + + + + + + + + + + +
lastFrame == 0non-animated bob (one frame)
lastFrame < 0rebound animation
firstFrame < 0bobAnimString (animation is described by a string)
firstFrame > 0bobAnimNormal (animation is a sequence of frames)
+ */ int16 firstFrame, lastFrame; //! moving speed of object uint16 speed; @@ -414,7 +434,23 @@ struct CmdGameState { struct FurnitureData { //! room in which the furniture are int16 room; - //! value to store in GAMESTATE + //! type of furniture (stored in GAMESTATE) + /*! + + + + + + + + + + + + + +
valuedescription
]0..5000]static or animated
]5000..[paste down
+ */ int16 gameStateValue; void readFrom(byte *&ptr) {