aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2015-05-12 22:06:39 -0400
committerWillem Jan Palenstijn2015-05-13 14:43:50 +0200
commitc1244623e084ab230aba3ad8cefb238f98575805 (patch)
treeed4107065a18d9c8a8079d5ce7e0bb8d652ae54c
parent44fbef5498070ee12fddb42c067d943e56d22f0e (diff)
downloadscummvm-rg350-c1244623e084ab230aba3ad8cefb238f98575805.tar.gz
scummvm-rg350-c1244623e084ab230aba3ad8cefb238f98575805.tar.bz2
scummvm-rg350-c1244623e084ab230aba3ad8cefb238f98575805.zip
SHERLOCK: More rename of synchronize methods to load
-rw-r--r--engines/sherlock/scene.cpp38
-rw-r--r--engines/sherlock/scene.h10
2 files changed, 33 insertions, 15 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);
diff --git a/engines/sherlock/scene.h b/engines/sherlock/scene.h
index 96714c4a3a..665f5d28e4 100644
--- a/engines/sherlock/scene.h
+++ b/engines/sherlock/scene.h
@@ -46,7 +46,7 @@ struct BgFileHeader {
int _seqSize;
int _fill;
- void synchronize(Common::SeekableReadStream &s);
+ void load(Common::SeekableReadStream &s);
};
struct BgfileheaderInfo {
@@ -54,7 +54,7 @@ struct BgfileheaderInfo {
int _maxFrames; // How many unique frames in object
Common::String _filename; // Filename of object
- void synchronize(Common::SeekableReadStream &s);
+ void load(Common::SeekableReadStream &s);
};
struct Exit {
@@ -65,7 +65,7 @@ struct Exit {
Common::Point _people;
int _peopleDir;
- void synchronize(Common::SeekableReadStream &s);
+ void load(Common::SeekableReadStream &s);
};
struct SceneEntry {
@@ -73,14 +73,14 @@ struct SceneEntry {
int _startDir;
int _allow;
- void synchronize(Common::SeekableReadStream &s);
+ void load(Common::SeekableReadStream &s);
};
struct SceneSound {
Common::String _name;
int _priority;
- void synchronize(Common::SeekableReadStream &s);
+ void load(Common::SeekableReadStream &s);
};
class ObjectArray: public Common::Array<Object> {