aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock
diff options
context:
space:
mode:
authorPaul Gilbert2015-07-26 22:47:36 -0400
committerPaul Gilbert2015-07-26 22:47:36 -0400
commit3712c5245102f031f0fd140ae6ed60a92f9c8778 (patch)
treed006839444850467c116315bdbd8c0323da40a6e /engines/sherlock
parentbcfe38c24f032715e732422069f25ae5ef1f2a81 (diff)
downloadscummvm-rg350-3712c5245102f031f0fd140ae6ed60a92f9c8778.tar.gz
scummvm-rg350-3712c5245102f031f0fd140ae6ed60a92f9c8778.tar.bz2
scummvm-rg350-3712c5245102f031f0fd140ae6ed60a92f9c8778.zip
SHERLOCK: RT: Fix placement of journal text
Diffstat (limited to 'engines/sherlock')
-rw-r--r--engines/sherlock/journal.cpp37
-rw-r--r--engines/sherlock/journal.h3
-rw-r--r--engines/sherlock/scalpel/scalpel_journal.h3
-rw-r--r--engines/sherlock/tattoo/tattoo_fixed_text.cpp1
-rw-r--r--engines/sherlock/tattoo/tattoo_fixed_text.h1
5 files changed, 27 insertions, 18 deletions
diff --git a/engines/sherlock/journal.cpp b/engines/sherlock/journal.cpp
index 44b24066d3..19fc4af8d6 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 ac23fc50f5..4d44b32ff3 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 0cfed0daa6..a154796df5 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 5d8df2f01b..c07a028b21 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 e07d63f214..6a1c69836c 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,