aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2015-04-02 18:30:16 -0400
committerPaul Gilbert2015-04-02 18:30:16 -0400
commit9c24ae75909088742aae7b303f80de43cb31a7a6 (patch)
tree12c4194908d06b6d4ff7e5de7bf2866cd86ba73c /engines
parent8ee021434236b454faf52995fb102322f2e7bd8f (diff)
downloadscummvm-rg350-9c24ae75909088742aae7b303f80de43cb31a7a6.tar.gz
scummvm-rg350-9c24ae75909088742aae7b303f80de43cb31a7a6.tar.bz2
scummvm-rg350-9c24ae75909088742aae7b303f80de43cb31a7a6.zip
SHERLOCK: Implemented Journal::drawInterface
Diffstat (limited to 'engines')
-rw-r--r--engines/sherlock/journal.cpp81
-rw-r--r--engines/sherlock/journal.h6
-rw-r--r--engines/sherlock/user_interface.cpp4
3 files changed, 91 insertions, 0 deletions
diff --git a/engines/sherlock/journal.cpp b/engines/sherlock/journal.cpp
index 04165cd827..94c6cf69e7 100644
--- a/engines/sherlock/journal.cpp
+++ b/engines/sherlock/journal.cpp
@@ -25,6 +25,23 @@
namespace Sherlock {
+#define JOURNAL_BUTTONS_Y 178
+
+// Positioning of buttons in the journal view
+const int JOURNAL_POINTS[9][3] = {
+ { 6, 68, 37 },
+ { 69, 131, 100 },
+ { 132, 192, 162 },
+ { 193, 250, 221 },
+ { 251, 313, 281 },
+ { 6, 82, 44 },
+ { 83, 159, 121 },
+ { 160, 236, 198 },
+ { 237, 313, 275 }
+};
+
+/*----------------------------------------------------------------*/
+
Journal::Journal(SherlockEngine *vm): _vm(vm) {
// Allow up to 1000 statements
_journal.resize(1000);
@@ -430,5 +447,69 @@ bool Journal::loadJournalFile(bool alreadyLoaded) {
return _lines.size();
}
+void Journal::drawInterface() {
+ Resources &res = *_vm->_res;
+ Screen &screen = *_vm->_screen;
+ byte palette[PALETTE_SIZE];
+
+ // Load in the journal background
+ Common::SeekableReadStream *bg = res.load("journal.lbv");
+ bg->read(screen._backBuffer1.getPixels(), SHERLOCK_SCREEN_WIDTH * SHERLOCK_SCREEN_HEIGHT);
+ bg->read(palette, PALETTE_SIZE);
+ delete bg;
+
+ // Set the palette and print the title
+ screen.setPalette(palette);
+ screen.gPrint(Common::Point(111, 18), BUTTON_BOTTOM, "Watson's Journal");
+ screen.gPrint(Common::Point(110, 17), INV_FOREGROUND, "Watson's Journal");
+
+ // Draw the buttons
+ screen.makeButton(Common::Rect(JOURNAL_POINTS[0][0], JOURNAL_BUTTONS_Y,
+ JOURNAL_POINTS[0][1], JOURNAL_BUTTONS_Y + 10),
+ JOURNAL_POINTS[0][2] - screen.stringWidth("Exit") / 2, "Exit");
+ screen.makeButton(Common::Rect(JOURNAL_POINTS[1][0], JOURNAL_BUTTONS_Y,
+ JOURNAL_POINTS[1][1], JOURNAL_BUTTONS_Y + 10),
+ JOURNAL_POINTS[1][2] - screen.stringWidth("Back 10") / 2, "Back 10");
+ screen.makeButton(Common::Rect(JOURNAL_POINTS[2][0], JOURNAL_BUTTONS_Y,
+ JOURNAL_POINTS[2][1], JOURNAL_BUTTONS_Y + 10),
+ JOURNAL_POINTS[2][2] - screen.stringWidth("Up") / 2, "Up");
+ screen.makeButton(Common::Rect(JOURNAL_POINTS[3][0], JOURNAL_BUTTONS_Y,
+ JOURNAL_POINTS[3][1], JOURNAL_BUTTONS_Y + 10),
+ JOURNAL_POINTS[3][2] - screen.stringWidth("Down") / 2, "Down");
+ screen.makeButton(Common::Rect(JOURNAL_POINTS[4][0], JOURNAL_BUTTONS_Y,
+ JOURNAL_POINTS[4][1], JOURNAL_BUTTONS_Y + 10),
+ JOURNAL_POINTS[4][2] - screen.stringWidth("Ahead 10") / 2, "Ahead 10");
+ screen.makeButton(Common::Rect(JOURNAL_POINTS[5][0], JOURNAL_BUTTONS_Y + 11,
+ JOURNAL_POINTS[5][1], JOURNAL_BUTTONS_Y + 21),
+ JOURNAL_POINTS[5][2] - screen.stringWidth("Search") / 2, "Search");
+ screen.makeButton(Common::Rect(JOURNAL_POINTS[6][0], JOURNAL_BUTTONS_Y + 11,
+ JOURNAL_POINTS[6][1], JOURNAL_BUTTONS_Y + 21),
+ JOURNAL_POINTS[6][2] - screen.stringWidth("First Page") / 2, "First Page");
+ screen.makeButton(Common::Rect(JOURNAL_POINTS[7][0], JOURNAL_BUTTONS_Y + 11,
+ JOURNAL_POINTS[7][1], JOURNAL_BUTTONS_Y + 21),
+ JOURNAL_POINTS[7][2] - screen.stringWidth("Last Page") / 2, "Last Page");
+ screen.makeButton(Common::Rect(JOURNAL_POINTS[8][0], JOURNAL_BUTTONS_Y + 11,
+ JOURNAL_POINTS[8][1], JOURNAL_BUTTONS_Y + 21),
+ JOURNAL_POINTS[8][2] - screen.stringWidth("Print Text") / 2, "Print Text");
+
+ if (_journal.size() == 0) {
+ _up = _down = 0;
+ } else {
+ doJournal(0, 0);
+ }
+
+ doArrows();
+
+ // Show the entire screen
+ screen.slamArea(0, 0, SHERLOCK_SCREEN_WIDTH, SHERLOCK_SCREEN_HEIGHT);
+}
+
+void Journal::doArrows() {
+ // TODO
+}
+
+void Journal::doJournal(int direction, int howFar) {
+ // TODO
+}
} // End of namespace Sherlock
diff --git a/engines/sherlock/journal.h b/engines/sherlock/journal.h
index 4add81d508..34d99af0ec 100644
--- a/engines/sherlock/journal.h
+++ b/engines/sherlock/journal.h
@@ -60,11 +60,17 @@ private:
void loadJournalLocations();
bool loadJournalFile(bool alreadyLoaded);
+
+ void doArrows();
+
+ void doJournal(int direction, int howFar);
public:
public:
Journal(SherlockEngine *vm);
void record(int converseNum, int statementNum);
+
+ void drawInterface();
};
} // End of namespace Sherlock
diff --git a/engines/sherlock/user_interface.cpp b/engines/sherlock/user_interface.cpp
index 6f60049e31..01b08ffd71 100644
--- a/engines/sherlock/user_interface.cpp
+++ b/engines/sherlock/user_interface.cpp
@@ -1127,6 +1127,10 @@ void UserInterface::doTalkControl() {
}
void UserInterface::journalControl() {
+ Journal &journal = *_vm->_journal;
+
+ journal.drawInterface();
+
// TODO
}