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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Thu Aug 2 16:43:10 CEST 2007


Revision: 28406
          http://scummvm.svn.sourceforge.net/scummvm/?rev=28406&view=rev
Author:   thebluegr
Date:     2007-08-02 07:43:10 -0700 (Thu, 02 Aug 2007)

Log Message:
-----------
The help screen in the IHNM demo is shown correctly now

Modified Paths:
--------------
    scummvm/trunk/engines/saga/interface.cpp
    scummvm/trunk/engines/saga/scene.cpp
    scummvm/trunk/engines/saga/script.h
    scummvm/trunk/engines/saga/sfuncs.cpp

Modified: scummvm/trunk/engines/saga/interface.cpp
===================================================================
--- scummvm/trunk/engines/saga/interface.cpp	2007-08-02 11:39:45 UTC (rev 28405)
+++ scummvm/trunk/engines/saga/interface.cpp	2007-08-02 14:43:10 UTC (rev 28406)
@@ -694,14 +694,18 @@
 		} else {
 			// In the IHNM demo, this panel mode is set by the scripts
 			// to flip through the pages of the help system
-			// Any keypress here returns the user back to the game
-			_vm->_scene->clearPsychicProfile();
 		}
 		break;
 	case kPanelPlacard:
 		if (_vm->getGameType() == GType_IHNM) {
 			// Any keypress here returns the user back to the game
-			_vm->_scene->clearPsychicProfile();
+			if (_vm->getGameId() != GID_IHNM_DEMO) {
+				_vm->_scene->clearPsychicProfile();
+			} else {
+				setMode(kPanelConverse);
+				_vm->_scene->_textList.clear();
+				_vm->_script->wakeUpThreads(kWaitTypeDelay);
+			}
 		}
 		break;
 	}
@@ -1770,8 +1774,15 @@
 	case kPanelPlacard:
 		if (_vm->getGameType() == GType_IHNM) {
 			// Any mouse click here returns the user back to the game
-			if (updateFlag & UPDATE_MOUSECLICK)
-				_vm->_scene->clearPsychicProfile();
+			if (updateFlag & UPDATE_MOUSECLICK) {
+				if (_vm->getGameId() != GID_IHNM_DEMO) {
+					_vm->_scene->clearPsychicProfile();
+				} else {
+					setMode(kPanelConverse);
+					_vm->_scene->_textList.clear();
+					_vm->_script->wakeUpThreads(kWaitTypeDelay);
+				}
+			}
 		}
 		break;
 

Modified: scummvm/trunk/engines/saga/scene.cpp
===================================================================
--- scummvm/trunk/engines/saga/scene.cpp	2007-08-02 11:39:45 UTC (rev 28405)
+++ scummvm/trunk/engines/saga/scene.cpp	2007-08-02 14:43:10 UTC (rev 28406)
@@ -1411,6 +1411,8 @@
 
 	q_event = _vm->_events->chain(q_event, &event);
 
+	_vm->_scene->_textList.clear();
+
 	if (text != NULL) {
 		textHeight = _vm->_font->getHeight(kKnownFontVerb, text, 226, kFontCentered);
 
@@ -1424,7 +1426,6 @@
 		textEntry.flags = (FontEffectFlags)(kFontCentered);
 		textEntry.text = text;
 
-		_vm->_scene->_textList.clear();
 		TextListEntry *_psychicProfileTextEntry = _vm->_scene->_textList.addEntry(textEntry);
 
 		event.type = kEvTOneshot;
@@ -1455,8 +1456,9 @@
 }
 
 void Scene::clearPsychicProfile() {
-	if (_vm->_interface->getMode() == kPanelPlacard) {
+	if (_vm->_interface->getMode() == kPanelPlacard || _vm->getGameId() == GID_IHNM_DEMO) {
 		_vm->_scene->clearPlacard();
+		_vm->_scene->_textList.clear();
 		_vm->_actor->showActors(false);
 		_vm->_gfx->restorePalette();
 		_vm->_scene->restoreScene();

Modified: scummvm/trunk/engines/saga/script.h
===================================================================
--- scummvm/trunk/engines/saga/script.h	2007-08-02 11:39:45 UTC (rev 28405)
+++ scummvm/trunk/engines/saga/script.h	2007-08-02 14:43:10 UTC (rev 28406)
@@ -592,9 +592,9 @@
 	void sfScriptStartVideo(SCRIPTFUNC_PARAMS);
 	void sfScriptReturnFromVideo(SCRIPTFUNC_PARAMS);
 	void sfScriptEndVideo(SCRIPTFUNC_PARAMS);
-	void sfShowIHNMDemoHelp(SCRIPTFUNC_PARAMS);
-	void sfShowIHNMDemoHelpText(SCRIPTFUNC_PARAMS);
-	void sfClearIHNMDemoHelpText(SCRIPTFUNC_PARAMS);
+	void sfShowIHNMDemoHelpBg(SCRIPTFUNC_PARAMS);
+	void sfAddIHNMDemoHelpTextLine(SCRIPTFUNC_PARAMS);
+	void sfShowIHNMDemoHelpPage(SCRIPTFUNC_PARAMS);
 	void sfGetPoints(SCRIPTFUNC_PARAMS);
 	void sfSetGlobalFlag(SCRIPTFUNC_PARAMS);
 	void sf92(SCRIPTFUNC_PARAMS);

Modified: scummvm/trunk/engines/saga/sfuncs.cpp
===================================================================
--- scummvm/trunk/engines/saga/sfuncs.cpp	2007-08-02 11:39:45 UTC (rev 28405)
+++ scummvm/trunk/engines/saga/sfuncs.cpp	2007-08-02 14:43:10 UTC (rev 28406)
@@ -225,9 +225,9 @@
 		OPCODE(sfScriptReturnFromVideo),
 		OPCODE(sfScriptEndVideo),
 		OPCODE(sfSetActorZ),
-		OPCODE(sfShowIHNMDemoHelp),
-		OPCODE(sfShowIHNMDemoHelpText),
-		OPCODE(sfClearIHNMDemoHelpText),
+		OPCODE(sfShowIHNMDemoHelpBg),
+		OPCODE(sfAddIHNMDemoHelpTextLine),
+		OPCODE(sfShowIHNMDemoHelpPage),
 		OPCODE(sfVstopFX),
 		OPCODE(sfVstopLoopedFX),
 		OPCODE(sf92),	// only used in the demo version of IHNM
@@ -1998,14 +1998,12 @@
 	_vm->_anim->endVideo();
 }
 
-void Script::sfShowIHNMDemoHelp(SCRIPTFUNC_PARAMS) {
-	thread->wait(kWaitTypePlacard);
-
+void Script::sfShowIHNMDemoHelpBg(SCRIPTFUNC_PARAMS) {
 	_ihnmDemoCurrentY = 0;
 	_vm->_scene->showPsychicProfile(NULL);
 }
 
-void Script::sfShowIHNMDemoHelpText(SCRIPTFUNC_PARAMS) {
+void Script::sfAddIHNMDemoHelpTextLine(SCRIPTFUNC_PARAMS) {
 	int stringId, textHeight;
 	TextListEntry textEntry;
 	Event event;
@@ -2039,17 +2037,11 @@
 	_ihnmDemoCurrentY += 10;
 }
 
-void Script::sfClearIHNMDemoHelpText(SCRIPTFUNC_PARAMS) {
-	thread->wait(kWaitTypePlacard);
-
-	warning("TODO: sfClearIHNMDemoHelpText");
-
-	// This is called a while after the psychic profile is
-	// opened in the IHNM demo, to flip through the help system pages
-	_vm->_scene->clearPlacard();
-	// FIXME: The demo uses mode 8 when changing pages
-	//_vm->_interface->setMode(8);
-	_vm->_interface->setMode(7);
+void Script::sfShowIHNMDemoHelpPage(SCRIPTFUNC_PARAMS) {
+	// Note: The IHNM demo changes panel mode to 8 (kPanelProtect in ITE)
+	// when changing pages
+	_vm->_interface->setMode(kPanelConverse);
+	_vm->_interface->setMode(kPanelPlacard);
 	_ihnmDemoCurrentY = 0;
 }
 


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