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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Fri Aug 17 08:08:18 CEST 2007


Revision: 28643
          http://scummvm.svn.sourceforge.net/scummvm/?rev=28643&view=rev
Author:   thebluegr
Date:     2007-08-16 23:08:18 -0700 (Thu, 16 Aug 2007)

Log Message:
-----------
Several bugfixes:
- The spiritual barometer display in IHNM is now updated only when necessary, to speed drawing up. This also corrects an issue where the spiritual barometer display was updated only after changing a scene
- sf92 is sfDemoSetInteractive
- It's now possible to use dashes and underscores in savegames
- Screen fading when changing scenes is now done correctly: the interface will no longer be incorrectly briefly shown while the screen is fading to black
- The interface mode is now correctly set in the non-interactive part of the IHNM demo
- sfScriptGotoScene does not have a transition parameter, therefore that parameter has been removed

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

Modified: scummvm/trunk/engines/saga/events.cpp
===================================================================
--- scummvm/trunk/engines/saga/events.cpp	2007-08-17 05:57:32 UTC (rev 28642)
+++ scummvm/trunk/engines/saga/events.cpp	2007-08-17 06:08:18 UTC (rev 28643)
@@ -338,6 +338,17 @@
 
 				if (event->param == kEvPSetPalette) {
 					PalEntry *palPointer;
+
+					if (_vm->getGameType() == GType_IHNM) {
+						if (_vm->_spiritualBarometer > 255)
+							_vm->_gfx->setPaletteColor(kIHNMColorPortrait, 0xff, 0xff, 0xff);
+						else
+							_vm->_gfx->setPaletteColor(kIHNMColorPortrait,
+								_vm->_spiritualBarometer * _vm->_interface->_portraitBgColor.red / 256,
+								_vm->_spiritualBarometer * _vm->_interface->_portraitBgColor.green / 256,
+								_vm->_spiritualBarometer * _vm->_interface->_portraitBgColor.blue / 256);
+					}
+
 					_vm->_scene->getBGPal(palPointer);
 					_vm->_gfx->setPalette(palPointer);
 				}

Modified: scummvm/trunk/engines/saga/interface.cpp
===================================================================
--- scummvm/trunk/engines/saga/interface.cpp	2007-08-17 05:57:32 UTC (rev 28642)
+++ scummvm/trunk/engines/saga/interface.cpp	2007-08-17 06:08:18 UTC (rev 28643)
@@ -801,16 +801,6 @@
 		converseDisplayTextLines(backBuffer);
 	}
 
-	if (_vm->getGameType() == GType_IHNM) {
-		if (_vm->_spiritualBarometer > 255)
-			_vm->_gfx->setPaletteColor(kIHNMColorPortrait, 0xff, 0xff, 0xff);
-		else
-			_vm->_gfx->setPaletteColor(kIHNMColorPortrait,
-				_vm->_spiritualBarometer * _portraitBgColor.red / 256,
-				_vm->_spiritualBarometer * _portraitBgColor.green / 256,
-				_vm->_spiritualBarometer * _portraitBgColor.blue / 256);
-	}
-
 	if (_panelMode == kPanelMain || _panelMode == kPanelConverse ||
 		_lockedMode == kPanelMain || _lockedMode == kPanelConverse ||
 		(_panelMode == kPanelNull && _vm->getGameId() == GID_IHNM_DEMO)) {
@@ -1196,7 +1186,7 @@
 		if (((ascii >= 'a') && (ascii <='z')) ||
 			((ascii >= '0') && (ascii <='9')) ||
 			((ascii >= 'A') && (ascii <='Z')) ||
-			(ascii == ' ')) {
+			 (ascii == ' ') || (ascii == '-') || (ascii == '_')) {
 			if (_textInputStringLength < SAVE_TITLE_SIZE - 1) {
 				ch[0] = ascii;
 				tempWidth = _vm->_font->getStringWidth(kKnownFontSmall, ch, 0, kFontNormal);
@@ -1808,6 +1798,10 @@
 	if (_vm->getGameType() == GType_IHNM && _vm->_scene->currentChapterNumber() == 8)
 		return;
 
+	// Don't draw the status bar while fading out
+	if (_fadeMode == kFadeOut)
+		return;
+
 	backBuffer = _vm->_gfx->getBackBuffer();
 
 	// Erase background of status bar

Modified: scummvm/trunk/engines/saga/interface.h
===================================================================
--- scummvm/trunk/engines/saga/interface.h	2007-08-17 05:57:32 UTC (rev 28642)
+++ scummvm/trunk/engines/saga/interface.h	2007-08-17 06:08:18 UTC (rev 28643)
@@ -379,6 +379,7 @@
 
 public:
 	SpriteList _defPortraits;
+	PalEntry _portraitBgColor;
 
 private:
 	SagaEngine *_vm;
@@ -416,7 +417,6 @@
 	int _statusOnceColor;
 	int _leftPortrait;
 	int _rightPortrait;
-	PalEntry _portraitBgColor;
 
 	Point _lastMousePoint;
 

Modified: scummvm/trunk/engines/saga/scene.cpp
===================================================================
--- scummvm/trunk/engines/saga/scene.cpp	2007-08-17 05:57:32 UTC (rev 28642)
+++ scummvm/trunk/engines/saga/scene.cpp	2007-08-17 06:08:18 UTC (rev 28643)
@@ -561,6 +561,9 @@
 	Event *q_event;
 	static PalEntry current_pal[PAL_ENTRIES];
 
+	if (loadSceneParams->transitionType == kTransitionFade)
+		_vm->_interface->setFadeMode(kFadeOut);
+
 	// Change the cursor to an hourglass in IHNM
 	event.type = kEvTOneshot;
 	event.code = kCursorEvent;
@@ -612,6 +615,7 @@
 		_vm->_script->setVerb(_vm->_script->getVerbType(kVerbWalkTo));
 
 		if (loadSceneParams->sceneDescriptor == -2) {
+			_vm->_interface->setFadeMode(kNoFade);
 			return;
 		}
 	}
@@ -651,11 +655,11 @@
 
 	debug(3, "Loading scene number %d:", _sceneNumber);
 
-	if (_vm->getGameId() == GID_IHNM_DEMO && _sceneNumber == 144) {
+	if (_vm->getGameId() == GID_IHNM_DEMO && (_sceneNumber >= 144 && _sceneNumber <= 149)) {
 		// 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
+		// non-interactive demo, opcode sfMainMode is incorrectly called. Therefore, if any
+		// of the scenes of the non-interactive demo are loaded (scenes 144-149), set panel 
+		// to null and lock the user interface
 		_vm->_interface->deactivate();
 		_vm->_interface->setMode(kPanelNull);
 	}

Modified: scummvm/trunk/engines/saga/script.h
===================================================================
--- scummvm/trunk/engines/saga/script.h	2007-08-17 05:57:32 UTC (rev 28642)
+++ scummvm/trunk/engines/saga/script.h	2007-08-17 06:08:18 UTC (rev 28643)
@@ -597,7 +597,7 @@
 	void sfShowIHNMDemoHelpPage(SCRIPTFUNC_PARAMS);
 	void sfGetPoints(SCRIPTFUNC_PARAMS);
 	void sfSetGlobalFlag(SCRIPTFUNC_PARAMS);
-	void sf92(SCRIPTFUNC_PARAMS);
+	void sfDemoSetInteractive(SCRIPTFUNC_PARAMS);
 	void sfClearGlobalFlag(SCRIPTFUNC_PARAMS);
 	void sfTestGlobalFlag(SCRIPTFUNC_PARAMS);
 	void sfSetPoints(SCRIPTFUNC_PARAMS);

Modified: scummvm/trunk/engines/saga/sfuncs.cpp
===================================================================
--- scummvm/trunk/engines/saga/sfuncs.cpp	2007-08-17 05:57:32 UTC (rev 28642)
+++ scummvm/trunk/engines/saga/sfuncs.cpp	2007-08-17 06:08:18 UTC (rev 28643)
@@ -230,7 +230,7 @@
 		OPCODE(sfShowIHNMDemoHelpPage),
 		OPCODE(sfVstopFX),
 		OPCODE(sfVstopLoopedFX),
-		OPCODE(sf92),	// only used in the demo version of IHNM
+		OPCODE(sfDemoSetInteractive),	// only used in the demo version of IHNM
 		OPCODE(sfDemoIsInteractive),
 		OPCODE(sfVsetTrack),
 		OPCODE(sfGetPoints),
@@ -554,13 +554,10 @@
 void Script::sfScriptGotoScene(SCRIPTFUNC_PARAMS) {
 	int16 sceneNumber;
 	int16 entrance;
-	int16 transition = 0;	// IHNM
 
 	sceneNumber = thread->pop();
 	entrance = thread->pop();
 	if (_vm->getGameType() == GType_IHNM) {
-		transition = thread->pop();
-
 		_vm->_gfx->setCursor(kCursorBusy);
 	}
 
@@ -1889,6 +1886,18 @@
 	_vm->_ethicsPoints[chapter] = ethics;
 	_vm->_spiritualBarometer = ethics * 256 / barometer;
 	_vm->_scene->setChapterPointsChanged(true);		// don't save this music when saving in IHNM
+
+	if (_vm->_spiritualBarometer > 255)
+		_vm->_gfx->setPaletteColor(kIHNMColorPortrait, 0xff, 0xff, 0xff);
+	else
+		_vm->_gfx->setPaletteColor(kIHNMColorPortrait,
+			_vm->_spiritualBarometer * _vm->_interface->_portraitBgColor.red / 256,
+			_vm->_spiritualBarometer * _vm->_interface->_portraitBgColor.green / 256,
+			_vm->_spiritualBarometer * _vm->_interface->_portraitBgColor.blue / 256);
+
+	PalEntry *palPointer;
+	_vm->_scene->getBGPal(palPointer);
+	_vm->_gfx->setPalette(palPointer);
 }
 
 void Script::sfSetPortraitBgColor(SCRIPTFUNC_PARAMS) {
@@ -2052,9 +2061,16 @@
 	_vm->_sound->stopSound();
 }
 
-void Script::sf92(SCRIPTFUNC_PARAMS) {
-	SF_stub("sf92", thread, nArgs);
-	// This opcode is empty in the full version of IHNM, but it's not empty in the demo
+void Script::sfDemoSetInteractive(SCRIPTFUNC_PARAMS) {
+	int16 interactiveFlag = thread->pop();
+
+	if (interactiveFlag == 0) {
+		_vm->_interface->deactivate();
+		_vm->_interface->setMode(kPanelNull);
+	}
+
+	// Note: the original also sets an appropriate flag here, but we don't,
+	// as we don't use it
 }
 
 void Script::sfDemoIsInteractive(SCRIPTFUNC_PARAMS) {


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