From 38c4321f5965c5872e2d4e73d0a9e6ec05a35a2e Mon Sep 17 00:00:00 2001 From: Gregory Montoir Date: Thu, 11 Dec 2003 21:04:02 +0000 Subject: cleanup svn-id: r11588 --- queen/command.cpp | 9 --------- queen/graphics.h | 2 +- queen/logic.cpp | 2 -- queen/logic.h | 6 +++--- queen/resource.cpp | 13 +++++-------- queen/resource.h | 8 +++++++- queen/state.h | 3 --- 7 files changed, 16 insertions(+), 27 deletions(-) (limited to 'queen') diff --git a/queen/command.cpp b/queen/command.cpp index 4d9e673f23..1c91ea940a 100644 --- a/queen/command.cpp +++ b/queen/command.cpp @@ -311,43 +311,34 @@ void Command::readCommandsFrom(byte *&ptr) { uint16 i; - // Command List Data _numCmdList = READ_BE_UINT16(ptr); ptr += 2; - _cmdList = new CmdListData[_numCmdList + 1]; memset(&_cmdList[0], 0, sizeof(CmdListData)); for (i = 1; i <= _numCmdList; i++) { _cmdList[i].readFrom(ptr); } - // Command AREA _numCmdArea = READ_BE_UINT16(ptr); ptr += 2; - _cmdArea = new CmdArea[_numCmdArea + 1]; memset(&_cmdArea[0], 0, sizeof(CmdArea)); for (i = 1; i <= _numCmdArea; i++) { _cmdArea[i].readFrom(ptr); } - // Command OBJECT _numCmdObject = READ_BE_UINT16(ptr); ptr += 2; - _cmdObject = new CmdObject[_numCmdObject + 1]; memset(&_cmdObject[0], 0, sizeof(CmdObject)); for (i = 1; i <= _numCmdObject; i++) { _cmdObject[i].readFrom(ptr); } - // Command INVENTORY _numCmdInventory = READ_BE_UINT16(ptr); ptr += 2; - _cmdInventory = new CmdInventory[_numCmdInventory + 1]; memset(&_cmdInventory[0], 0, sizeof(CmdInventory)); for (i = 1; i <= _numCmdInventory; i++) { _cmdInventory[i].readFrom(ptr); } - // Command GAMESTATE _numCmdGameState = READ_BE_UINT16(ptr); ptr += 2; _cmdGameState = new CmdGameState[_numCmdGameState + 1]; memset(&_cmdGameState[0], 0, sizeof(CmdGameState)); diff --git a/queen/graphics.h b/queen/graphics.h index b565848054..20af746950 100644 --- a/queen/graphics.h +++ b/queen/graphics.h @@ -233,7 +233,7 @@ private: TextSlot _texts[GAME_SCREEN_HEIGHT]; uint8 _curTextColor; - int _cameraBob; // cambob + int _cameraBob; BamData _bam; diff --git a/queen/logic.cpp b/queen/logic.cpp index 565acebc43..d38507fa29 100644 --- a/queen/logic.cpp +++ b/queen/logic.cpp @@ -714,8 +714,6 @@ void Logic::roomErase() { _graphics->bankErase(10); _graphics->bankErase(12); - // TODO: TALKHEAD=0; - if (_currentRoom >= 114) { _display->palFadeOut(0, 255, _currentRoom); } diff --git a/queen/logic.h b/queen/logic.h index 25c4f63e90..97110e6929 100644 --- a/queen/logic.h +++ b/queen/logic.h @@ -148,8 +148,6 @@ public: const char *objectName(uint16 objNum) const { return _objName[objNum]; } const char *objectTextualDescription(uint16 objNum) const { return _objDescription[objNum]; } - uint16 numFrames() const { return _numFrames; } - void zoneSet(uint16 screen, uint16 zone, uint16 x1, uint16 y1, uint16 x2, uint16 y2); void zoneSet(uint16 screen, uint16 zone, const Box& box); uint16 zoneIn(uint16 screen, uint16 x, uint16 y) const; @@ -171,15 +169,17 @@ public: int16 entryObj() const { return _entryObj; } void entryObj(int16 obj) { _entryObj = obj; } + uint16 numFrames() const { return _numFrames; } + void personSetData(int16 noun, const char *actorName, bool loadBank, Person *pp); // SET_PERSON_DATA uint16 personSetup(uint16 noun, uint16 curImage); // SETUP_PERSON uint16 personAllocate(uint16 noun, uint16 curImage); // ALLOCATE_PERSON + uint16 personFrames(uint16 bobNum) const { return _personFrames[bobNum]; } uint16 animCreate(uint16 curImage, const Person *person); // CREATE_ANIM void animErase(uint16 bobNum); void animReset(uint16 bobNum); void animSetup(const GraphicData *gd, uint16 firstImage, uint16 bobNum, bool visible); // FIND_GRAPHIC_ANIMS - uint16 personFrames(uint16 bobNum) const { return _personFrames[bobNum]; } void joeSetupFromBanks(const char *animBank, const char *standBank); diff --git a/queen/resource.cpp b/queen/resource.cpp index d8c7501dd8..c7d2a6acdc 100644 --- a/queen/resource.cpp +++ b/queen/resource.cpp @@ -24,11 +24,8 @@ namespace Queen { -#define DEMO_JAS_VERSION_OFFSET 0x119A8 -#define JAS_VERSION_OFFSET 0x12484 - -static const char *tableFilename = "queen.tbl"; +const char *Resource::_tableFilename = "queen.tbl"; const GameVersion Resource::_gameVersions[] = { { "PEM10", true, false, 0x00000008, 22677657 }, @@ -66,7 +63,7 @@ Resource::Resource(const Common::String &datafilePath, const char *datafileName, _resourceEntries = 1076; _resourceTable = _resourceTablePEM10; } else { - error("Couldn't find tablefile '%s%s'", _datafilePath.c_str(), tableFilename); + error("Couldn't find tablefile '%s%s'", _datafilePath.c_str(), _tableFilename); } } } @@ -203,7 +200,7 @@ const GameVersion *Resource::detectGameVersion(uint32 dataFilesize) { //we try to verify that it is indeed the version we think it is later on const GameVersion *pgv = _gameVersions; int i; - for (i = 0; i < VER_NUMBER; ++i, ++pgv) { + for (i = 0; i < VER_COUNT; ++i, ++pgv) { if (pgv->dataFileSize == dataFilesize) { return pgv; } @@ -214,9 +211,9 @@ const GameVersion *Resource::detectGameVersion(uint32 dataFilesize) { bool Resource::readTableFile() { File tableFile; - tableFile.open(tableFilename, _datafilePath); + tableFile.open(_tableFilename, _datafilePath); if (!tableFile.isOpen()) - tableFile.open(tableFilename, ""); //try current directory + tableFile.open(_tableFilename, ""); //try current directory if (tableFile.isOpen() && tableFile.readUint32BE() == 'QTBL') { tableFile.seek(_gameVersion->tableOffset); _resourceEntries = tableFile.readUint16BE(); diff --git a/queen/resource.h b/queen/resource.h index fde96e823e..d23e05b446 100644 --- a/queen/resource.h +++ b/queen/resource.h @@ -41,7 +41,7 @@ enum Version { VER_DEMO_PCGAMES = 9, VER_DEMO = 10, - VER_NUMBER = 11 + VER_COUNT = 11 }; struct ResourceEntry { @@ -80,6 +80,10 @@ public: bool writeSave(uint16 slot, const byte *saveData, uint32 size); bool readSave(uint16 slot, byte *&ptr); + enum { + DEMO_JAS_VERSION_OFFSET = 0x119A8, + JAS_VERSION_OFFSET = 0x12484 + }; protected: File *_resourceFile; @@ -91,6 +95,8 @@ protected: const char *_savePath; uint32 _resourceEntries; ResourceEntry *_resourceTable; + + static const char *_tableFilename; static const GameVersion _gameVersions[]; static ResourceEntry _resourceTablePEM10[]; diff --git a/queen/state.h b/queen/state.h index 9408a17aa3..86f72368bd 100644 --- a/queen/state.h +++ b/queen/state.h @@ -34,7 +34,6 @@ enum StateTalk { STATE_TALK_MUTE }; - enum StateGrab { STATE_GRAB_NONE, STATE_GRAB_DOWN, @@ -42,13 +41,11 @@ enum StateGrab { STATE_GRAB_MID }; - enum StateOn { STATE_ON_ON, STATE_ON_OFF }; - enum StateUse { STATE_USE, STATE_USE_ON -- cgit v1.2.3