diff options
-rw-r--r-- | queen/logic.cpp | 19 | ||||
-rw-r--r-- | queen/logic.h | 8 | ||||
-rw-r--r-- | queen/queen.cpp | 1 |
3 files changed, 15 insertions, 13 deletions
diff --git a/queen/logic.cpp b/queen/logic.cpp index 044a1c8ed4..8cd7b2a3f8 100644 --- a/queen/logic.cpp +++ b/queen/logic.cpp @@ -58,14 +58,15 @@ static Common::String trim(const Common::String &s) { } Logic::Logic(QueenEngine *vm) - : _credits(NULL), _vm(vm) { + : _credits(NULL), _objectData(NULL), _roomData(NULL), _sfxName(NULL), + _itemData(NULL), _graphicData(NULL), _walkOffData(NULL), _objectDescription(NULL), + _furnitureData(NULL), _actorData(NULL), _graphicAnim(NULL), _vm(vm) { _joe.x = _joe.y = 0; _joe.scale = 100; _joe.walk = JWM_NORMAL; memset(_gameState, 0, sizeof(_gameState)); memset(_talkSelected, 0, sizeof(_talkSelected)); _puzzleAttemptCount = 0; - initialise(); _journal = new Journal(vm); } @@ -84,7 +85,7 @@ Logic::~Logic() { delete[] _graphicAnim; } -void Logic::initialise() { +void Logic::start() { int16 i; uint8 *jas = _vm->resource()->loadFile("QUEEN.JAS", 20); @@ -929,24 +930,24 @@ void Logic::inventoryRefresh() { } } -int16 Logic::previousInventoryItem(int16 start) const { +int16 Logic::previousInventoryItem(int16 first) const { int i; - for (i = start - 1; i >= 1; i--) + for (i = first - 1; i >= 1; i--) if (_itemData[i].name > 0) return i; - for (i = _numItems; i > start; i--) + for (i = _numItems; i > first; i--) if (_itemData[i].name > 0) return i; return 0; //nothing found } -int16 Logic::nextInventoryItem(int16 start) const { +int16 Logic::nextInventoryItem(int16 first) const { int i; - for (i = start + 1; i < _numItems; i++) + for (i = first + 1; i < _numItems; i++) if (_itemData[i].name > 0) return i; - for (i = 1; i < start; i++) + for (i = 1; i < first; i++) if (_itemData[i].name > 0) return i; diff --git a/queen/logic.h b/queen/logic.h index ea764aa293..590d1031ac 100644 --- a/queen/logic.h +++ b/queen/logic.h @@ -155,8 +155,8 @@ public: void inventorySetup(); uint16 findInventoryItem(int invSlot) const; void inventoryRefresh(); - int16 previousInventoryItem(int16 start) const; - int16 nextInventoryItem(int16 start) const; + int16 previousInventoryItem(int16 first) const; + int16 nextInventoryItem(int16 first) const; void removeDuplicateItems(); uint16 numItemsInventory() const; void inventoryInsertItem(uint16 itemNum, bool refresh = true); @@ -196,6 +196,8 @@ public: void startCredits(const char *filename); void stopCredits(); + void start(); + enum { JOE_RESPONSE_MAX = 40, DEFAULT_TALK_SPEED = 7 * 3, @@ -205,8 +207,6 @@ public: protected: - void initialise(); - void asmMakeJoeUseDress(); void asmMakeJoeUseNormalClothes(); void asmMakeJoeUseUnderwear(); diff --git a/queen/queen.cpp b/queen/queen.cpp index 998e0cb501..5057a4f19b 100644 --- a/queen/queen.cpp +++ b/queen/queen.cpp @@ -289,6 +289,7 @@ void QueenEngine::errorString(const char *buf1, char *buf2) { } int QueenEngine::go() { + _logic->start(); _logic->oldRoom(0); _logic->newRoom(_logic->currentRoom()); |