diff options
author | Paul Gilbert | 2015-06-14 09:39:20 -0400 |
---|---|---|
committer | Paul Gilbert | 2015-06-14 09:39:20 -0400 |
commit | 5b65b76a8fc7525402816d7c5393866cafa038d3 (patch) | |
tree | 235612cfee016fb1d31f88fa7d6d46a98749b68a /engines | |
parent | 5364b46d6ac2a0907d864ec1aa60cd4835f4d1dc (diff) | |
download | scummvm-rg350-5b65b76a8fc7525402816d7c5393866cafa038d3.tar.gz scummvm-rg350-5b65b76a8fc7525402816d7c5393866cafa038d3.tar.bz2 scummvm-rg350-5b65b76a8fc7525402816d7c5393866cafa038d3.zip |
SHERLOCK: RT: Fix initialization of character animation sequences
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sherlock/objects.cpp | 3 | ||||
-rw-r--r-- | engines/sherlock/tattoo/tattoo_people.cpp | 40 |
2 files changed, 23 insertions, 20 deletions
diff --git a/engines/sherlock/objects.cpp b/engines/sherlock/objects.cpp index df91995c35..9fb691966b 100644 --- a/engines/sherlock/objects.cpp +++ b/engines/sherlock/objects.cpp @@ -649,8 +649,7 @@ void Sprite::checkSprite() { pt.y /= FIXED_INT_MULTIPLIER; if (IS_ROSE_TATTOO) { - // TODO: Needs to be called - //checkObject(1001); + checkObject(); // For Rose Tattoo, we only do the further processing for Sherlock if (this != &people[HOLMES]) diff --git a/engines/sherlock/tattoo/tattoo_people.cpp b/engines/sherlock/tattoo/tattoo_people.cpp index cec8cd9bdf..2bdf1164ab 100644 --- a/engines/sherlock/tattoo/tattoo_people.cpp +++ b/engines/sherlock/tattoo/tattoo_people.cpp @@ -689,55 +689,59 @@ bool TattooPeople::loadWalk() { bool result = false; for (int idx = 0; idx < MAX_CHARACTERS; ++idx) { - if (!_data[idx]->_walkLoaded && (_data[idx]->_type == CHARACTER || _data[idx]->_type == HIDDEN_CHARACTER)) { - if (_data[idx]->_type == HIDDEN_CHARACTER) - _data[idx]->_type = INVALID; + Person &person = *_data[idx]; + + if (!person._walkLoaded && (person._type == CHARACTER || person._type == HIDDEN_CHARACTER)) { + if (person._type == HIDDEN_CHARACTER) + person._type = INVALID; // See if this is one of the more used Walk Graphics stored in WALK.LIB for (int libNum = 0; libNum < NUM_IN_WALK_LIB; ++libNum) { - if (!_data[idx]->_walkVGSName.compareToIgnoreCase(WALK_LIB_NAMES[libNum])) { + if (!person._walkVGSName.compareToIgnoreCase(WALK_LIB_NAMES[libNum])) { _useWalkLib = true; break; } } // Load the images for the character - _data[idx]->_images = new ImageFile(_data[idx]->_walkVGSName, false); - _data[idx]->_maxFrames = _data[idx]->_images->size(); + person._images = new ImageFile(person._walkVGSName, false); + person._maxFrames = person._images->size(); // Load walk sequence data - Common::String fname = Common::String(_data[idx]->_walkVGSName.c_str(), strchr(_data[idx]->_walkVGSName.c_str(), '.')); + Common::String fname = Common::String(person._walkVGSName.c_str(), strchr(person._walkVGSName.c_str(), '.')); fname += ".SEQ"; // Load the walk sequence data Common::SeekableReadStream *stream = res.load(fname, _useWalkLib ? "walk.lib" : "vgs.lib"); - _data[idx]->_walkSequences.resize(stream->readByte()); + person._walkSequences.resize(stream->readByte()); - for (uint seqNum = 0; seqNum < _data[idx]->_walkSequences.size(); ++seqNum) - _data[idx]->_walkSequences[seqNum].load(*stream); + for (uint seqNum = 0; seqNum < person._walkSequences.size(); ++seqNum) + person._walkSequences[seqNum].load(*stream); // Close the sequences resource delete stream; _useWalkLib = false; - _data[idx]->_frameNumber = 0; - _data[idx]->setImageFrame(); + person._sequences = &person._walkSequences[person._sequenceNumber]._sequences[0]; + person._seqSize = person._walkSequences[person._sequenceNumber]._sequences.size(); + person._frameNumber = 0; + person.setImageFrame(); // Set the stop Frames pointers for (int dirNum = 0; dirNum < 8; ++dirNum) { int count = 0; - while (_data[idx]->_walkSequences[dirNum + 8][count] != 0) + while (person._walkSequences[dirNum + 8][count] != 0) ++count; count += 2; - count = _data[idx]->_walkSequences[dirNum + 8][count] - 1; - _data[idx]->_stopFrames[dirNum] = &(*_data[idx]->_images)[count]; + count = person._walkSequences[dirNum + 8][count] - 1; + person._stopFrames[dirNum] = &(*person._images)[count]; } result = true; - _data[idx]->_walkLoaded = true; - } else if (_data[idx]->_type != CHARACTER) { - _data[idx]->_walkLoaded = false; + person._walkLoaded = true; + } else if (person._type != CHARACTER) { + person._walkLoaded = false; } } |