[Scummvm-cvs-logs] scummvm master -> 99ee0ecc4a9f921c6afcf26fa7424a9f9dc656d0

bluegr bluegr at gmail.com
Sun Jun 7 09:18:56 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:
99ee0ecc4a SHERLOCK: Add initial handling of journal talk and location data for RT


Commit: 99ee0ecc4a9f921c6afcf26fa7424a9f9dc656d0
    https://github.com/scummvm/scummvm/commit/99ee0ecc4a9f921c6afcf26fa7424a9f9dc656d0
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2015-06-07T10:14:14+03:00

Commit Message:
SHERLOCK: Add initial handling of journal talk and location data for RT

Changed paths:
    engines/sherlock/journal.cpp



diff --git a/engines/sherlock/journal.cpp b/engines/sherlock/journal.cpp
index cc0b57c..ef0e4b7 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) {






More information about the Scummvm-git-logs mailing list