diff options
author | Paul Gilbert | 2015-04-05 21:35:22 -0500 |
---|---|---|
committer | Paul Gilbert | 2015-04-05 21:35:22 -0500 |
commit | 900471834987c32b23b3162e2d2f40bbcc2b593d (patch) | |
tree | 74bb6a45e1c85ac99193f0fe642abdf94fd07e3a | |
parent | d17dea4afd76cba7280e3ffafd1e78a09430e983 (diff) | |
download | scummvm-rg350-900471834987c32b23b3162e2d2f40bbcc2b593d.tar.gz scummvm-rg350-900471834987c32b23b3162e2d2f40bbcc2b593d.tar.bz2 scummvm-rg350-900471834987c32b23b3162e2d2f40bbcc2b593d.zip |
SHERLOCK: Fix display of journal
-rw-r--r-- | engines/sherlock/journal.cpp | 12 | ||||
-rw-r--r-- | engines/sherlock/screen.cpp | 13 |
2 files changed, 15 insertions, 10 deletions
diff --git a/engines/sherlock/journal.cpp b/engines/sherlock/journal.cpp index 2811c463a2..f9c2c54289 100644 --- a/engines/sherlock/journal.cpp +++ b/engines/sherlock/journal.cpp @@ -56,7 +56,7 @@ Journal::Journal(SherlockEngine *vm): _vm(vm) { _index = 0; _sub = 0; _up = _down = false; - _page = 0; + _page = 1; _converseNum = -1; // Load the journal directory and location names @@ -140,7 +140,6 @@ int Journal::loadJournalFile(bool alreadyLoaded) { Screen &screen = *_vm->_screen; Talk &talk = *_vm->_talk; JournalEntry &journalEntry = _journal[_index]; - Statement &statement = talk[journalEntry._statementNum]; Common::String dirFilename = _directory[journalEntry._converseNum]; bool replyOnly = journalEntry._replyOnly; @@ -184,6 +183,7 @@ int Journal::loadJournalFile(bool alreadyLoaded) { } // Start building journal string + Statement &statement = talk[journalEntry._statementNum]; Common::String journalString; if (newLocation != oldLocation) { @@ -260,7 +260,7 @@ int Journal::loadJournalFile(bool alreadyLoaded) { // If a reply isn't just being started, and we didn't just end // a comment (which would have added a line), add a carriage return if (!startOfReply && ((!commentJustPrinted && c == '{') || c == '}')) - journalString += '"'; + journalString += '\n'; startOfReply = false; // Handle setting or clearing comment state @@ -434,7 +434,7 @@ int Journal::loadJournalFile(bool alreadyLoaded) { } // Add in the line - _lines.push_back(Common::String(startP, endP)); + _lines.push_back(Common::String(journalString.c_str(), endP)); // Strip line off from string being processed journalString = *endP ? Common::String(endP + 1) : ""; @@ -461,6 +461,10 @@ void Journal::drawInterface() { bg->read(palette, PALETTE_SIZE); delete bg; + // Translate the palette for display + for (int idx = 0; idx < PALETTE_SIZE; ++idx) + palette[idx] = VGA_COLOR_TRANS(palette[idx]); + // Set the palette and print the title screen.setPalette(palette); screen.gPrint(Common::Point(111, 18), BUTTON_BOTTOM, "Watson's Journal"); diff --git a/engines/sherlock/screen.cpp b/engines/sherlock/screen.cpp index 0eeddf2a5f..a30108118c 100644 --- a/engines/sherlock/screen.cpp +++ b/engines/sherlock/screen.cpp @@ -440,15 +440,16 @@ void Screen::buttonPrint(const Common::Point &pt, byte color, bool slamIt, if (slamIt) { print(Common::Point(xStart, pt.y + 1), COMMAND_HIGHLIGHTED, "%c", str[0]); print(Common::Point(xStart + charWidth(str[0]), pt.y + 1), - color, "%s", str.c_str() + 1); + COMMAND_FOREGROUND, str.c_str() + 1); } else { - print(Common::Point(xStart, pt.y), COMMAND_HIGHLIGHTED, "%c", str[0]); - print(Common::Point(xStart + charWidth(str[0]), pt.y), - color, "%s", str.c_str() + 1); + gPrint(Common::Point(xStart, pt.y), COMMAND_HIGHLIGHTED, "%c", str[0]); + gPrint(Common::Point(xStart + charWidth(str[0]), pt.y), + COMMAND_FOREGROUND, str.c_str() + 1); } + } else if (slamIt) { + print(Common::Point(xStart, pt.y + 1), color, str.c_str()); } else { - print(Common::Point(xStart, slamIt ? pt.y + 1 : pt.y), COMMAND_HIGHLIGHTED, - "%s", str.c_str()); + gPrint(Common::Point(xStart, pt.y), color, str.c_str()); } } |