aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock
diff options
context:
space:
mode:
authorFilippos Karapetis2015-06-07 10:14:14 +0300
committerFilippos Karapetis2015-06-07 10:14:14 +0300
commit99ee0ecc4a9f921c6afcf26fa7424a9f9dc656d0 (patch)
treeeb038b0e845f8bf869be4525ed10ea7982a67dbc /engines/sherlock
parent261e418b5ff1067d79d2cf78d1524a0ab56444dd (diff)
downloadscummvm-rg350-99ee0ecc4a9f921c6afcf26fa7424a9f9dc656d0.tar.gz
scummvm-rg350-99ee0ecc4a9f921c6afcf26fa7424a9f9dc656d0.tar.bz2
scummvm-rg350-99ee0ecc4a9f921c6afcf26fa7424a9f9dc656d0.zip
SHERLOCK: Add initial handling of journal talk and location data for RT
Diffstat (limited to 'engines/sherlock')
-rw-r--r--engines/sherlock/journal.cpp48
1 files changed, 44 insertions, 4 deletions
diff --git a/engines/sherlock/journal.cpp b/engines/sherlock/journal.cpp
index cc0b57cbe2..ef0e4b7fb8 100644
--- a/engines/sherlock/journal.cpp
+++ b/engines/sherlock/journal.cpp
@@ -102,6 +102,8 @@ void Journal::loadJournalLocations() {
// Get the numer of entries
_directory.resize(dir->readUint16LE());
+ if (IS_ROSE_TATTOO)
+ dir->seek((_directory.size() + 1) * 8, SEEK_CUR);
// Read in each entry
char buffer[17];
@@ -115,12 +117,16 @@ void Journal::loadJournalLocations() {
delete dir;
_locations.clear();
- if (_vm->getPlatform() != Common::kPlatform3DO) {
+
+ if (_vm->getPlatform() == Common::kPlatform3DO) {
// 3DO: storage of locations is currently unknown TODO
+ return;
+ }
- // Load in the locations stored in journal.txt
- Common::SeekableReadStream *loc = res.load("journal.txt");
+ // Load in the locations stored in journal.txt
+ Common::SeekableReadStream *loc = res.load("journal.txt");
+ if (IS_SERRATED_SCALPEL) {
while (loc->pos() < loc->size()) {
Common::String line;
char c;
@@ -129,9 +135,43 @@ void Journal::loadJournalLocations() {
_locations.push_back(line);
}
+ } else {
+ // Initialize locations
+ _locations.resize(100);
+ for (int i = 0; i < 100; i++)
+ _locations[i] = "No Description";
+
+ while (loc->pos() < loc->size()) {
+ // In Rose Tattoo, each location line starts with the location
+ // number, followed by a dot, some spaces and its description
+ // in quotes
+ Common::String line = loc->readLine();
+ Common::String locNumStr;
+ int locNum = 0;
+ int i = 0;
+ Common::String locDesc;
+
+ // Get the location
+ while (Common::isDigit(line[i])) {
+ locNumStr += line[i];
+ i++;
+ }
+ locNum = atoi(locNumStr.c_str());
- delete loc;
+ // Skip the dot, spaces and initial quotation mark
+ while (line[i] == ' ' || line[i] == '.' || line[i] == '\"')
+ i++;
+
+ do {
+ locDesc += line[i];
+ i++;
+ } while (line[i] != '\"');
+
+ _locations[locNum] = locDesc;
+ }
}
+
+ delete loc;
}
void Journal::loadJournalFile(bool alreadyLoaded) {