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

mthreepwood at users.sourceforge.net mthreepwood at users.sourceforge.net
Fri Sep 3 21:13:58 CEST 2010


Revision: 52509
          http://scummvm.svn.sourceforge.net/scummvm/?rev=52509&view=rev
Author:   mthreepwood
Date:     2010-09-03 19:13:58 +0000 (Fri, 03 Sep 2010)

Log Message:
-----------
MOHAWK: Improve support for the Riven Demo

- The exit button now appears and is functional
- The intro movies now play on start up
- Add shortcuts for returning to the menu/playing the intro videos again
- Make the text when hitting a boundary match the original
- Change the wording of the browser button message
- Note: The demo's extras.mhk (not the full game's!) is required now

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

Modified: scummvm/trunk/engines/mohawk/graphics.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/graphics.cpp	2010-09-03 18:14:59 UTC (rev 52508)
+++ scummvm/trunk/engines/mohawk/graphics.cpp	2010-09-03 19:13:58 UTC (rev 52509)
@@ -597,28 +597,35 @@
 	// Clear the inventory area
 	clearInventoryArea();
 
-	// The demo doesn't have the inventory system and we don't want
-	// to show the inventory on setup screens or in other journals.
-	if (_vm->getFeatures() & GF_DEMO || _vm->getCurStack() == aspit)
-		return;
+	// Draw the demo's exit button
+	if (_vm->getFeatures() & GF_DEMO) {
+		// extras.mhk tBMP 101 contains "EXIT" instead of Atrus' journal in the demo!
+		// The demo's extras.mhk contains all the other inventory/marble/credits image
+		// but has hacked tBMP 101 with "EXIT". *sigh*
+		drawInventoryImage(101, g_demoExitRect);
+	} else {
+		// We don't want to show the inventory on setup screens or in other journals.
+		if (_vm->getCurStack() == aspit)
+			return;
 
-	// 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.
+		// 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 hasCathBook = *_vm->matchVarToString("acathbook") != 0;
+		bool hasTrapBook = *_vm->matchVarToString("atrapbook") != 0;
 
-	if (!hasCathBook) {
-		drawInventoryImage(101, g_atrusJournalRect1);
-	} else if (!hasTrapBook) {
-		drawInventoryImage(101, g_atrusJournalRect2);
-		drawInventoryImage(102, g_cathJournalRect2);
-	} else {
-		drawInventoryImage(101, g_atrusJournalRect3);
-		drawInventoryImage(102, g_cathJournalRect3);
-		drawInventoryImage(100, g_trapBookRect3);
+		if (!hasCathBook) {
+			drawInventoryImage(101, g_atrusJournalRect1);
+		} else if (!hasTrapBook) {
+			drawInventoryImage(101, g_atrusJournalRect2);
+			drawInventoryImage(102, g_cathJournalRect2);
+		} else {
+			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-09-03 18:14:59 UTC (rev 52508)
+++ scummvm/trunk/engines/mohawk/riven.cpp	2010-09-03 19:13:58 UTC (rev 52509)
@@ -44,6 +44,7 @@
 Common::Rect *g_atrusJournalRect3;
 Common::Rect *g_cathJournalRect3;
 Common::Rect *g_trapBookRect3;
+Common::Rect *g_demoExitRect;
 
 MohawkEngine_Riven::MohawkEngine_Riven(OSystem *syst, const MohawkGameDescription *gamedesc) : MohawkEngine(syst, gamedesc) {
 	_showHotspots = false;
@@ -73,6 +74,7 @@
 	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);
+	g_demoExitRect = new Common::Rect(291, 408, 317, 419);
 }
 
 MohawkEngine_Riven::~MohawkEngine_Riven() {
@@ -92,6 +94,7 @@
 	delete g_atrusJournalRect3;
 	delete g_cathJournalRect3;
 	delete g_trapBookRect3;
+	delete g_demoExitRect;
 }
 
 GUI::Debugger *MohawkEngine_Riven::getDebugger() {
@@ -114,29 +117,33 @@
 
 	initVars();
 
-	// Open extras.mhk for common images (non-existant in the demo)
-	if (!(getFeatures() & GF_DEMO)) {
-		_extrasFile = new MohawkArchive();
-		_extrasFile->open("extras.mhk");
-	}
+	// Open extras.mhk for common images
+	_extrasFile = new MohawkArchive();
+	_extrasFile->open("extras.mhk");
 
 	// Start at main cursor
 	_gfx->changeCursor(kRivenMainCursor);
 
-	// Load game from launcher/command line if requested
-	if (ConfMan.hasKey("save_slot") && !(getFeatures() & GF_DEMO)) {
+	// Let's begin, shall we?
+	if (getFeatures() & GF_DEMO) {
+		// Start the demo off with the videos
+		changeToStack(aspit);
+		changeToCard(6);
+	} else if (ConfMan.hasKey("save_slot")) {
+		// Load game from launcher/command line if requested
 		uint32 gameToLoad = ConfMan.getInt("save_slot");
 		Common::StringArray savedGamesList = _saveLoad->generateSaveGameList();
 		if (gameToLoad > savedGamesList.size())
 			error ("Could not find saved game");
 		_saveLoad->loadGame(savedGamesList[gameToLoad]);
-	} else { // Otherwise, start us off at aspit's card 1
+	} else {
+		// Otherwise, start us off at aspit's card 1 (the main menu)
         changeToStack(aspit);
 		changeToCard(1);
 	}
 
 	Common::Event event;
-	while (!_gameOver) {
+	while (!_gameOver && !shouldQuit()) {
 		bool needsUpdate = _gfx->runScheduledWaterEffects();
 		needsUpdate |= _video->updateBackgroundMovies();
 
@@ -145,11 +152,13 @@
 			case Common::EVENT_MOUSEMOVE:
 				checkHotspotChange();
 
-				// Check to show the inventory
-				if (_eventMan->getMousePos().y >= 392)
-					_gfx->showInventory();
-				else
-					_gfx->hideInventory();
+				if (!(getFeatures() & GF_DEMO)) {
+					// Check to show the inventory, but it is always "showing" in the demo
+					if (_eventMan->getMousePos().y >= 392)
+						_gfx->showInventory();
+					else
+						_gfx->hideInventory();
+				}
 
 				needsUpdate = true;
 				break;
@@ -192,13 +201,22 @@
 					runDialog(*_optionsDialog);
 					updateZipMode();
 					break;
-				case Common::KEYCODE_ESCAPE:
-					if (getFeatures() & GF_DEMO) {
+				case Common::KEYCODE_r:
+					// Return to the main menu in the demo on ctrl+r
+					if (event.kbd.flags & Common::KBD_CTRL && getFeatures() & GF_DEMO) {
 						if (_curStack != aspit)
 							changeToStack(aspit);
 						changeToCard(1);
 					}
 					break;
+				case Common::KEYCODE_p:
+					// Play the intro videos in the demo on ctrl+p
+					if (event.kbd.flags & Common::KBD_CTRL && getFeatures() & GF_DEMO) {
+						if (_curStack != aspit)
+							changeToStack(aspit);
+						changeToCard(6);
+					}
+					break;
 				default:
 					break;
 				}
@@ -211,17 +229,6 @@
 		if (_curHotspot >= 0)
 			runHotspotScript(_curHotspot, kMouseInsideScript);
 
-		if (shouldQuit()) {
-			if (_eventMan->shouldRTL() && (getFeatures() & GF_DEMO) && !(_curStack == aspit && _curCard == 12)) {
-				if (_curStack != aspit)
-					changeToStack(aspit);
-				changeToCard(12);
-				_eventMan->resetRTL();
-				continue;
-			}
-			return Common::kNoError;
-		}
-
 		// Update the screen if we need to
 		if (needsUpdate)
 			_system->updateScreen();
@@ -471,10 +478,29 @@
 	if (mousePos.y < 392)
 		return;
 
-	// No inventory in the demo or opening screens.
-	if (getFeatures() & GF_DEMO || _curStack == aspit)
+	// In the demo, check if we've clicked the exit button
+	if (getFeatures() & GF_DEMO) {
+		if (g_demoExitRect->contains(mousePos)) {
+			if (_curStack == aspit && _curCard == 1) {
+				// From the main menu, go to the "quit" screen
+				changeToCard(12);
+			} else if (_curStack == aspit && _curCard == 12) {
+				// From the "quit" screen, just quit
+				_gameOver = true;
+			} else {
+				// Otherwise, return to the main menu
+				if (_curStack != aspit)
+					changeToStack(aspit);
+				changeToCard(1);
+			}
+		}
 		return;
+	}
 
+	// No inventory shown on aspit
+	if (_curStack == aspit)
+		return;
+
 	// Set the return stack/card id's.
 	*matchVarToString("returnstackid") = _curStack;
 	*matchVarToString("returncardid") = _curCard;

Modified: scummvm/trunk/engines/mohawk/riven.h
===================================================================
--- scummvm/trunk/engines/mohawk/riven.h	2010-09-03 18:14:59 UTC (rev 52508)
+++ scummvm/trunk/engines/mohawk/riven.h	2010-09-03 19:13:58 UTC (rev 52509)
@@ -74,6 +74,7 @@
 extern Common::Rect *g_atrusJournalRect3;
 extern Common::Rect *g_cathJournalRect3;
 extern Common::Rect *g_trapBookRect3;
+extern Common::Rect *g_demoExitRect;
 
 struct RivenHotspot {
 	uint16 blstID;

Modified: scummvm/trunk/engines/mohawk/riven_external.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/riven_external.cpp	2010-09-03 18:14:59 UTC (rev 52508)
+++ scummvm/trunk/engines/mohawk/riven_external.cpp	2010-09-03 19:13:58 UTC (rev 52509)
@@ -68,6 +68,8 @@
 	COMMAND(xadisablemenureturn);
 	COMMAND(xaenablemenureturn);
 	COMMAND(xalaunchbrowser);
+	COMMAND(xadisablemenuintro);
+	COMMAND(xaenablemenuintro);
 
 	// bspit (Bookmaking Island) external commands
 	COMMAND(xblabopenbook);
@@ -204,8 +206,8 @@
 }
 
 void RivenExternal::runDemoBoundaryDialog() {
-	GUI::MessageDialog dialog("This demo does not allow you\n"
-							  "to visit that part of Riven.");
+	GUI::MessageDialog dialog("Exploration beyond this point available only within the full version of\n"
+							  "the game.");
 	dialog.runModal();
 }
 
@@ -596,22 +598,60 @@
 }
 
 void RivenExternal::xadisablemenureturn(uint16 argc, uint16 *argv) {
-	// Dummy function -- implemented in Mohawk::go
+	// This function would normally enable the Windows menu item for
+	// returning to the main menu. Ctrl+r will do this instead.
+	// The original also had this shortcut.
 }
 
 void RivenExternal::xaenablemenureturn(uint16 argc, uint16 *argv) {
-	// Dummy function -- implemented in Mohawk::go
+	// This function would normally enable the Windows menu item for
+	// returning to the main menu. Ctrl+r will do this instead.
+	// The original also had this shortcut.
 }
 
 void RivenExternal::xalaunchbrowser(uint16 argc, uint16 *argv) {
 	// Well, we can't launch a browser for obvious reasons ;)
+	// The original text is as follows (for reference):
+
+	// If you have an auto-dial configured connection to the Internet,
+	// please select YES below.
+	//
+	// America Online and CompuServe users may experience difficulty. If
+	// you find that you are unable to connect, please quit the Riven
+	// Demo, launch your browser and type in the following URL:
+	//
+	//     www.redorb.com/buyriven
+	//
+	// Would you like to attempt to make the connection?
+	//
+	// [YES] [NO]
+
 	GUI::MessageDialog dialog("At this point, the Riven Demo would\n"
-							  "open up a web browser to bring you to\n"
-							  "the Riven website. ScummVM cannot do\n"
-							  "that. Visit the site on your own.");
+							  "ask if you would like to open a web browser\n"
+							  "to bring you to the Red Orb store to buy\n"
+							  "the game. ScummVM cannot do that and\n"
+							  "the site no longer exists.");
 	dialog.runModal();
 }
 
+void RivenExternal::xadisablemenuintro(uint16 argc, uint16 *argv) {
+	// This function would normally enable the Windows menu item for
+	// playing the intro. Ctrl+p will play the intro movies instead.
+	// The original also had this shortcut.
+
+	// Hide the "exit" button here
+	_vm->_gfx->hideInventory();
+}
+
+void RivenExternal::xaenablemenuintro(uint16 argc, uint16 *argv) {
+	// This function would normally enable the Windows menu item for
+	// playing the intro. Ctrl+p will play the intro movies instead.
+	// The original also had this shortcut.
+
+	// Show the "exit" button here
+	_vm->_gfx->showInventory();
+}
+
 // ------------------------------------------------------------------------------------
 // bspit (Bookmaking Island) external commands
 // ------------------------------------------------------------------------------------

Modified: scummvm/trunk/engines/mohawk/riven_external.h
===================================================================
--- scummvm/trunk/engines/mohawk/riven_external.h	2010-09-03 18:14:59 UTC (rev 52508)
+++ scummvm/trunk/engines/mohawk/riven_external.h	2010-09-03 19:13:58 UTC (rev 52509)
@@ -95,6 +95,8 @@
 	void xadisablemenureturn(uint16 argc, uint16 *argv);
 	void xaenablemenureturn(uint16 argc, uint16 *argv);
 	void xalaunchbrowser(uint16 argc, uint16 *argv);
+	void xadisablemenuintro(uint16 argc, uint16 *argv);
+	void xaenablemenuintro(uint16 argc, uint16 *argv);
 
 	// -----------------------------------------------------
 	// bspit (Boiler Island) external commands

Modified: scummvm/trunk/engines/mohawk/video.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/video.cpp	2010-09-03 18:14:59 UTC (rev 52508)
+++ scummvm/trunk/engines/mohawk/video.cpp	2010-09-03 19:13:58 UTC (rev 52509)
@@ -123,7 +123,7 @@
 
 	delete _videoStreams[videoHandle].video;
 	_videoStreams[videoHandle].video = 0;
-	_videoStreams[videoHandle].id = 0;
+	_videoStreams[videoHandle].id = 0xffff;
 	_videoStreams[videoHandle].filename.clear();
 }
 
@@ -156,7 +156,7 @@
 			} else {
 				delete _videoStreams[i].video;
 				_videoStreams[i].video = 0;
-				_videoStreams[i].id = 0;
+				_videoStreams[i].id = 0xffff;
 				_videoStreams[i].filename.clear();
 				continue;
 			}
@@ -292,7 +292,7 @@
 				if (_mlstRecords[i].movieID == _videoStreams[j].id) {
 					delete _videoStreams[j].video;
 					_videoStreams[j].video = 0;
-					_videoStreams[j].id = 0;
+					_videoStreams[j].id = 0xffff;
 					_videoStreams[j].filename.clear();
 					return;
 				}
@@ -368,7 +368,7 @@
 	entry.x = x;
 	entry.y = y;
 	entry.filename = filename;
-	entry.id = 0;
+	entry.id = 0xffff;
 	entry.loop = loop;
 	entry.enabled = true;
 	


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