aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock/people.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2015-06-12 20:01:27 -0400
committerPaul Gilbert2015-06-12 20:01:27 -0400
commit8ac4ab484c588ce37e551e94d691c83864f0fe02 (patch)
treeb21e509333b0723e6783fb2d381f4f0bdd25ef68 /engines/sherlock/people.cpp
parented29691b2facecdfac934f90841f69e81c12e697 (diff)
downloadscummvm-rg350-8ac4ab484c588ce37e551e94d691c83864f0fe02.tar.gz
scummvm-rg350-8ac4ab484c588ce37e551e94d691c83864f0fe02.tar.bz2
scummvm-rg350-8ac4ab484c588ce37e551e94d691c83864f0fe02.zip
SHERLOCK: Split up loadWalk into descendent classes
Diffstat (limited to 'engines/sherlock/people.cpp')
-rw-r--r--engines/sherlock/people.cpp78
1 files changed, 0 insertions, 78 deletions
diff --git a/engines/sherlock/people.cpp b/engines/sherlock/people.cpp
index de0e6ae116..2945d37a25 100644
--- a/engines/sherlock/people.cpp
+++ b/engines/sherlock/people.cpp
@@ -254,84 +254,6 @@ void People::reset() {
}
}
-bool People::loadWalk() {
- Resources &res = *_vm->_res;
- bool result = false;
-
- if (IS_SERRATED_SCALPEL) {
- if (_data[PLAYER]->_walkLoaded) {
- return false;
- } else {
- if (_vm->getPlatform() != Common::kPlatform3DO) {
- _data[PLAYER]->_images = new ImageFile("walk.vgs");
- } else {
- // Load walk.anim on 3DO, which is a cel animation file
- _data[PLAYER]->_images = new ImageFile3DO("walk.anim", kImageFile3DOType_CelAnimation);
- }
- _data[PLAYER]->setImageFrame();
- _data[PLAYER]->_walkLoaded = true;
-
- result = true;
- }
- } else {
- 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;
-
- // 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])) {
- _useWalkLib = true;
- break;
- }
- }
-
- // Load the images for the character
- _data[idx]->_images = new ImageFile(_data[idx]->_walkVGSName, false);
- _data[idx]->_numFrames = _data[idx]->_images->size();
-
- // Load walk sequence data
- Common::String fname = Common::String(_data[idx]->_walkVGSName.c_str(), strchr(_data[idx]->_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());
-
- for (uint seqNum = 0; seqNum < _data[idx]->_walkSequences.size(); ++seqNum)
- _data[idx]->_walkSequences[seqNum].load(*stream);
-
- // Close the sequences resource
- delete stream;
- _useWalkLib = false;
-
- _data[idx]->_frameNumber = 0;
- _data[idx]->setImageFrame();
-
- // Set the stop Frames pointers
- for (int dirNum = 0; dirNum < 8; ++dirNum) {
- int count = 0;
- while (_data[idx]->_walkSequences[dirNum + 8][count] != 0)
- ++count;
- count += 2;
- count = _data[idx]->_walkSequences[dirNum + 8][count] - 1;
- _data[idx]->_stopFrames[dirNum] = &(*_data[idx]->_images)[count];
- }
-
- result = true;
- _data[idx]->_walkLoaded = true;
- } else if (_data[idx]->_type != CHARACTER) {
- _data[idx]->_walkLoaded = false;
- }
- }
- }
-
- _forceWalkReload = false;
- return result;
-}
-
bool People::freeWalk() {
bool result = false;