[Scummvm-cvs-logs] scummvm master -> 174aa230b682c466018aadd2e69457a51cf0d2c5
m-kiewitz
m_kiewitz at users.sourceforge.net
Fri Jun 12 18:16:14 CEST 2015
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
174aa230b6 SHERLOCK: 3DO: fix library loading on 3DO
Commit: 174aa230b682c466018aadd2e69457a51cf0d2c5
https://github.com/scummvm/scummvm/commit/174aa230b682c466018aadd2e69457a51cf0d2c5
Author: Martin Kiewitz (m_kiewitz at users.sourceforge.net)
Date: 2015-06-12T18:14:36+02:00
Commit Message:
SHERLOCK: 3DO: fix library loading on 3DO
also disable journal recording for 3DO
Changed paths:
engines/sherlock/journal.cpp
engines/sherlock/resources.cpp
diff --git a/engines/sherlock/journal.cpp b/engines/sherlock/journal.cpp
index 19502b5..d4a74ff 100644
--- a/engines/sherlock/journal.cpp
+++ b/engines/sherlock/journal.cpp
@@ -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;
diff --git a/engines/sherlock/resources.cpp b/engines/sherlock/resources.cpp
index d171a57..71037fe 100644
--- a/engines/sherlock/resources.cpp
+++ b/engines/sherlock/resources.cpp
@@ -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)
@@ -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;
}
}
}
More information about the Scummvm-git-logs
mailing list