[Scummvm-cvs-logs] SF.net SVN: scummvm: [28344] scummvm/trunk/engines/saga

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Tue Jul 31 01:37:19 CEST 2007


Revision: 28344
          http://scummvm.svn.sourceforge.net/scummvm/?rev=28344&view=rev
Author:   thebluegr
Date:     2007-07-30 16:37:18 -0700 (Mon, 30 Jul 2007)

Log Message:
-----------
The interactive part of the IHNM demo fully works now. Also, made the options screen work in the non-interactive part of the demo

Modified Paths:
--------------
    scummvm/trunk/engines/saga/animation.cpp
    scummvm/trunk/engines/saga/gfx.cpp
    scummvm/trunk/engines/saga/interface.cpp
    scummvm/trunk/engines/saga/scene.cpp
    scummvm/trunk/engines/saga/scene.h

Modified: scummvm/trunk/engines/saga/animation.cpp
===================================================================
--- scummvm/trunk/engines/saga/animation.cpp	2007-07-30 23:30:08 UTC (rev 28343)
+++ scummvm/trunk/engines/saga/animation.cpp	2007-07-30 23:37:18 UTC (rev 28344)
@@ -316,7 +316,17 @@
 		}
 
 		_vm->_interface->restoreMode();
-		_vm->_gfx->showCursor(true);
+		
+		if (_vm->getGameId() != GID_IHNM_DEMO) {
+			if (_vm->_scene->currentSceneNumber() >= 144 && _vm->_scene->currentSceneNumber() <= 149) {
+				// Don't show the mouse cursor in the non-interactive part of the IHNM demo
+			} else {
+				_vm->_gfx->showCursor(true);
+			}
+		} else {
+			// Enable the save reminder state after each cutaway for the IHNM demo
+			_vm->_interface->setSaveReminderState(true);
+		}
 	}
 }
 

Modified: scummvm/trunk/engines/saga/gfx.cpp
===================================================================
--- scummvm/trunk/engines/saga/gfx.cpp	2007-07-30 23:30:08 UTC (rev 28343)
+++ scummvm/trunk/engines/saga/gfx.cpp	2007-07-30 23:37:18 UTC (rev 28344)
@@ -406,8 +406,7 @@
 }
 
 void Gfx::showCursor(bool state) {
-	if (_vm->getGameId() != GID_IHNM_DEMO)	// Don't show the mouse cursor in the IHNM demo
-		CursorMan.showMouse(state);
+	CursorMan.showMouse(state);
 }
 
 void Gfx::setCursor(CursorType cursorType) {

Modified: scummvm/trunk/engines/saga/interface.cpp
===================================================================
--- scummvm/trunk/engines/saga/interface.cpp	2007-07-30 23:30:08 UTC (rev 28343)
+++ scummvm/trunk/engines/saga/interface.cpp	2007-07-30 23:37:18 UTC (rev 28344)
@@ -339,11 +339,21 @@
 		unlockMode();
 		if (_panelMode == kPanelMain || _panelMode == kPanelChapterSelection) {
 			_saveReminderState = 1;
+		} else if (_panelMode == kPanelNull && _vm->getGameId() == GID_IHNM_DEMO) {
+			_saveReminderState = 1;
 		}
 		draw();
 	}
-	_vm->_gfx->showCursor(true);
 
+	if (_vm->getGameId() != GID_IHNM_DEMO) {
+		_vm->_gfx->showCursor(true);
+	} else {		
+		if (_vm->_scene->currentSceneNumber() >= 144 && _vm->_scene->currentSceneNumber() <= 149) {
+			// Don't show the mouse cursor in the non-interactive part of the IHNM demo
+		} else {
+			_vm->_gfx->showCursor(true);
+		}
+	}
 	return SUCCESS;
 }
 
@@ -381,14 +391,6 @@
 void Interface::setMode(int mode) {
 	debug(1, "Interface::setMode %i", mode);
 
-	// The non-interactive part of the IHNM demo does not have an options
-	// screen - the psychic profile screen is displayed instead, with some
-	// dialog options (help, play non-interactive demo, play interactive demo, quit)
-	// TODO: Show the psychic profile screen in the non-interactive demo and show
-	// the normal options screen in the interactive demo
-	if (_vm->getGameId() == GID_IHNM_DEMO && mode == kPanelOption)
-		mode = kPanelNull;
-
 	if (mode == kPanelMain) {
 		_inMainMode = true;
 		_saveReminderState = 1; //TODO: blinking timeout
@@ -398,16 +400,20 @@
 		if (_vm->getGameId() == GID_IHNM_DEMO) {
 			_inMainMode = true;
 			_saveReminderState = 1;
+			if ((_vm->_scene->currentSceneNumber() >= 144 && _vm->_scene->currentSceneNumber() <= 149) ||
+				_vm->_scene->currentSceneNumber() == 0 || _vm->_scene->currentSceneNumber() == -1)
+				_vm->_gfx->showCursor(false);
 		}
+	} else if (mode == kPanelOption) {
+		// Show the cursor in the IHNM demo
+		if (_vm->getGameId() == GID_IHNM_DEMO)
+			_vm->_gfx->showCursor(true);
 	} else {
 		if (mode == kPanelConverse) {
 			_inMainMode = false;
 		}
 
-		if (_vm->getGameId() != GID_IHNM_DEMO)
-			_saveReminderState = 0;
-		else
-			_saveReminderState = 1;
+		_saveReminderState = 0;
 	}
 
 	_panelMode = mode;
@@ -493,6 +499,11 @@
 			}
 			return true;
 		}
+
+		if (_vm->getGameId() == GID_IHNM_DEMO) {
+			if (_vm->_scene->currentSceneNumber() >= 144 && _vm->_scene->currentSceneNumber() <= 149)
+				_vm->_scene->showIHNMDemoSpecialScreen();
+		}
 		break;
 	case kPanelCutaway:
 		if (ascii == 27) { // Esc
@@ -501,6 +512,11 @@
 			_vm->_scene->cutawaySkip();
 			return true;
 		}
+
+		if (_vm->getGameId() == GID_IHNM_DEMO) {
+			if (_vm->_scene->currentSceneNumber() >= 144 && _vm->_scene->currentSceneNumber() <= 149)
+				_vm->_scene->showIHNMDemoSpecialScreen();
+		}
 		break;
 	case kPanelVideo:
 		if (ascii == 27) { // Esc
@@ -511,7 +527,13 @@
 					_vm->_actor->abortAllSpeeches();
 			}
 			_vm->_scene->cutawaySkip();
+			return true;
 		}
+
+		if (_vm->getGameId() == GID_IHNM_DEMO) {
+			if (_vm->_scene->currentSceneNumber() >= 144 && _vm->_scene->currentSceneNumber() <= 149)
+				_vm->_scene->showIHNMDemoSpecialScreen();
+		}
 		break;
 	case kPanelOption:
 		// TODO: check input dialog keys
@@ -679,8 +701,8 @@
 	if (_vm->getGameType() == GType_IHNM && _vm->_scene->currentChapterNumber() == 8)
 		return;
 
-	// Disable the status text in the IHNM demo
-	if (_vm->getGameId() == GID_IHNM_DEMO)
+	// Disable the status text in the introduction of the IHNM demo
+	if (_vm->getGameId() == GID_IHNM_DEMO && _vm->_scene->currentSceneNumber() == 0)
 		return;
 
 	assert(text != NULL);
@@ -1496,10 +1518,20 @@
 	switch (panelButton->id) {
 	case kTextContinuePlaying:
 		ConfMan.flushToDisk();
-		if (!(_vm->getGameType() == GType_IHNM && _vm->_scene->currentChapterNumber() == 8))
+		if (_vm->getGameType() == GType_ITE) {
 			setMode(kPanelMain);
-		else
-			setMode(kPanelChapterSelection);
+		} else {
+			if (_vm->_scene->currentChapterNumber() == 8) {
+				setMode(kPanelChapterSelection);
+			} else if (_vm->getGameId() == GID_IHNM_DEMO) {
+				if (_vm->_scene->currentSceneNumber() >= 144 && _vm->_scene->currentSceneNumber() <= 149)
+					setMode(kPanelNull);
+				else
+					setMode(kPanelMain);
+			} else {
+				setMode(kPanelMain);
+			}
+		}
 		break;
 	case kTextQuitGame:
 		setMode(kPanelQuit);
@@ -1515,6 +1547,12 @@
 		}
 		break;
 	case kTextSave:
+		// Disallow saving in the non-interactive part of the IHNM demo
+		if (_vm->getGameId() == GID_IHNM_DEMO) {
+			if (_vm->_scene->currentSceneNumber() >= 144 && _vm->_scene->currentSceneNumber() <= 149)
+				return;
+		}
+
 		if (!_vm->isSaveListFull() && (_optionSaveFileTitleNumber == 0)) {
 			_textInputString[0] = 0;
 		} else {
@@ -1721,6 +1759,13 @@
 				_vm->_scene->clearPsychicProfile();
 		}
 		break;
+
+	case kPanelNull:
+		if (_vm->getGameId() == GID_IHNM_DEMO && (updateFlag & UPDATE_MOUSECLICK)) {
+			if (_vm->_scene->currentSceneNumber() >= 144 && _vm->_scene->currentSceneNumber() <= 149)
+				_vm->_scene->showIHNMDemoSpecialScreen();
+		}
+		break;
 	}
 
 	_lastMousePoint = mousePoint;

Modified: scummvm/trunk/engines/saga/scene.cpp
===================================================================
--- scummvm/trunk/engines/saga/scene.cpp	2007-07-30 23:30:08 UTC (rev 28343)
+++ scummvm/trunk/engines/saga/scene.cpp	2007-07-30 23:37:18 UTC (rev 28344)
@@ -642,6 +642,15 @@
 
 	debug(3, "Loading scene number %d:", _sceneNumber);
 
+	if (_vm->getGameId() == GID_IHNM_DEMO && _sceneNumber == 144) {
+		// WORKAROUND for the non-interactive part of the IHNM demo: When restarting the 
+		// non-interactive demo, opcode sfMainMode is incorrectly called. Therefore, if the
+		// starting scene of the non-interactive demo is loaded (scene 144), set panel to null
+		// and lock the user interface
+		_vm->_interface->deactivate();
+		_vm->_interface->setMode(kPanelNull);
+	}
+
 	// Load scene descriptor and resource list resources
 	if (_loadDescription) {
 		debug(3, "Loading scene resource %i", _sceneResourceId);
@@ -1351,4 +1360,10 @@
 	_vm->_interface->activate();
 }
 
+void Scene::showIHNMDemoSpecialScreen() {
+	_vm->_gfx->showCursor(true);
+	_vm->_interface->clearInventory();
+	_vm->_scene->changeScene(150, 0, kTransitionFade);
+}
+
 } // End of namespace Saga

Modified: scummvm/trunk/engines/saga/scene.h
===================================================================
--- scummvm/trunk/engines/saga/scene.h	2007-07-30 23:30:08 UTC (rev 28343)
+++ scummvm/trunk/engines/saga/scene.h	2007-07-30 23:37:18 UTC (rev 28344)
@@ -342,6 +342,7 @@
 
 	void clearPlacard();
 	void clearPsychicProfile();
+	void showIHNMDemoSpecialScreen();
 
  private:
 	void loadScene(LoadSceneParams *loadSceneParams);


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