aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/sherlock/objects.cpp9
-rw-r--r--engines/sherlock/people.cpp21
2 files changed, 20 insertions, 10 deletions
diff --git a/engines/sherlock/objects.cpp b/engines/sherlock/objects.cpp
index 0709f6b7a9..31a209fea3 100644
--- a/engines/sherlock/objects.cpp
+++ b/engines/sherlock/objects.cpp
@@ -73,11 +73,16 @@ void Sprite::setImageFrame() {
int imageNumber = _walkSequences[_sequenceNumber][frameNum];
if (IS_SERRATED_SCALPEL)
- imageNumber = imageNumber + +_walkSequences[_sequenceNumber][0] - 2;
+ imageNumber = imageNumber + _walkSequences[_sequenceNumber][0] - 2;
else if (imageNumber > _numFrames)
imageNumber = 1;
- _imageFrame = &(_altSequences ? *_altImages : *_images)[imageNumber];
+ // Get the images to use
+ ImageFile *images = _altSequences ? _altImages : _images;
+ assert(images);
+
+ // Set the frame pointer
+ _imageFrame = &(*images)[imageNumber];
}
void Sprite::adjustSprite() {
diff --git a/engines/sherlock/people.cpp b/engines/sherlock/people.cpp
index c03dde80ad..083e3c8d4c 100644
--- a/engines/sherlock/people.cpp
+++ b/engines/sherlock/people.cpp
@@ -164,14 +164,17 @@ void People::reset() {
// Load the default walk sequences
p._oldWalkSequence = -1;
- p._walkSequences.resize(MAX_HOLMES_SEQUENCE);
- for (int idx = 0; idx < MAX_HOLMES_SEQUENCE; ++idx) {
- p._walkSequences[idx]._sequences.clear();
-
- const byte *pSrc = &CHARACTER_SEQUENCES[idx][0];
- do {
- p._walkSequences[idx]._sequences.push_back(*pSrc);
- } while (*pSrc++);
+
+ if (IS_SERRATED_SCALPEL) {
+ p._walkSequences.resize(MAX_HOLMES_SEQUENCE);
+ for (int seqIdx = 0; seqIdx < MAX_HOLMES_SEQUENCE; ++seqIdx) {
+ p._walkSequences[seqIdx]._sequences.clear();
+
+ const byte *pSrc = &CHARACTER_SEQUENCES[seqIdx][0];
+ do {
+ p._walkSequences[seqIdx]._sequences.push_back(*pSrc);
+ } while (*pSrc++);
+ }
}
}
@@ -259,6 +262,8 @@ bool People::freeWalk() {
if (_data[idx]._walkLoaded) {
delete _data[idx]._images;
_data[idx]._images = nullptr;
+
+ _data[idx]._walkLoaded = false;
result = true;
}
}