diff options
-rw-r--r-- | queen/command.cpp | 4 | ||||
-rw-r--r-- | queen/logic.cpp | 31 | ||||
-rw-r--r-- | queen/logic.h | 4 | ||||
-rw-r--r-- | queen/talk.cpp | 4 | ||||
-rw-r--r-- | queen/xref.txt | 3 |
5 files changed, 12 insertions, 34 deletions
diff --git a/queen/command.cpp b/queen/command.cpp index df1c4b82e9..4d9e673f23 100644 --- a/queen/command.cpp +++ b/queen/command.cpp @@ -371,10 +371,10 @@ int16 Command::executeCommand(uint16 comId, int16 condResult) { // Don't grab if action is TALK or WALK if (_selCmd.action.value() != VERB_TALK_TO && _selCmd.action.value() != VERB_WALK_TO) { if (_curCmd.subject1 > 0) { - _logic->joeGrab(_logic->objectData(_curCmd.subject1)->state, 0); + _logic->joeGrab(State::findGrab(_logic->objectData(_curCmd.subject1)->state)); } if (_curCmd.subject2 > 0) { - _logic->joeGrab(_logic->objectData(_curCmd.subject2)->state, 0); + _logic->joeGrab(State::findGrab(_logic->objectData(_curCmd.subject2)->state)); } } diff --git a/queen/logic.cpp b/queen/logic.cpp index e7aeeea753..565acebc43 100644 --- a/queen/logic.cpp +++ b/queen/logic.cpp @@ -32,6 +32,7 @@ #include "queen/journal.h" #include "queen/resource.h" #include "queen/sound.h" +#include "queen/state.h" #include "queen/talk.h" #include "queen/walk.h" @@ -1647,23 +1648,12 @@ uint16 Logic::joeFace() { } -void Logic::joeGrab(uint16 state, uint16 speed) { - - StateGrab sg = State::findGrab(state); - if (sg != STATE_GRAB_NONE) { - joeGrabDirection(sg, speed); - } -} - - -void Logic::joeGrabDirection(StateGrab grab, uint16 speed) { - - // if speed == 0, then keep Joe in position +void Logic::joeGrab(int16 grabState) { uint16 frame = 0; BobSlot *bobJoe = _graphics->bob(0); - - switch (grab) { + + switch (grabState) { case STATE_GRAB_NONE: break; @@ -1700,12 +1690,7 @@ void Logic::joeGrabDirection(StateGrab grab, uint16 speed) { bobJoe->scale = joeScale(); update(); // turn back - if (speed == 0) { - frame = 7; - } - else { - frame = 5; - } + frame = 7; break; } @@ -1716,14 +1701,10 @@ void Logic::joeGrabDirection(StateGrab grab, uint16 speed) { update(); // extra delay for grab down - if (grab == STATE_GRAB_DOWN) { + if (grabState == STATE_GRAB_DOWN) { update(); update(); } - - if (speed > 0) { - joeFace(); - } } } diff --git a/queen/logic.h b/queen/logic.h index d46fcd7362..25c4f63e90 100644 --- a/queen/logic.h +++ b/queen/logic.h @@ -25,7 +25,6 @@ #include "common/util.h" #include "queen/defs.h" #include "queen/structs.h" -#include "queen/state.h" // for joeGrabDirection() #include "queen/verb.h" namespace Queen { @@ -191,8 +190,7 @@ public: ObjectData *joeSetupInRoom(bool autoPosition, uint16 scale); uint16 joeFace(); - void joeGrab(uint16 state, uint16 speed); - void joeGrabDirection(StateGrab grab, uint16 speed); + void joeGrab(int16 grabState); void joeUseDress(bool showCut); void joeUseClothes(bool showCut); diff --git a/queen/talk.cpp b/queen/talk.cpp index 0ce91e6078..368be4491c 100644 --- a/queen/talk.cpp +++ b/queen/talk.cpp @@ -540,10 +540,10 @@ int Talk::getSpeakCommand(const char *sentence, unsigned &index) { case 'G': switch (sentence[index + 1]) { case 'D': - _logic->joeGrabDirection(STATE_GRAB_DOWN, 0); + _logic->joeGrab(STATE_GRAB_DOWN); break; case 'M': - _logic->joeGrabDirection(STATE_GRAB_MID, 0); + _logic->joeGrab(STATE_GRAB_MID); break; default: warning("Unknown command string: '%2s'", sentence + index); diff --git a/queen/xref.txt b/queen/xref.txt index 33396becf7..82c740780b 100644 --- a/queen/xref.txt +++ b/queen/xref.txt @@ -172,8 +172,7 @@ INV1,INV2,INV3,INV4 Logic::_inventoryItem JOE === FACE_JOE() Logic::joeFace -GRAB_DIR() Logic::joeGrabDirection -GRAB_JOE() Logic::joeGrab +GRAB_DIR(),GRAB_JOE() Logic::joeGrab SETUP_HERO() Logic::joeSetupInRoom SETUP_JOE() Logic::joeSetup USE_UNDERWEAR() Logic::joeUseUnderwear |