Skip to content

Commit

Permalink
SHERLOCK: 3DO: fix library loading on 3DO
Browse files Browse the repository at this point in the history
also disable journal recording for 3DO
  • Loading branch information
Martin Kiewitz committed Jun 12, 2015
1 parent b6fe6ef commit 174aa23
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
5 changes: 5 additions & 0 deletions engines/sherlock/journal.cpp
Expand Up @@ -71,6 +71,11 @@ void Journal::record(int converseNum, int statementNum, bool replyOnly) {
int saveIndex = _index;
int saveSub = _sub;

if (_vm->getPlatform() == Common::kPlatform3DO) {
// there seems to be no journal in the 3DO version
return;
}

// Record the entry into the list
_journal.push_back(JournalEntry(converseNum, statementNum, replyOnly));
_index = _journal.size() - 1;
Expand Down
17 changes: 12 additions & 5 deletions engines/sherlock/resources.cpp
Expand Up @@ -229,6 +229,7 @@ void Resources::loadLibraryIndex(const Common::String &libFilename,
int count = 0;

if (_vm->getPlatform() != Common::kPlatform3DO) {
// PC
count = stream->readUint16LE();

if (isNewStyle)
Expand Down Expand Up @@ -258,30 +259,36 @@ void Resources::loadLibraryIndex(const Common::String &libFilename,
}

} else {
// 3DO
count = stream->readUint16BE();

// 3DO header
// Loop through reading in the entries

// Read offset of first entry
offset = stream->readUint32BE();

for (int idx = 0; idx < count; ++idx) {
// Read the offset
offset = stream->readUint32BE();

// Read the name of the resource
char resName[13];
stream->read(resName, 13);
resName[12] = '\0';

stream->skip(3); // filler

if (idx == (count - 1)) {
nextOffset = stream->size();
} else {
// Read the size by jumping forward to read the next entry's offset
stream->seek(13, SEEK_CUR);
// Read the offset of the next entry
nextOffset = stream->readUint32BE();
stream->seek(-17, SEEK_CUR);
}

// Add the entry to the index
index[resName] = LibraryEntry(idx, offset, nextOffset - offset);

// use next offset as current offset
offset = nextOffset;
}
}
}
Expand Down

0 comments on commit 174aa23

Please sign in to comment.