Skip to content

Commit

Permalink
SHERLOCK: 3DO: room loading: load exits
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Kiewitz committed Jun 13, 2015
1 parent 276a96f commit 17a0239
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
25 changes: 22 additions & 3 deletions engines/sherlock/scene.cpp
Expand Up @@ -122,6 +122,23 @@ void Exit::load(Common::SeekableReadStream &s, bool isRoseTattoo) {
_allow = s.readSint16LE();
}

void Exit::load3DO(Common::SeekableReadStream &s) {
left = s.readSint16BE();
top = s.readSint16BE();
setWidth(s.readUint16BE());
setHeight(s.readUint16BE());

_image = 0;
_scene = s.readSint16BE();

_allow = s.readSint16BE();

_newPosition.x = s.readSint16BE();
_newPosition.y = s.readSint16BE();
_newFacing = s.readUint16BE();
s.skip(2); // Filler
}

/*----------------------------------------------------------------*/

void SceneEntry::load(Common::SeekableReadStream &s) {
Expand Down Expand Up @@ -768,11 +785,13 @@ bool Scene::loadScene(const Common::String &filename) {
roomStream->read(&_walkData[0], header3DO_walkData_size);

// === EXITS === Read in the exits
int exitsCount = header3DO_exits_size / 20;

_exitZone = -1;
_exits.resize(header3DO_exits_size); // TODO!!!!
_exits.resize(exitsCount);

//for (int idx = 0; idx < numExits; ++idx)
// _exits[idx].load(*rrmStream, IS_ROSE_TATTOO);
for (int idx = 0; idx < exitsCount; ++idx)
_exits[idx].load3DO(*roomStream);

// === ENTRANCE === Read in the entrance
roomStream->seek(header3DO_entranceData_offset);
Expand Down
1 change: 1 addition & 0 deletions engines/sherlock/scene.h
Expand Up @@ -89,6 +89,7 @@ class Exit: public Common::Rect {
* Load the data for the object
*/
void load(Common::SeekableReadStream &s, bool isRoseTattoo);
void load3DO(Common::SeekableReadStream &s);
};

struct SceneEntry {
Expand Down

0 comments on commit 17a0239

Please sign in to comment.