[Scummvm-cvs-logs] scummvm master -> 3712c5245102f031f0fd140ae6ed60a92f9c8778

dreammaster dreammaster at scummvm.org
Mon Jul 27 04:48:41 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:
3712c52451 SHERLOCK: RT: Fix placement of journal text


Commit: 3712c5245102f031f0fd140ae6ed60a92f9c8778
    https://github.com/scummvm/scummvm/commit/3712c5245102f031f0fd140ae6ed60a92f9c8778
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-07-26T22:47:36-04:00

Commit Message:
SHERLOCK: RT: Fix placement of journal text

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



diff --git a/engines/sherlock/journal.cpp b/engines/sherlock/journal.cpp
index 44b2406..19fc4af 100644
--- a/engines/sherlock/journal.cpp
+++ b/engines/sherlock/journal.cpp
@@ -25,6 +25,7 @@
 #include "sherlock/scalpel/scalpel_fixed_text.h"
 #include "sherlock/scalpel/scalpel_journal.h"
 #include "sherlock/tattoo/tattoo.h"
+#include "sherlock/tattoo/tattoo_fixed_text.h"
 #include "sherlock/tattoo/tattoo_journal.h"
 
 namespace Sherlock {
@@ -39,7 +40,7 @@ Journal *Journal::init(SherlockEngine *vm) {
 Journal::Journal(SherlockEngine *vm) : _vm(vm) {
 	_up = _down = false;
 	_index = 0;
-	_page = 0;
+	_page = 1;
 	_maxPage = 0;
 	_sub = 0;
 }
@@ -49,7 +50,8 @@ bool Journal::drawJournal(int direction, int howFar) {
 	FixedText &fixedText = *_vm->_fixedText;
 	Screen &screen = *_vm->_screen;
 	Talk &talk = *_vm->_talk;
-	int yp = 37;
+	int topLineY = IS_SERRATED_SCALPEL ? 37 : 103 - screen.charHeight('A');
+	int yp = topLineY;
 	int startPage = _page;
 	bool endJournal = false;
 	bool firstOccurance = true;
@@ -85,7 +87,11 @@ bool Journal::drawJournal(int direction, int howFar) {
 		if (direction)
 			drawFrame();
 
-		screen.gPrint(Common::Point(235, 21), COL_PEN_COLOR, "Page %d", _page);
+		if (IS_SERRATED_SCALPEL)
+			screen.gPrint(Common::Point(235, 21), COL_PEN_COLOR, fixedText.getText(Scalpel::kFixedText_Journal_Page), _page);
+		else
+			screen.gPrint(Common::Point(530, 72), COL_PEN_COLOR, fixedText.getText(Tattoo::kFixedText_Page), _page);
+
 		return false;
 	}
 
@@ -203,9 +209,10 @@ bool Journal::drawJournal(int direction, int howFar) {
 		drawFrame();
 	}
 
-	Common::String fixedText_Page = IS_SERRATED_SCALPEL ? fixedText.getText(Scalpel::kFixedText_Journal_Page) : "TODO";
-
-	screen.gPrint(Common::Point(235, 21), COL_PEN_COLOR, fixedText_Page.c_str(), _page);
+	if (IS_SERRATED_SCALPEL)
+		screen.gPrint(Common::Point(235, 21), COL_PEN_COLOR, fixedText.getText(Scalpel::kFixedText_Journal_Page), _page);
+	else
+		screen.gPrint(Common::Point(530, 72), COL_PEN_COLOR, fixedText.getText(Tattoo::kFixedText_Page), _page);
 
 	temp = _sub;
 	savedIndex = _index;
@@ -216,7 +223,7 @@ bool Journal::drawJournal(int direction, int howFar) {
 
 		// If there wasn't any line to print at the top of the page, we won't need to
 		// increment the y position
-		if (_lines[temp].empty() && yp == 37)
+		if (_lines[temp].empty() && yp == topLineY)
 			inc = false;
 
 		// If there's a searched for keyword in the line, it will need to be highlighted
@@ -232,30 +239,30 @@ bool Journal::drawJournal(int direction, int howFar) {
 				Common::String lineStart(_lines[temp].c_str(), matchP);
 				if (lineStart.hasPrefix("@")) {
 					width = screen.stringWidth(lineStart.c_str() + 1);
-					screen.gPrint(Common::Point(53, yp), 15, "%s", lineStart.c_str() + 1);
+					screen.gPrint(Common::Point(JOURNAL_LEFT_X, yp), 15, "%s", lineStart.c_str() + 1);
 				} else {
 					width = screen.stringWidth(lineStart.c_str());
-					screen.gPrint(Common::Point(53, yp), COL_PEN_COLOR, "%s", lineStart.c_str());
+					screen.gPrint(Common::Point(JOURNAL_LEFT_X, yp), COL_PEN_COLOR, "%s", lineStart.c_str());
 				 }
 
 				// Print out the found keyword
 				Common::String lineMatch(matchP, matchP + _find.size());
 				byte fgColor = IS_SERRATED_SCALPEL ? (byte)Scalpel::INV_FOREGROUND : (byte)Tattoo::INV_FOREGROUND;
-				screen.gPrint(Common::Point(53 + width, yp), fgColor, "%s", lineMatch.c_str());
+				screen.gPrint(Common::Point(JOURNAL_LEFT_X + width, yp), fgColor, "%s", lineMatch.c_str());
 				width += screen.stringWidth(lineMatch.c_str());
 
 				// Print remainder of line
-				screen.gPrint(Common::Point(53 + width, yp), COL_PEN_COLOR, "%s", matchP + _find.size());
+				screen.gPrint(Common::Point(JOURNAL_LEFT_X + width, yp), COL_PEN_COLOR, "%s", matchP + _find.size());
 			} else if (_lines[temp].hasPrefix("@")) {
-				screen.gPrint(Common::Point(53, yp), 15, "%s", _lines[temp].c_str() + 1);
+				screen.gPrint(Common::Point(JOURNAL_LEFT_X, yp), 15, "%s", _lines[temp].c_str() + 1);
 			} else {
-				screen.gPrint(Common::Point(53, yp), COL_PEN_COLOR, "%s", _lines[temp].c_str());
+				screen.gPrint(Common::Point(JOURNAL_LEFT_X, yp), COL_PEN_COLOR, "%s", _lines[temp].c_str());
 			}
 		} else {
 			if (_lines[temp].hasPrefix("@")) {
-				screen.gPrint(Common::Point(53, yp), 15, "%s", _lines[temp].c_str() + 1);
+				screen.gPrint(Common::Point(JOURNAL_LEFT_X, yp), 15, "%s", _lines[temp].c_str() + 1);
 			} else {
-				screen.gPrint(Common::Point(53, yp), COL_PEN_COLOR, "%s", _lines[temp].c_str());
+				screen.gPrint(Common::Point(JOURNAL_LEFT_X, yp), COL_PEN_COLOR, "%s", _lines[temp].c_str());
 			}
 		}
 
diff --git a/engines/sherlock/journal.h b/engines/sherlock/journal.h
index ac23fc5..4d44b32 100644
--- a/engines/sherlock/journal.h
+++ b/engines/sherlock/journal.h
@@ -33,6 +33,9 @@
 namespace Sherlock {
 
 #define LINES_PER_PAGE (IS_SERRATED_SCALPEL ? 11 : 17)
+#define JOURNAL_MAX_WIDTH (IS_SERRATED_SCALPEL ? 230 : 422)
+#define JOURNAL_MAX_CHARS 80
+#define JOURNAL_LEFT_X (IS_SERRATED_SCALPEL ? 53 : 156)
 
 class SherlockEngine;
 
diff --git a/engines/sherlock/scalpel/scalpel_journal.h b/engines/sherlock/scalpel/scalpel_journal.h
index 0cfed0d..a154796 100644
--- a/engines/sherlock/scalpel/scalpel_journal.h
+++ b/engines/sherlock/scalpel/scalpel_journal.h
@@ -35,9 +35,6 @@ namespace Sherlock {
 
 namespace Scalpel {
 
-#define JOURNAL_MAX_WIDTH 230
-#define JOURNAL_MAX_CHARS 80
-
 enum JournalButton {
 	BTN_NONE, BTN_EXIT, BTN_BACK10, BTN_UP, BTN_DOWN, BTN_AHEAD110, BTN_SEARCH,
 	BTN_FIRST_PAGE, BTN_LAST_PAGE, BTN_PRINT_TEXT
diff --git a/engines/sherlock/tattoo/tattoo_fixed_text.cpp b/engines/sherlock/tattoo/tattoo_fixed_text.cpp
index 5d8df2f..c07a028 100644
--- a/engines/sherlock/tattoo/tattoo_fixed_text.cpp
+++ b/engines/sherlock/tattoo/tattoo_fixed_text.cpp
@@ -58,6 +58,7 @@ static const char *const FIXED_TEXT_ENGLISH[] = {
 	"No effect...",
 	"This person has nothing to say at the moment",
 
+	"Page %d",
 	"Close Journal", 
 	"Search Journal",
 	"Save Journal",
diff --git a/engines/sherlock/tattoo/tattoo_fixed_text.h b/engines/sherlock/tattoo/tattoo_fixed_text.h
index e07d63f..6a1c698 100644
--- a/engines/sherlock/tattoo/tattoo_fixed_text.h
+++ b/engines/sherlock/tattoo/tattoo_fixed_text.h
@@ -58,6 +58,7 @@ enum FixedTextId {
 	kFixedText_NoEffect,
 	kFixedText_NothingToSay,
 
+	kFixedText_Page,
 	kFixedText_CloseJournal,
 	kFixedText_SearchJournal,
 	kFixedText_SaveJournal,






More information about the Scummvm-git-logs mailing list