diff options
Diffstat (limited to 'engines/sherlock/scene.cpp')
-rw-r--r-- | engines/sherlock/scene.cpp | 38 |
1 files changed, 28 insertions, 10 deletions
diff --git a/engines/sherlock/scene.cpp b/engines/sherlock/scene.cpp index f473004d9a..093c305a97 100644 --- a/engines/sherlock/scene.cpp +++ b/engines/sherlock/scene.cpp @@ -27,7 +27,10 @@ namespace Sherlock { -void BgFileHeader::synchronize(Common::SeekableReadStream &s) { +/** + * Load the data for the object + */ +void BgFileHeader::load(Common::SeekableReadStream &s) { _numStructs = s.readUint16LE(); _numImages = s.readUint16LE(); _numcAnimations = s.readUint16LE(); @@ -38,7 +41,10 @@ void BgFileHeader::synchronize(Common::SeekableReadStream &s) { /*----------------------------------------------------------------*/ -void BgfileheaderInfo::synchronize(Common::SeekableReadStream &s) { +/** + * Load the data for the object + */ +void BgfileheaderInfo::load(Common::SeekableReadStream &s) { _filesize = s.readUint32LE(); _maxFrames = s.readByte(); @@ -49,7 +55,10 @@ void BgfileheaderInfo::synchronize(Common::SeekableReadStream &s) { /*----------------------------------------------------------------*/ -void Exit::synchronize(Common::SeekableReadStream &s) { +/** + * Load the data for the object + */ +void Exit::load(Common::SeekableReadStream &s) { int xp = s.readSint16LE(); int yp = s.readSint16LE(); int xSize = s.readSint16LE(); @@ -65,14 +74,20 @@ void Exit::synchronize(Common::SeekableReadStream &s) { /*----------------------------------------------------------------*/ -void SceneEntry::synchronize(Common::SeekableReadStream &s) { +/** + * Load the data for the object + */ +void SceneEntry::load(Common::SeekableReadStream &s) { _startPosition.x = s.readSint16LE(); _startPosition.y = s.readSint16LE(); _startDir = s.readByte(); _allow = s.readByte(); } -void SceneSound::synchronize(Common::SeekableReadStream &s) { +/** + * Load the data for the object + */ +void SceneSound::load(Common::SeekableReadStream &s) { char buffer[9]; s.read(buffer, 8); buffer[8] = '\0'; @@ -83,6 +98,9 @@ void SceneSound::synchronize(Common::SeekableReadStream &s) { /*----------------------------------------------------------------*/ +/** + * Retuurn the index of the passed object in the array + */ int ObjectArray::indexOf(const Object &obj) const { for (uint idx = 0; idx < size(); ++idx) { if (&(*this)[idx] == &obj) @@ -244,7 +262,7 @@ bool Scene::loadScene(const Common::String &filename) { // Go to header and read it in rrmStream->seek(rrmStream->readUint32LE()); BgFileHeader bgHeader; - bgHeader.synchronize(*rrmStream); + bgHeader.load(*rrmStream); _invGraphicItems = bgHeader._numImages + 1; // Read in the shapes header info @@ -252,7 +270,7 @@ bool Scene::loadScene(const Common::String &filename) { bgInfo.resize(bgHeader._numStructs); for (uint idx = 0; idx < bgInfo.size(); ++idx) - bgInfo[idx].synchronize(*rrmStream); + bgInfo[idx].load(*rrmStream); // Read information Common::SeekableReadStream *infoStream = !_lzwMode ? rrmStream : @@ -366,17 +384,17 @@ bool Scene::loadScene(const Common::String &filename) { _exits.resize(numExits); for (int idx = 0; idx < numExits; ++idx) - _exits[idx].synchronize(*rrmStream); + _exits[idx].load(*rrmStream); // Read in the entrance - _entrance.synchronize(*rrmStream); + _entrance.load(*rrmStream); // Initialize sound list int numSounds = rrmStream->readByte(); _sounds.resize(numSounds); for (int idx = 0; idx < numSounds; ++idx) - _sounds[idx].synchronize(*rrmStream); + _sounds[idx].load(*rrmStream); for (int idx = 0; idx < numSounds; ++idx) sound.loadSound(_sounds[idx]._name, _sounds[idx]._priority); |