[Scummvm-cvs-logs] SF.net SVN: scummvm:[50798] scummvm/trunk/engines/sci
m_kiewitz at users.sourceforge.net
m_kiewitz at users.sourceforge.net
Sun Jul 11 12:11:32 CEST 2010
Revision: 50798
http://scummvm.svn.sourceforge.net/scummvm/?rev=50798&view=rev
Author: m_kiewitz
Date: 2010-07-11 10:11:31 +0000 (Sun, 11 Jul 2010)
Log Message:
-----------
SCI: also sync palette after playing movies, fixes kq6 intro
Modified Paths:
--------------
scummvm/trunk/engines/sci/engine/kgraphics.cpp
scummvm/trunk/engines/sci/graphics/palette.cpp
scummvm/trunk/engines/sci/graphics/palette.h
scummvm/trunk/engines/sci/graphics/screen.cpp
scummvm/trunk/engines/sci/graphics/screen.h
Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp 2010-07-11 06:48:28 UTC (rev 50797)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp 2010-07-11 10:11:31 UTC (rev 50798)
@@ -1192,8 +1192,10 @@
// We also won't be copying the screen to the SCI screen...
if (g_system->getScreenFormat().bytesPerPixel != 1)
initGraphics(screenWidth, screenHeight, screenWidth > 320);
- else
+ else {
g_sci->_gfxScreen->kernelSyncWithFramebuffer();
+ g_sci->_gfxPalette->kernelSyncScreenPalette();
+ }
}
if (reshowCursor)
Modified: scummvm/trunk/engines/sci/graphics/palette.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/palette.cpp 2010-07-11 06:48:28 UTC (rev 50797)
+++ scummvm/trunk/engines/sci/graphics/palette.cpp 2010-07-11 10:11:31 UTC (rev 50798)
@@ -498,6 +498,10 @@
}
}
+void GfxPalette::kernelSyncScreenPalette() {
+ _screen->getPalette(&_sysPalette);
+}
+
// palVary
// init - only does, if palVaryOn == false
// target, start, new palette allocation
Modified: scummvm/trunk/engines/sci/graphics/palette.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/palette.h 2010-07-11 06:48:28 UTC (rev 50797)
+++ scummvm/trunk/engines/sci/graphics/palette.h 2010-07-11 10:11:31 UTC (rev 50798)
@@ -65,6 +65,8 @@
void kernelAnimateSet();
void kernelAssertPalette(GuiResourceId resourceId);
+ void kernelSyncScreenPalette();
+
bool kernelPalVaryInit(GuiResourceId resourceId, uint16 ticks, uint16 stepStop, uint16 direction);
int16 kernelPalVaryReverse(int16 ticks, uint16 stepStop, int16 direction);
int16 kernelPalVaryGetCurrentStep();
Modified: scummvm/trunk/engines/sci/graphics/screen.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/screen.cpp 2010-07-11 06:48:28 UTC (rev 50797)
+++ scummvm/trunk/engines/sci/graphics/screen.cpp 2010-07-11 10:11:31 UTC (rev 50798)
@@ -499,11 +499,23 @@
}
}
-void GfxScreen::setPalette(Palette*pal) {
+void GfxScreen::getPalette(Palette *pal) {
// just copy palette to system
byte bpal[4 * 256];
// Get current palette, update it and put back
g_system->grabPalette(bpal, 0, 256);
+ for (int16 i = 1; i < 255; i++) {
+ pal->colors[i].r = bpal[i * 4];
+ pal->colors[i].g = bpal[i * 4 + 1];
+ pal->colors[i].b = bpal[i * 4 + 2];
+ }
+}
+
+void GfxScreen::setPalette(Palette *pal) {
+ // just copy palette to system
+ byte bpal[4 * 256];
+ // Get current palette, update it and put back
+ g_system->grabPalette(bpal, 0, 256);
for (int16 i = 0; i < 256; i++) {
if (!pal->colors[i].used)
continue;
Modified: scummvm/trunk/engines/sci/graphics/screen.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/screen.h 2010-07-11 06:48:28 UTC (rev 50797)
+++ scummvm/trunk/engines/sci/graphics/screen.h 2010-07-11 10:11:31 UTC (rev 50798)
@@ -106,7 +106,8 @@
void bitsGetRect(byte *memoryPtr, Common::Rect *destRect);
void bitsRestore(byte *memoryPtr);
- void setPalette(Palette*pal);
+ void getPalette(Palette *pal);
+ void setPalette(Palette *pal);
void setVerticalShakePos(uint16 shakePos);
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