aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Montoir2003-12-12 20:26:20 +0000
committerGregory Montoir2003-12-12 20:26:20 +0000
commitc3c55a457c00525a9eaaad48c04c30aa374b4075 (patch)
tree062eba8e2ae2a67e746bc29c9c80ec44fc674bb3
parent8f5c14aebe0ca423ede54e36d16d626bfab110ed (diff)
downloadscummvm-rg350-c3c55a457c00525a9eaaad48c04c30aa374b4075.tar.gz
scummvm-rg350-c3c55a457c00525a9eaaad48c04c30aa374b4075.tar.bz2
scummvm-rg350-c3c55a457c00525a9eaaad48c04c30aa374b4075.zip
cleanup
svn-id: r11600
-rw-r--r--queen/command.cpp4
-rw-r--r--queen/input.cpp34
-rw-r--r--queen/logic.cpp39
-rw-r--r--queen/logic.h3
-rw-r--r--queen/walk.cpp3
-rw-r--r--queen/walk.h5
6 files changed, 42 insertions, 46 deletions
diff --git a/queen/command.cpp b/queen/command.cpp
index c1826e57ec..e91b39003f 100644
--- a/queen/command.cpp
+++ b/queen/command.cpp
@@ -847,7 +847,7 @@ bool Command::handleDefaultCommand(bool walk) {
if (_selCmd.action == VERB_NONE) {
_vm->graphics()->textClear(CmdText::COMMAND_Y_POS, CmdText::COMMAND_Y_POS);
}
- _vm->walk()->moveJoe(0, _selPosX, _selPosY, false); // XXX inCutaway parameter
+ _vm->walk()->moveJoe(0, _selPosX, _selPosY, false);
return true;
}
// check to see if one of the objects is hidden
@@ -1501,7 +1501,7 @@ void Command::lookCurrentRoom() {
if (i <= 0) {
_curCmd.oldNoun = _curCmd.noun;
_vm->graphics()->textClear(CmdText::COMMAND_Y_POS, CmdText::COMMAND_Y_POS);
- if (_selCmd.defaultVerb != VERB_NONE) {
+ if (_selCmd.defaultVerb != VERB_NONE) {
_cmdText.displayTemp(INK_CMD_LOCK, true, _selCmd.defaultVerb);
}
else if (_curCmd.action != VERB_NONE) {
diff --git a/queen/input.cpp b/queen/input.cpp
index 6f184c328c..d8b35e37af 100644
--- a/queen/input.cpp
+++ b/queen/input.cpp
@@ -132,31 +132,31 @@ int Input::checkKeys() {
switch (_inKey) {
case KEY_SPACE:
- _keyVerb = Verb(VERB_SKIP_TEXT);
+ _keyVerb = VERB_SKIP_TEXT;
break;
case KEY_COMMA:
- _keyVerb = Verb(VERB_SCROLL_UP);
+ _keyVerb = VERB_SCROLL_UP;
break;
case KEY_DOT:
- _keyVerb = Verb(VERB_SCROLL_DOWN);
+ _keyVerb = VERB_SCROLL_DOWN;
break;
case KEY_DIGIT_1:
- _keyVerb = Verb(VERB_DIGIT_1);
+ _keyVerb = VERB_DIGIT_1;
break;
case KEY_DIGIT_2:
- _keyVerb = Verb(VERB_DIGIT_2);
+ _keyVerb = VERB_DIGIT_2;
break;
case KEY_DIGIT_3:
- _keyVerb = Verb(VERB_DIGIT_3);
+ _keyVerb = VERB_DIGIT_3;
break;
case KEY_DIGIT_4:
- _keyVerb = Verb(VERB_DIGIT_4);
+ _keyVerb = VERB_DIGIT_4;
break;
case KEY_ESCAPE:
@@ -174,12 +174,12 @@ int Input::checkKeys() {
case KEY_F1: // Use Journal
if (_cutawayRunning) {
if (_canQuit) {
- _keyVerb = Verb(VERB_USE_JOURNAL);
+ _keyVerb = VERB_USE_JOURNAL;
_cutawayQuit = _talkQuit = true;
}
}
else {
- _keyVerb = Verb(VERB_USE_JOURNAL);
+ _keyVerb = VERB_USE_JOURNAL;
if (_canQuit)
_talkQuit = true;
}
@@ -195,21 +195,21 @@ int Input::checkKeys() {
default:
if(_inKey == _currentCommandKeys[0])
- _keyVerb = Verb(VERB_OPEN);
+ _keyVerb = VERB_OPEN;
else if(_inKey == _currentCommandKeys[1])
- _keyVerb = Verb(VERB_CLOSE);
+ _keyVerb = VERB_CLOSE;
else if(_inKey == _currentCommandKeys[2])
- _keyVerb = Verb(VERB_MOVE);
+ _keyVerb = VERB_MOVE;
else if(_inKey == _currentCommandKeys[3])
- _keyVerb = Verb(VERB_GIVE);
+ _keyVerb = VERB_GIVE;
else if(_inKey == _currentCommandKeys[4])
- _keyVerb = Verb(VERB_LOOK_AT);
+ _keyVerb = VERB_LOOK_AT;
else if(_inKey == _currentCommandKeys[5])
- _keyVerb = Verb(VERB_PICK_UP);
+ _keyVerb = VERB_PICK_UP;
else if(_inKey == _currentCommandKeys[6])
- _keyVerb = Verb(VERB_TALK_TO);
+ _keyVerb = VERB_TALK_TO;
else if(_inKey == _currentCommandKeys[7])
- _keyVerb = Verb(VERB_USE);
+ _keyVerb = VERB_USE;
break;
}
diff --git a/queen/logic.cpp b/queen/logic.cpp
index 6c87191c1c..a24d3e7ae3 100644
--- a/queen/logic.cpp
+++ b/queen/logic.cpp
@@ -41,25 +41,6 @@
namespace Queen {
-const Verb Logic::PANEL_VERBS[] = {
- VERB_NONE,
- VERB_OPEN,
- VERB_CLOSE,
- VERB_MOVE,
- VERB_GIVE,
- VERB_LOOK_AT,
- VERB_PICK_UP,
- VERB_TALK_TO,
- VERB_USE,
- VERB_SCROLL_UP,
- VERB_SCROLL_DOWN,
- VERB_DIGIT_1, // inventory item 1
- VERB_DIGIT_2, // inventory item 2
- VERB_DIGIT_3, // inventory item 3
- VERB_DIGIT_4, // inventory item 4
-};
-
-
Logic::Logic(QueenEngine *vm)
: _vm(vm) {
_joe.x = _joe.y = 0;
@@ -1789,8 +1770,24 @@ void Logic::joeSpeak(uint16 descNum, bool objectType) {
Verb Logic::findVerbUnderCursor(int16 cursorx, int16 cursory) const {
-
- return Verb(PANEL_VERBS[zoneIn(ZONE_PANEL, cursorx, cursory)]);
+ static const Verb pv[] = {
+ VERB_NONE,
+ VERB_OPEN,
+ VERB_CLOSE,
+ VERB_MOVE,
+ VERB_GIVE,
+ VERB_LOOK_AT,
+ VERB_PICK_UP,
+ VERB_TALK_TO,
+ VERB_USE,
+ VERB_SCROLL_UP,
+ VERB_SCROLL_DOWN,
+ VERB_INV_1,
+ VERB_INV_2,
+ VERB_INV_3,
+ VERB_INV_4,
+ };
+ return pv[zoneIn(ZONE_PANEL, cursorx, cursory)];
}
diff --git a/queen/logic.h b/queen/logic.h
index e9ce7851cc..e1a9d42c14 100644
--- a/queen/logic.h
+++ b/queen/logic.h
@@ -427,9 +427,6 @@ protected:
Debug *_dbg;
QueenEngine *_vm;
-
- //! Verbs (in order) available in panel
- static const Verb PANEL_VERBS[];
};
diff --git a/queen/walk.cpp b/queen/walk.cpp
index 4b16083cf9..6b90601704 100644
--- a/queen/walk.cpp
+++ b/queen/walk.cpp
@@ -298,12 +298,11 @@ void Walk::animatePerson(const MovePersonData *mpd, uint16 image, uint16 bobNum,
int16 Walk::moveJoe(int direction, int16 endx, int16 endy, bool inCutaway) {
+ _joeInterrupted = false;
_joeMoveBlock = false;
int16 can = 0;
initWalkData();
- _joeInterrupted = false;
-
uint16 oldx = _vm->graphics()->bob(0)->x;
uint16 oldy = _vm->graphics()->bob(0)->y;
diff --git a/queen/walk.h b/queen/walk.h
index 3dfae9edd0..369676da0b 100644
--- a/queen/walk.h
+++ b/queen/walk.h
@@ -75,6 +75,7 @@ public:
void stopJoe();
+
enum {
MAX_WALK_DATA = 16
};
@@ -122,13 +123,15 @@ private:
uint16 _areaList[MAX_WALK_DATA];
uint16 _areaListCount;
+ //! set if stopJoe() is called
bool _joeInterrupted;
- //! set if customMoveJoe() is called in joeAnimate()
+ //! set if customMoveJoe() is called
bool _joeMoveBlock;
QueenEngine *_vm;
+
static const MovePersonData _moveData[];
};