aboutsummaryrefslogtreecommitdiff
path: root/queen
diff options
context:
space:
mode:
authorDavid Eriksson2003-11-07 10:57:21 +0000
committerDavid Eriksson2003-11-07 10:57:21 +0000
commit2a71ac0dc81331280a9b22f20db98cec006bd819 (patch)
tree04637830a6443e6b82ddccb22ba5f57c00d32f5b /queen
parente01ab4599d0bcd96c506a75a3da6938e82ac7171 (diff)
downloadscummvm-rg350-2a71ac0dc81331280a9b22f20db98cec006bd819.tar.gz
scummvm-rg350-2a71ac0dc81331280a9b22f20db98cec006bd819.tar.bz2
scummvm-rg350-2a71ac0dc81331280a9b22f20db98cec006bd819.zip
Minor fixes.
svn-id: r11185
Diffstat (limited to 'queen')
-rw-r--r--queen/cutaway.cpp21
-rw-r--r--queen/cutaway.h3
-rw-r--r--queen/logic.cpp2
-rw-r--r--queen/structs.h3
-rw-r--r--queen/verb.h2
-rw-r--r--queen/walk.cpp4
6 files changed, 27 insertions, 8 deletions
diff --git a/queen/cutaway.cpp b/queen/cutaway.cpp
index cc394468c7..e3364e6da5 100644
--- a/queen/cutaway.cpp
+++ b/queen/cutaway.cpp
@@ -202,9 +202,9 @@ void Cutaway::loadStrings(byte *ptr) {
ptr = Talk::getString(ptr, _talkFile, MAX_FILENAME_LENGTH);
debug(0, "Talk file = '%s'", _talkFile);
- int TALKTO = READ_BE_UINT16(ptr);
+ _talkTo = (int16)READ_BE_UINT16(ptr);
ptr += 2;
- debug(0, "TALKTO = %i", TALKTO);
+ debug(0, "_talkTo = %i", _talkTo);
}
byte *Cutaway::getCutawayObject(byte *ptr, CutawayObject &object)
@@ -999,7 +999,7 @@ void Cutaway::handlePersonRecord(
}
else {
_logic->personSetData(
- object.objectNumber - _logic->roomData(object.room),
+ object.objectNumber - _logic->roomData(_logic->currentRoom()),
"", true, &p);
if (object.bobStartX || object.bobStartY) {
@@ -1060,7 +1060,7 @@ void Cutaway::run(char *nextFilename) {
int i;
nextFilename[0] = '\0';
- byte *ptr = _objectData;
+ _currentImage = _logic->numFrames();
int initialJoeX = _logic->joeX();
int initialJoeY = _logic->joeY();
@@ -1072,6 +1072,8 @@ void Cutaway::run(char *nextFilename) {
// XXX if (_comPanel == 0 || _comPanel == 2)
// XXX SCENE_START(0);
+ byte *ptr = _objectData;
+
for (i = 0; i < _cutawayObjectCount; i++) {
CutawayObject object;
ptr = getCutawayObject(ptr, object);
@@ -1464,7 +1466,16 @@ void Cutaway::talk(char *nextFilename) {
if (0 == scumm_stricmp(right(_talkFile, 4), ".dog")) {
nextFilename[0] = '\0';
- Talk::talk(_talkFile, 0 /* XXX */, nextFilename, _graphics, _input, _logic, _resource, _sound);
+ int personInRoom;
+
+ if (_talkTo > 0)
+ personInRoom = _talkTo - _logic->roomData(_logic->currentRoom());
+ else {
+ warning("_talkTo is 0!");
+ personInRoom = 0; // XXX is this correct?
+ }
+
+ Talk::talk(_talkFile, personInRoom, nextFilename, _graphics, _input, _logic, _resource, _sound);
}
}
diff --git a/queen/cutaway.h b/queen/cutaway.h
index 1d4e0ed0ca..f482619492 100644
--- a/queen/cutaway.h
+++ b/queen/cutaway.h
@@ -185,6 +185,9 @@ class Cutaway {
//! Name of .dog file
char _talkFile[MAX_FILENAME_SIZE];
+ //! Person to talk to
+ int16 _talkTo;
+
//! Used by changeRooms
ObjectDataBackup _personData[MAX_PERSON_COUNT];
diff --git a/queen/logic.cpp b/queen/logic.cpp
index 7435145d3b..e6b9eaccaf 100644
--- a/queen/logic.cpp
+++ b/queen/logic.cpp
@@ -1240,7 +1240,7 @@ uint16 Logic::findScale(uint16 x, uint16 y) {
void Logic::personSetData(int16 noun, const char *actorName, bool loadBank, Person *pp) {
if (noun <= 0) {
- warning("Logic::personSetData() - Negative object number");
+ warning("Logic::personSetData() - Invalid object number: %i", noun);
}
uint16 i;
diff --git a/queen/structs.h b/queen/structs.h
index 78e569c703..08f7bfcf55 100644
--- a/queen/structs.h
+++ b/queen/structs.h
@@ -22,10 +22,9 @@
#ifndef QUEENSTRUCTS_H
#define QUEENSTRUCTS_H
-namespace Queen {
-
#include "queen/verb.h"
+namespace Queen {
struct Box {
int16 x1, y1, x2, y2;
diff --git a/queen/verb.h b/queen/verb.h
index c787d0ecb9..7139df3b23 100644
--- a/queen/verb.h
+++ b/queen/verb.h
@@ -23,6 +23,7 @@
#ifndef QUEENVERB_H
#define QUEENVERB_H
+namespace Queen {
enum VerbEnum {
VERB_NONE = 0,
@@ -167,5 +168,6 @@ private:
static char* _verbName[13];
};
+} // End of namespace Queen
#endif
diff --git a/queen/walk.cpp b/queen/walk.cpp
index c23a468a58..116e72b95b 100644
--- a/queen/walk.cpp
+++ b/queen/walk.cpp
@@ -344,6 +344,10 @@ int16 Walk::joeMove(int direction, int16 endx, int16 endy, bool inCutaway) {
int16 Walk::personMove(const Person *pp, int16 endx, int16 endy, uint16 curImage, int direction) {
+ if (curImage > MAX_FRAMES_NUMBER) {
+ error("[Walk::personMove] curImage is invalid: %i", curImage);
+ }
+
if (endx == 0 && endy == 0) {
warning("Walk::personMove() - endx == 0 && endy == 0");
return 0;