merged Logic::joeGrab & Logic::joeGrabDirection and removed speed argument as it always equals 0

svn-id: r11582
This commit is contained in:
Gregory Montoir 2003-12-11 13:26:13 +00:00
parent 9f465dab04
commit 3174cef127
5 changed files with 12 additions and 34 deletions

View File

@ -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));
}
}

View File

@ -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();
}
}
}

View File

@ -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);

View File

@ -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);

View File

@ -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