[Scummvm-cvs-logs] CVS: scummvm/sky control.cpp,1.37,1.38 screen.cpp,1.39,1.40 screen.h,1.9,1.10

Robert G?ffringmann lavosspawn at users.sourceforge.net
Thu Jul 10 13:50:51 CEST 2003


Update of /cvsroot/scummvm/scummvm/sky
In directory sc8-pr-cvs1:/tmp/cvs-serv8079/sky

Modified Files:
	control.cpp screen.cpp screen.h 
Log Message:
fixed endian specific palette bugs for restarting game and control panel

Index: control.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/control.cpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- control.cpp	10 Jul 2003 07:56:35 -0000	1.37
+++ control.cpp	10 Jul 2003 20:09:19 -0000	1.38
@@ -415,7 +415,7 @@
 	_system->copy_rect(_screenBuf, GAME_SCREEN_WIDTH, 0, 0, GAME_SCREEN_WIDTH, FULL_SCREEN_HEIGHT);
 	_system->update_screen();
 	_skyScreen->forceRefresh();
-	_skyScreen->setPalette((uint8 *)SkyState::fetchCompact(SkyState::_systemVars.currentPalette));
+	_skyScreen->setPaletteEndian((uint8 *)SkyState::fetchCompact(SkyState::_systemVars.currentPalette));
 	removePanel();
 	_skyMouse->spriteMouse(_savedMouse, 0, 0);
 	_skyText->fnSetFont(_savedCharSet);
@@ -481,7 +481,7 @@
 	_system->copy_rect(_screenBuf, GAME_SCREEN_WIDTH, 0, 0, GAME_SCREEN_WIDTH, FULL_SCREEN_HEIGHT);
 	_system->update_screen();
 	_skyScreen->forceRefresh();
-	_skyScreen->setPalette((uint8 *)SkyState::fetchCompact(SkyState::_systemVars.currentPalette));
+	_skyScreen->setPaletteEndian((uint8 *)SkyState::fetchCompact(SkyState::_systemVars.currentPalette));
 	removePanel();
 	_skyMouse->spriteMouse(_savedMouse, 0, 0);
 	_skyText->fnSetFont(_savedCharSet);
@@ -1432,7 +1432,7 @@
 	uint16 lzBuf[0x1000];
 	memset(lzBuf + 0xF00, 0, 0x200);
 	for (lzPos = 0; lzPos < 0xF00; lzPos++)
-		lzBuf[lzPos] = 0xF00 - lzPos;
+		lzBuf[lzPos] = TO_LE_16(0xF00 - lzPos);
 	lzPos = 0;
 	uint32 indic = 0;
 	while (outPos < size) {
@@ -1499,7 +1499,7 @@
 	_skyScreen->forceRefresh();
 	memset(_skyScreen->giveCurrent(), 0, GAME_SCREEN_WIDTH * FULL_SCREEN_HEIGHT);
 	_skyScreen->showScreen(_skyScreen->giveCurrent());
-	_skyScreen->setPalette((uint8 *)SkyState::fetchCompact(SkyState::_systemVars.currentPalette));
+	_skyScreen->setPaletteEndian((uint8 *)SkyState::fetchCompact(SkyState::_systemVars.currentPalette));
 	_skyMouse->spriteMouse(_savedMouse, 0, 0);
 	SkyState::_systemVars.pastIntro = true;
 }

Index: screen.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/screen.cpp,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- screen.cpp	8 Jul 2003 22:27:17 -0000	1.39
+++ screen.cpp	10 Jul 2003 20:09:19 -0000	1.40
@@ -99,6 +99,19 @@
 	_system->update_screen();
 }
 
+void SkyScreen::setPaletteEndian(uint8 *pal) {
+
+#ifdef SCUMM_BIG_ENDIAN
+	uint8 endPalette[256 * 3];
+	for (uint16 cnt = 0; cnt < 256 * 3; cnt++)
+		endPalette[cnt] = pal[cnt ^ 1];
+	convertPalette(endPal, _palette);
+#else
+	convertPalette(pal, _palette);
+	_system->set_palette(_palette, 0, GAME_COLOURS);
+	_system->update_screen();
+}
+
 void SkyScreen::halvePalette(void) {
 
 	uint8 halfPalette[1024];

Index: screen.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/screen.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- screen.h	1 Jul 2003 01:29:29 -0000	1.9
+++ screen.h	10 Jul 2003 20:09:19 -0000	1.10
@@ -52,6 +52,7 @@
 	SkyScreen(OSystem *pSystem, SkyDisk *pDisk);
 	~SkyScreen(void);
 	void setPalette(uint8 *pal);
+	void setPaletteEndian(uint8 *pal);
 	void setPalette(uint16 fileNum);
 	void paletteFadeUp(uint8 *pal);
 	void paletteFadeUp(uint16 fileNr);





More information about the Scummvm-git-logs mailing list