From 577ea51c1070fdbb0759b9ecf6a48747b523a017 Mon Sep 17 00:00:00 2001 From: Gregory Montoir Date: Thu, 11 Dec 2003 10:24:27 +0000 Subject: [PATCH] cleanup svn-id: r11579 --- queen/defs.h | 15 +-------------- queen/display.h | 2 +- queen/logic.cpp | 20 ++++++++++++++++---- queen/logic.h | 15 ++++++++++++--- 4 files changed, 30 insertions(+), 22 deletions(-) diff --git a/queen/defs.h b/queen/defs.h index d93c3cebfad..20a22955c99 100644 --- a/queen/defs.h +++ b/queen/defs.h @@ -61,7 +61,7 @@ enum Direction { enum { INK_BG_PANEL = 226, INK_JOURNAL = 248, - INK_MAP7 = 243, + INK_PINNACLE_ROOM = 243, INK_CMD_SELECT = 255, INK_CMD_NORMAL = 225, INK_CMD_LOCK = 234, @@ -71,11 +71,6 @@ enum { }; -enum { - ZONE_ROOM = 0, - ZONE_PANEL = 1 -}; - enum { ITEM_NONE = 0, ITEM_BAT = 1, @@ -280,14 +275,6 @@ enum Language { }; -enum JoeWalkMode { - JWM_NORMAL = 0, - JWM_MOVE = 1, - JWM_EXECUTE = 2, - JWM_SPEAK = 3 -}; - - } // End of namespace Queen #endif diff --git a/queen/display.h b/queen/display.h index b7bb4427e33..998184fe48d 100644 --- a/queen/display.h +++ b/queen/display.h @@ -126,7 +126,7 @@ private: SCREEN_W = 320, SCREEN_H = 200, PANEL_W = 320, - PANEL_H = 50 + PANEL_H = 50 }; TextRenderer _textRenderer; diff --git a/queen/logic.cpp b/queen/logic.cpp index dc9c5383a25..e7aeeea753b 100644 --- a/queen/logic.cpp +++ b/queen/logic.cpp @@ -65,7 +65,6 @@ Common::RandomSource Logic::randomizer; Logic::Logic(Resource *theResource, Graphics *graphics, Display *theDisplay, Input *input, Sound *sound) : _resource(theResource), _graphics(graphics), _display(theDisplay), _input(input), _sound(sound) { - _jas = _resource->loadFile("QUEEN.JAS", 20); _joe.x = _joe.y = 0; _joe.scale = 100; _walk = new Walk(this, _graphics); @@ -77,15 +76,20 @@ Logic::Logic(Resource *theResource, Graphics *graphics, Display *theDisplay, Inp } Logic::~Logic() { - delete[] _jas; delete _walk; delete _cmd; delete _dbg; } void Logic::initialise() { + int16 i, j; - uint8 *ptr = _jas; + + + // Step 1 : read queen.jas file and 'unserialize' some arrays + + uint8 *jas = _resource->loadFile("QUEEN.JAS", 20); + uint8 *ptr = jas; _numRooms = READ_BE_UINT16(ptr); ptr += 2; _numNames = READ_BE_UINT16(ptr); ptr += 2; @@ -218,6 +222,11 @@ void Logic::initialise() { if(memcmp(ptr, _resource->JASVersion(), 5) != 0) { warning("Unexpected queen.jas file format"); } + + delete[] jas; + + + // Step 2 : read queen2.jas and grab all description texts _objDescription = new char*[_numDescriptions + 1]; _objDescription[0] = 0; @@ -264,6 +273,9 @@ void Logic::initialise() { for (i = 1; i <= _numAFile; i++) _aFile[i] = _resource->getJAS2Line(); + + // Step 3 : initialise game state / variables + _cmd->clear(false); _scene = 0; memset(_gameState, 0, sizeof(_gameState)); @@ -2210,7 +2222,7 @@ void Logic::handlePinnacleRoom() { _entryObj = objData->entryObj; char textCmd[CmdText::MAX_COMMAND_LEN]; sprintf(textCmd, "%s %s", Verb(VERB_WALK_TO).name(), _objName[objData->name]); - _graphics->textCurrentColor(INK_MAP7); + _graphics->textCurrentColor(INK_PINNACLE_ROOM); _graphics->textSetCentered(5, textCmd); } prevObj = curObj; diff --git a/queen/logic.h b/queen/logic.h index 16ef37c62f2..d46fcd73624 100644 --- a/queen/logic.h +++ b/queen/logic.h @@ -37,6 +37,18 @@ enum RoomDisplayMode { RDM_FADE_JOE_XY = 3 // display Joe at the current X, Y coords }; +enum { + ZONE_ROOM = 0, + ZONE_PANEL = 1 +}; + +enum JoeWalkMode { + JWM_NORMAL = 0, + JWM_MOVE = 1, + JWM_EXECUTE = 2, + JWM_SPEAK = 3 +}; + struct ZoneSlot { bool valid; Box box; @@ -306,9 +318,6 @@ protected: void initialise(); - //! Contents of queen.jas file - uint8 *_jas; - uint16 _currentRoom; uint16 _oldRoom; uint16 _newRoom;