aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2015-05-09 13:08:36 +0200
committerStrangerke2015-05-09 13:08:36 +0200
commitf622d7471e7f04f92c728cab7de9dd0a109886c3 (patch)
tree3405fa295271326228fa3f79a993d3c4b8344d01
parente3e4354f880d5f9354706b8f20d204960c48bb97 (diff)
downloadscummvm-rg350-f622d7471e7f04f92c728cab7de9dd0a109886c3.tar.gz
scummvm-rg350-f622d7471e7f04f92c728cab7de9dd0a109886c3.tar.bz2
scummvm-rg350-f622d7471e7f04f92c728cab7de9dd0a109886c3.zip
SHERLOCK: Some more fixes
-rw-r--r--engines/sherlock/journal.cpp2
-rw-r--r--engines/sherlock/people.cpp4
-rw-r--r--engines/sherlock/talk.cpp33
3 files changed, 20 insertions, 19 deletions
diff --git a/engines/sherlock/journal.cpp b/engines/sherlock/journal.cpp
index 5ecb5ae26c..926ccee38a 100644
--- a/engines/sherlock/journal.cpp
+++ b/engines/sherlock/journal.cpp
@@ -1125,7 +1125,7 @@ int Journal::getFindName(bool printError) {
if (events.kbHit()) {
Common::KeyState keyState = events.getKey();
- if ((keyState.keycode == Common::KEYCODE_BACKSPACE) && (name.c_str() > 0)) {
+ if ((keyState.keycode == Common::KEYCODE_BACKSPACE) && (name.size() > 0)) {
screen.vgaBar(Common::Rect(xp - screen.charWidth(name.lastChar()), yp, xp + 8, yp + 9), BUTTON_MIDDLE);
xp -= screen.charWidth(name.lastChar());
screen.vgaBar(Common::Rect(xp, yp, xp + 8, yp + 9), INV_FOREGROUND);
diff --git a/engines/sherlock/people.cpp b/engines/sherlock/people.cpp
index acc660b0c0..f73ebd8cb0 100644
--- a/engines/sherlock/people.cpp
+++ b/engines/sherlock/people.cpp
@@ -335,10 +335,10 @@ void People::setWalking() {
// Set the initial frame sequence for the left and right, as well
// as setting the delta x depending on direction
if (_walkDest.x < (_player._position.x / 100)) {
- _player._sequenceNumber = (int) (map._active ? MAP_LEFT : WALK_LEFT);
+ _player._sequenceNumber = (map._active ? (int)MAP_LEFT : (int)WALK_LEFT);
_player._delta.x = speed.x * -100;
} else {
- _player._sequenceNumber = (int) (map._active ? MAP_RIGHT : WALK_RIGHT);
+ _player._sequenceNumber = (map._active ? (int)MAP_RIGHT : (int)WALK_RIGHT);
_player._delta.x = speed.x * 100;
}
diff --git a/engines/sherlock/talk.cpp b/engines/sherlock/talk.cpp
index bbc61a3c13..74bd98c4e1 100644
--- a/engines/sherlock/talk.cpp
+++ b/engines/sherlock/talk.cpp
@@ -604,7 +604,7 @@ void Talk::stripVoiceCommands() {
// Scan for an sound effect byte, which indicates to play a sound
for (uint idx = 0; idx < statement._reply.size(); ++idx) {
- if (statement._reply[idx] == (int)SFX_COMMAND) {
+ if (statement._reply[idx] == (char)SFX_COMMAND) {
// Replace instruction character with a space, and delete the
// rest of the name following it
statement._reply = Common::String(statement._reply.c_str(),
@@ -1004,7 +1004,6 @@ void Talk::doScript(const Common::String &script) {
int line = 0;
bool noTextYet = true;
bool openTalkWindow = false;
- int obj;
int seqCount;
_savedSequences.clear();
@@ -1164,18 +1163,19 @@ void Talk::doScript(const Common::String &script) {
break;
case ADJUST_OBJ_SEQUENCE:
+ {
// Get the name of the object to adjust
++str;
for (int idx = 0; idx < (str[0] & 127); ++idx)
tempString += str[idx + 2];
// Scan for object
- obj = -1;
+ int objId = -1;
for (uint idx = 0; idx < scene._bgShapes.size(); ++idx) {
if (scumm_stricmp(tempString.c_str(), scene._bgShapes[idx]._name.c_str()) == 0)
- obj = idx;
+ objId = idx;
}
- if (obj == -1)
+ if (objId == -1)
error("Could not find object %s to change", tempString.c_str());
// Should the script be overwritten?
@@ -1183,10 +1183,10 @@ void Talk::doScript(const Common::String &script) {
// Save the current sequence
_savedSequences.push(SequenceEntry());
SequenceEntry &seqEntry = _savedSequences.top();
- seqEntry._objNum = obj;
- seqEntry._seqTo = scene._bgShapes[obj]._seqTo;
- for (uint idx = 0; idx < scene._bgShapes[obj]._seqSize; ++idx)
- seqEntry._sequences.push_back(scene._bgShapes[obj]._sequences[idx]);
+ seqEntry._objNum = objId;
+ seqEntry._seqTo = scene._bgShapes[objId]._seqTo;
+ for (uint idx = 0; idx < scene._bgShapes[objId]._seqSize; ++idx)
+ seqEntry._sequences.push_back(scene._bgShapes[objId]._sequences[idx]);
}
// Get number of bytes to change
@@ -1195,14 +1195,15 @@ void Talk::doScript(const Common::String &script) {
// Copy in the new sequence
for (int idx = 0; idx < seqCount; ++idx, ++str)
- scene._bgShapes[obj]._sequences[idx] = str[0] - 1;
+ scene._bgShapes[objId]._sequences[idx] = str[0] - 1;
// Reset object back to beginning of new sequence
- scene._bgShapes[obj]._frameNumber = 0;
+ scene._bgShapes[objId]._frameNumber = 0;
continue;
+ }
case WALK_TO_COORDS:
- // Save the current point in the script, since it might be intterupted by
+ // Save the current point in the script, since it might be interrupted by
// doing bg anims in the next call, so we need to know where to return to
++str;
_scriptCurrentIndex = str - scriptStart;
@@ -1646,12 +1647,12 @@ void Talk::doScript(const Common::String &script) {
if (wait != -1) {
for (int ssIndex = 0; ssIndex < (int)_savedSequences.size(); ++ssIndex) {
SequenceEntry &seq = _savedSequences[ssIndex];
- Object &obj = scene._bgShapes[seq._objNum];
+ Object &object = scene._bgShapes[seq._objNum];
for (uint idx = 0; idx < seq._sequences.size(); ++idx)
- obj._sequences[idx] = seq._sequences[idx];
- obj._frameNumber = seq._frameNumber;
- obj._seqTo = seq._seqTo;
+ object._sequences[idx] = seq._sequences[idx];
+ object._frameNumber = seq._frameNumber;
+ object._seqTo = seq._seqTo;
}
pullSequence();