[Scummvm-cvs-logs] scummvm master -> bcfe38c24f032715e732422069f25ae5ef1f2a81

dreammaster dreammaster at scummvm.org
Mon Jul 27 03:52:20 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:
bcfe38c24f SHERLOCK: RT: Move Journal record method back to Journal class


Commit: bcfe38c24f032715e732422069f25ae5ef1f2a81
    https://github.com/scummvm/scummvm/commit/bcfe38c24f032715e732422069f25ae5ef1f2a81
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-07-26T21:51:18-04:00

Commit Message:
SHERLOCK: RT: Move Journal record method back to Journal class

Changed paths:
    engines/sherlock/journal.cpp
    engines/sherlock/journal.h
    engines/sherlock/scalpel/scalpel_journal.cpp
    engines/sherlock/scalpel/scalpel_journal.h
    engines/sherlock/tattoo/widget_files.cpp



diff --git a/engines/sherlock/journal.cpp b/engines/sherlock/journal.cpp
index 9441d66..44b2406 100644
--- a/engines/sherlock/journal.cpp
+++ b/engines/sherlock/journal.cpp
@@ -683,6 +683,37 @@ void Journal::loadJournalFile(bool alreadyLoaded) {
 	}
 }
 
+void Journal::record(int converseNum, int statementNum, bool replyOnly) {
+	int saveIndex = _index;
+	int saveSub = _sub;
+
+	if (IS_3DO) {
+		// 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;
+
+	// Load the text for the new entry to get the number of lines it will have
+	loadJournalFile(true);
+
+	// Restore old state
+	_index = saveIndex;
+	_sub = saveSub;
+
+	// If new lines were added to the ournal, update the total number of lines
+	// the journal continues
+	if (!_lines.empty()) {
+		_maxPage += _lines.size();
+	} else {
+		// No lines in entry, so remove the new entry from the journal
+		_journal.remove_at(_journal.size() - 1);
+	}
+}
+
+
 void Journal::synchronize(Serializer &s) {
 	s.syncAsSint16LE(_index);
 	s.syncAsSint16LE(_sub);
diff --git a/engines/sherlock/journal.h b/engines/sherlock/journal.h
index d2baae1..ac23fc5 100644
--- a/engines/sherlock/journal.h
+++ b/engines/sherlock/journal.h
@@ -79,6 +79,12 @@ public:
 	bool drawJournal(int direction, int howFar);
 
 	/**
+	 * Records statements that are said, in the order which they are said. The player
+	 * can then read the journal to review them
+	 */
+	void record(int converseNum, int statementNum, bool replyOnly = false);
+
+	/**
 	 * Synchronize the data for a savegame
 	 */
 	void synchronize(Serializer &s);
@@ -89,12 +95,6 @@ public:
 	virtual void drawFrame() = 0;
 
 	/**
-	 * Records statements that are said, in the order which they are said. The player
-	 * can then read the journal to review them
-	 */
-	virtual void record(int converseNum, int statementNum, bool replyOnly = false) {}
-
-	/**
 	 * Reset viewing position to the start of the journal
 	 */
 	virtual void resetPosition() {}
diff --git a/engines/sherlock/scalpel/scalpel_journal.cpp b/engines/sherlock/scalpel/scalpel_journal.cpp
index 8e356c0..e54f1bc 100644
--- a/engines/sherlock/scalpel/scalpel_journal.cpp
+++ b/engines/sherlock/scalpel/scalpel_journal.cpp
@@ -60,49 +60,12 @@ static const int SEARCH_POINTS[3][3] = {
 /*----------------------------------------------------------------*/
 
 ScalpelJournal::ScalpelJournal(SherlockEngine *vm) : Journal(vm) {
-	// Initialize fields
-	_maxPage = 0;
-	_index = 0;
-	_sub = 0;
-	_up = _down = false;
-	_page = 1;
-
 	if (_vm->_interactiveFl) {
 		// Load the journal directory and location names
 		loadLocations();
 	}
 }
 
-void ScalpelJournal::record(int converseNum, int statementNum, bool replyOnly) {
-	int saveIndex = _index;
-	int saveSub = _sub;
-
-	if (IS_3DO) {
-		// 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;
-
-	// Load the text for the new entry to get the number of lines it will have
-	loadJournalFile(true);
-
-	// Restore old state
-	_index = saveIndex;
-	_sub = saveSub;
-
-	// If new lines were added to the ournal, update the total number of lines
-	// the journal continues
-	if (!_lines.empty()) {
-		_maxPage += _lines.size();
-	} else {
-		// No lines in entry, so remove the new entry from the journal
-		_journal.remove_at(_journal.size() - 1);
-	}
-}
-
 void ScalpelJournal::loadLocations() {
 	Resources &res = *_vm->_res;
 
diff --git a/engines/sherlock/scalpel/scalpel_journal.h b/engines/sherlock/scalpel/scalpel_journal.h
index 6bc0aa0..0cfed0d 100644
--- a/engines/sherlock/scalpel/scalpel_journal.h
+++ b/engines/sherlock/scalpel/scalpel_journal.h
@@ -84,12 +84,6 @@ public:
 	virtual void drawFrame();
 
 	/**
-	 * Records statements that are said, in the order which they are said. The player
-	 * can then read the journal to review them
-	 */
-	virtual void record(int converseNum, int statementNum, bool replyOnly = false);
-
-	/**
 	 * Reset viewing position to the start of the journal
 	 */
 	virtual void resetPosition();
diff --git a/engines/sherlock/tattoo/widget_files.cpp b/engines/sherlock/tattoo/widget_files.cpp
index 1743bcd..c6edfa3 100644
--- a/engines/sherlock/tattoo/widget_files.cpp
+++ b/engines/sherlock/tattoo/widget_files.cpp
@@ -167,7 +167,6 @@ void WidgetFiles::render(FilesRenderMode mode) {
 
 void WidgetFiles::handleEvents() {
 	Events &events = *_vm->_events;
-	TattooScene &scene = *(TattooScene *)_vm->_scene;
 	TattooUserInterface &ui = *(TattooUserInterface *)_vm->_ui;
 	Common::Point mousePos = events.mousePos();
 	Common::KeyState keyState = ui._keyState;






More information about the Scummvm-git-logs mailing list