diff options
Diffstat (limited to 'engines/mohawk')
-rw-r--r-- | engines/mohawk/graphics.cpp | 22 | ||||
-rw-r--r-- | engines/mohawk/riven.cpp | 51 | ||||
-rw-r--r-- | engines/mohawk/riven.h | 10 |
3 files changed, 53 insertions, 30 deletions
diff --git a/engines/mohawk/graphics.cpp b/engines/mohawk/graphics.cpp index 2ddfb47575..00de6dba11 100644 --- a/engines/mohawk/graphics.cpp +++ b/engines/mohawk/graphics.cpp @@ -607,19 +607,23 @@ void RivenGraphics::showInventory() { if (_vm->getFeatures() & GF_DEMO || _vm->getCurStack() == aspit) return; - // There are three books and three vars. However, there's only - // a possible two combinations. Either you have only Atrus' - // journal or you have all three books. - // bool hasAtrusBook = *_vm->matchVarToString("aatrusbook") != 0; + // There are three books and three vars. We have three different + // combinations. At the start you have just Atrus' journal. Later, + // you get Catherine's journal and the trap book. Near the end, + // you lose the trap book and have just the two journals. + bool hasCathBook = *_vm->matchVarToString("acathbook") != 0; - // bool hasTrapBook = *_vm->matchVarToString("atrapbook") != 0; + bool hasTrapBook = *_vm->matchVarToString("atrapbook") != 0; if (!hasCathBook) { - drawInventoryImage(101, g_atrusJournalRectSolo); + drawInventoryImage(101, g_atrusJournalRect1); + } else if (!hasTrapBook) { + drawInventoryImage(101, g_atrusJournalRect2); + drawInventoryImage(102, g_cathJournalRect2); } else { - drawInventoryImage(101, g_atrusJournalRect); - drawInventoryImage(102, g_cathJournalRect); - drawInventoryImage(100, g_trapBookRect); + drawInventoryImage(101, g_atrusJournalRect3); + drawInventoryImage(102, g_cathJournalRect3); + drawInventoryImage(100, g_trapBookRect3); } _vm->_system->updateScreen(); diff --git a/engines/mohawk/riven.cpp b/engines/mohawk/riven.cpp index fa7ffd7c45..1e7f006be1 100644 --- a/engines/mohawk/riven.cpp +++ b/engines/mohawk/riven.cpp @@ -37,10 +37,12 @@ namespace Mohawk { -Common::Rect *g_atrusJournalRectSolo; -Common::Rect *g_atrusJournalRect; -Common::Rect *g_cathJournalRect; -Common::Rect *g_trapBookRect; +Common::Rect *g_atrusJournalRect1; +Common::Rect *g_atrusJournalRect2; +Common::Rect *g_cathJournalRect2; +Common::Rect *g_atrusJournalRect3; +Common::Rect *g_cathJournalRect3; +Common::Rect *g_trapBookRect3; MohawkEngine_Riven::MohawkEngine_Riven(OSystem *syst, const MohawkGameDescription *gamedesc) : MohawkEngine(syst, gamedesc) { _showHotspots = false; @@ -58,10 +60,12 @@ MohawkEngine_Riven::MohawkEngine_Riven(OSystem *syst, const MohawkGameDescriptio SearchMan.addSubDirectoryMatching(gameDataDir, "exe"); SearchMan.addSubDirectoryMatching(gameDataDir, "assets1"); - g_atrusJournalRectSolo = new Common::Rect(295, 402, 313, 426); - g_atrusJournalRect = new Common::Rect(222, 402, 240, 426); - g_cathJournalRect = new Common::Rect(291, 408, 311, 419); - g_trapBookRect = new Common::Rect(363, 396, 386, 432); + g_atrusJournalRect1 = new Common::Rect(295, 402, 313, 426); + g_atrusJournalRect2 = new Common::Rect(259, 402, 278, 426); + g_cathJournalRect2 = new Common::Rect(328, 408, 348, 419); + g_atrusJournalRect3 = new Common::Rect(222, 402, 240, 426); + g_cathJournalRect3 = new Common::Rect(291, 408, 311, 419); + g_trapBookRect3 = new Common::Rect(363, 396, 386, 432); } MohawkEngine_Riven::~MohawkEngine_Riven() { @@ -74,10 +78,12 @@ MohawkEngine_Riven::~MohawkEngine_Riven() { delete _loadDialog; delete _optionsDialog; delete _rnd; - delete g_atrusJournalRectSolo; - delete g_atrusJournalRect; - delete g_cathJournalRect; - delete g_trapBookRect; + delete g_atrusJournalRect1; + delete g_atrusJournalRect2; + delete g_cathJournalRect2; + delete g_atrusJournalRect3; + delete g_cathJournalRect3; + delete g_trapBookRect3; _cardData.scripts.clear(); } @@ -479,26 +485,37 @@ void MohawkEngine_Riven::checkInventoryClick() { *matchVarToString("returncardid") = _curCard; // See RivenGraphics::showInventory() for an explanation - // of why only this variable is used. + // of the variables' meanings. bool hasCathBook = *matchVarToString("acathbook") != 0; + bool hasTrapBook = *matchVarToString("atrapbook") != 0; // Go to the book if a hotspot contains the mouse if (!hasCathBook) { - if (g_atrusJournalRectSolo->contains(_mousePos)) { + if (g_atrusJournalRect1->contains(_mousePos)) { _gfx->hideInventory(); changeToStack(aspit); changeToCard(5); } + } else if (!hasTrapBook) { + if (g_atrusJournalRect2->contains(_mousePos)) { + _gfx->hideInventory(); + changeToStack(aspit); + changeToCard(5); + } else if (g_cathJournalRect2->contains(_mousePos)) { + _gfx->hideInventory(); + changeToStack(aspit); + changeToCard(6); + } } else { - if (g_atrusJournalRect->contains(_mousePos)) { + if (g_atrusJournalRect3->contains(_mousePos)) { _gfx->hideInventory(); changeToStack(aspit); changeToCard(5); - } else if (g_cathJournalRect->contains(_mousePos)) { + } else if (g_cathJournalRect3->contains(_mousePos)) { _gfx->hideInventory(); changeToStack(aspit); changeToCard(6); - } else if (g_trapBookRect->contains(_mousePos)) { + } else if (g_trapBookRect3->contains(_mousePos)) { _gfx->hideInventory(); changeToStack(aspit); changeToCard(7); diff --git a/engines/mohawk/riven.h b/engines/mohawk/riven.h index 11c3a4c0cb..5fe0de00e9 100644 --- a/engines/mohawk/riven.h +++ b/engines/mohawk/riven.h @@ -68,10 +68,12 @@ enum { // Rects for the inventory object positions (initialized in // MohawkEngine_Riven's constructor). -extern Common::Rect *g_atrusJournalRectSolo; -extern Common::Rect *g_atrusJournalRect; -extern Common::Rect *g_cathJournalRect; -extern Common::Rect *g_trapBookRect; +extern Common::Rect *g_atrusJournalRect1; +extern Common::Rect *g_atrusJournalRect2; +extern Common::Rect *g_cathJournalRect2; +extern Common::Rect *g_atrusJournalRect3; +extern Common::Rect *g_cathJournalRect3; +extern Common::Rect *g_trapBookRect3; struct RivenHotspot { uint16 blstID; |