Skip to content

Commit

Permalink
AURORA: Load walkable rooms from Jade lyt files
Browse files Browse the repository at this point in the history
  • Loading branch information
farmboy0 committed Dec 22, 2017
1 parent 76ac4b4 commit b6a838f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/aurora/lytfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ void LYTFile::load(Common::SeekableReadStream &lyt) {
Common::parseString(strings[1], _rooms[i].x);
Common::parseString(strings[2], _rooms[i].y);
Common::parseString(strings[3], _rooms[i].z);
_rooms[i].canWalk = false;
}

} else if (strings[0] == "trackcount") {
Expand Down Expand Up @@ -138,15 +139,24 @@ void LYTFile::load(Common::SeekableReadStream &lyt) {
}

} else if (strings[0] == "walkmeshRooms") {
// TODO: Walkmesh rooms?
// Only relevant for Jade

assertTokenCount(strings, 2, "walkmeshRooms");

int walkmeshRoomCount;
Common::parseString(strings[1], walkmeshRoomCount);

for (int i = 0; i < walkmeshRoomCount; i++)
for (int i = 0; i < walkmeshRoomCount; i++) {
tokenizer.nextChunk(lyt);
tokenizer.getTokens(lyt, strings);

assertTokenCount(strings, 1, "walkmesh room");

for (size_t j = 0; j < _rooms.size(); j++) {
if (_rooms[j].model.equals(strings[0]))
_rooms[j].canWalk = true;
}
}

} else if (strings[0] == "doorhookcount") {
// Door hooks
Expand Down
1 change: 1 addition & 0 deletions src/aurora/lytfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class LYTFile {
struct Room {
Common::UString model;
float x, y, z;
bool canWalk;
};

/** A simple, non-interactive placeable. */
Expand Down

0 comments on commit b6a838f

Please sign in to comment.