[Scummvm-cvs-logs] CVS: scummvm/sword1 logic.cpp,1.19,1.20 screen.cpp,1.21,1.22 sword1.cpp,1.19,1.20 sword1.h,1.7,1.8

Robert G?ffringmann lavosspawn at users.sourceforge.net
Mon Dec 22 03:24:02 CET 2003


Update of /cvsroot/scummvm/scummvm/sword1
In directory sc8-pr-cvs1:/tmp/cvs-serv20934/sword1

Modified Files:
	logic.cpp screen.cpp sword1.cpp sword1.h 
Log Message:
added fnSetPaletteToFade/fnSetPaletteToCut

Index: logic.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword1/logic.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- logic.cpp	21 Dec 2003 21:58:36 -0000	1.19
+++ logic.cpp	22 Dec 2003 11:23:40 -0000	1.20
@@ -889,12 +889,12 @@
 }
 
 int SwordLogic::fnSetPaletteToFade(BsObject *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x) {
-	warning("fnSetPaletteToFade(xx, %d, %d, %d, %d)", id, c, d, e);
+	SwordEngine::_systemVars.wantFade = true;
 	return SCRIPT_CONT;
 }
 
 int SwordLogic::fnSetPaletteToCut(BsObject *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x) {
-	warning("fnSetPaletteToCut(xx, %d, %d, %d, %d)", id, c, d, e);
+	SwordEngine::_systemVars.wantFade = false;
 	return SCRIPT_CONT;
 }
 

Index: screen.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword1/screen.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- screen.cpp	22 Dec 2003 01:20:47 -0000	1.21
+++ screen.cpp	22 Dec 2003 11:23:40 -0000	1.22
@@ -30,6 +30,7 @@
 #include "common/util.h"
 #include "system.h"
 #include "menu.h"
+#include "sword1.h"
 
 #define SCROLL_FRACTION 16
 #define MAX_SCROLL_DISTANCE 8
@@ -106,7 +107,7 @@
 		memset(_currentPalette, 0, 256 * 4);
 		_system->set_palette(_currentPalette, 0, 256);
 	} else
-		_system->set_palette(_targetPalette, start, length);
+		_system->set_palette(_targetPalette + 4 * start, start, length);
 }
 
 void SwordScreen::refreshPalette(void) {
@@ -259,8 +260,8 @@
 	if (_roomDefTable[_currentScreen].parallax[1])
 		_parallax[1] = (uint8*)_resMan->openFetchRes(_roomDefTable[_currentScreen].parallax[1]);
 
-	fnSetPalette(0, 184, _roomDefTable[_currentScreen].palettes[0], true);
-	fnSetPalette(184, 72, _roomDefTable[_currentScreen].palettes[1], true);
+	fnSetPalette(0, 184, _roomDefTable[_currentScreen].palettes[0], SwordEngine::_systemVars.wantFade);
+	fnSetPalette(184, 72, _roomDefTable[_currentScreen].palettes[1], SwordEngine::_systemVars.wantFade);
 }
 
 void SwordScreen::quitScreen(void) {

Index: sword1.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword1/sword1.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- sword1.cpp	22 Dec 2003 01:20:47 -0000	1.19
+++ sword1.cpp	22 Dec 2003 11:23:40 -0000	1.20
@@ -159,6 +159,7 @@
 	_objectMan->initialize(); // resources which have just been wiped.
 	_mouse->initialize();
 	// todo: reinitialize swordmenu.
+	_systemVars.wantFade = true;
 }
 
 void SwordEngine::startPositions(int32 startNumber) {
@@ -1116,9 +1117,8 @@
 			// do something smart here to implement pausing the game. If we even want that, that is.
 		} while ((SwordLogic::_scriptVars[SCREEN] == SwordLogic::_scriptVars[NEW_SCREEN]) && (retCode == 0));
         
-		if (retCode == 0) {
-			if (SwordLogic::_scriptVars[SCREEN] != 53) // we don't fade down after syria pan (53).
-				_screen->fadeDownPalette();
+		if ((retCode == 0) && (SwordLogic::_scriptVars[SCREEN] != 53) && _systemVars.wantFade) {
+			_screen->fadeDownPalette();
 			while (_screen->stillFading()) {
 				_music->stream();
 				_screen->updateScreen();

Index: sword1.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword1/sword1.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- sword1.h	22 Dec 2003 01:20:47 -0000	1.7
+++ sword1.h	22 Dec 2003 11:23:40 -0000	1.8
@@ -46,6 +46,7 @@
 
 	uint8	deathScreenFlag;	// 1 death screen version of the control panel, 2 = successful end of game, 3 = force restart
 	bool	forceRestart;
+	bool	wantFade;			// when true => fade during scene change, else cut.
 	uint8	playSpeech;
 	uint8   showText;
     uint8	language;





More information about the Scummvm-git-logs mailing list