diff options
author | Gregory Montoir | 2003-12-13 20:05:28 +0000 |
---|---|---|
committer | Gregory Montoir | 2003-12-13 20:05:28 +0000 |
commit | 32d044d30219918eb7bb3c91a1b9910f9b2f86ed (patch) | |
tree | a0a76cec34e43d8b4d8f6d58ccea775ad859de66 /queen/logic.cpp | |
parent | 35c481fd61439864892b2b6c72fffe5af6592720 (diff) | |
download | scummvm-rg350-32d044d30219918eb7bb3c91a1b9910f9b2f86ed.tar.gz scummvm-rg350-32d044d30219918eb7bb3c91a1b9910f9b2f86ed.tar.bz2 scummvm-rg350-32d044d30219918eb7bb3c91a1b9910f9b2f86ed.zip |
some refactoring in Command code (removed/commented unused code, renamed some methods)
svn-id: r11619
Diffstat (limited to 'queen/logic.cpp')
-rw-r--r-- | queen/logic.cpp | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/queen/logic.cpp b/queen/logic.cpp index a24d3e7ae3..aa35d99f23 100644 --- a/queen/logic.cpp +++ b/queen/logic.cpp @@ -968,7 +968,7 @@ uint16 Logic::roomRefreshObject(uint16 obj) { // check the object is in the current room if (pod->room != _currentRoom) { - debug(0, "Trying to display an object (%i=%s) that is not in room (object room=%i, current room=%i)", obj, _objName[ABS(pod->name)], pod->room, _currentRoom); + debug(0, "Refreshing an object (%i=%s) not in current room (object room=%i, current room=%i)", obj, _objName[ABS(pod->name)], pod->room, _currentRoom); return curImage; } @@ -1770,6 +1770,7 @@ void Logic::joeSpeak(uint16 descNum, bool objectType) { Verb Logic::findVerbUnderCursor(int16 cursorx, int16 cursory) const { + static const Verb pv[] = { VERB_NONE, VERB_OPEN, @@ -1802,27 +1803,21 @@ uint16 Logic::findObjectUnderCursor(int16 cursorx, int16 cursory) const { } -uint16 Logic::findObjectRoomNumber(uint16 zoneNum) const { +uint16 Logic::findObjectNumber(uint16 zoneNum) const { // l.316-327 select.c - uint16 noun = zoneNum; - uint16 objectMax = _objMax[_currentRoom]; - debug(0, "Logic::findObjectRoomNumber(%X, %X)", zoneNum, objectMax); + uint16 obj = zoneNum; + uint16 objectMax = currentRoomObjMax(); + debug(9, "Logic::findObjectNumber(%X, %X)", zoneNum, objectMax); if (zoneNum > objectMax) { // this is an area box, check for associated object - uint16 obj = currentRoomArea(zoneNum - objectMax)->object; - if (obj != 0 && objectData(obj)->name != 0) { + obj = currentRoomArea(zoneNum - objectMax)->object; + if (obj != 0) { // there is an object, get its number - noun = obj - _roomData[_currentRoom]; + obj -= currentRoomData(); } } - return noun; -} - - -uint16 Logic::findObjectGlobalNumber(uint16 zoneNum) const { - - return _roomData[_currentRoom] + findObjectRoomNumber(zoneNum); + return obj; } @@ -2015,8 +2010,11 @@ void Logic::objectCopy(int dummyObjectIndex, int realObjectIndex) { void Logic::checkPlayer() { + update(); - _vm->command()->updatePlayer(); + if (!_vm->input()->cutawayRunning()) { + _vm->command()->updatePlayer(); + } } |