[Scummvm-cvs-logs] SF.net SVN: scummvm:[50280] scummvm/trunk/engines/mohawk

mthreepwood at users.sourceforge.net mthreepwood at users.sourceforge.net
Fri Jun 25 20:20:31 CEST 2010


Revision: 50280
          http://scummvm.svn.sourceforge.net/scummvm/?rev=50280&view=rev
Author:   mthreepwood
Date:     2010-06-25 18:20:31 +0000 (Fri, 25 Jun 2010)

Log Message:
-----------
Add support for the third inventory case in Riven: you have the two journals but not the trap book (happens at the end of the game).

Modified Paths:
--------------
    scummvm/trunk/engines/mohawk/graphics.cpp
    scummvm/trunk/engines/mohawk/riven.cpp
    scummvm/trunk/engines/mohawk/riven.h

Modified: scummvm/trunk/engines/mohawk/graphics.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/graphics.cpp	2010-06-25 17:59:49 UTC (rev 50279)
+++ scummvm/trunk/engines/mohawk/graphics.cpp	2010-06-25 18:20:31 UTC (rev 50280)
@@ -607,19 +607,23 @@
 	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();

Modified: scummvm/trunk/engines/mohawk/riven.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/riven.cpp	2010-06-25 17:59:49 UTC (rev 50279)
+++ scummvm/trunk/engines/mohawk/riven.cpp	2010-06-25 18:20:31 UTC (rev 50280)
@@ -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 @@
 	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 @@
 	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 @@
 	*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);

Modified: scummvm/trunk/engines/mohawk/riven.h
===================================================================
--- scummvm/trunk/engines/mohawk/riven.h	2010-06-25 17:59:49 UTC (rev 50279)
+++ scummvm/trunk/engines/mohawk/riven.h	2010-06-25 18:20:31 UTC (rev 50280)
@@ -68,10 +68,12 @@
 
 // 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;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list