[Scummvm-cvs-logs] SF.net SVN: scummvm:[47552] scummvm/trunk/engines/sci/graphics
m_kiewitz at users.sourceforge.net
m_kiewitz at users.sourceforge.net
Mon Jan 25 12:15:41 CET 2010
Revision: 47552
http://scummvm.svn.sourceforge.net/scummvm/?rev=47552&view=rev
Author: m_kiewitz
Date: 2010-01-25 11:15:40 +0000 (Mon, 25 Jan 2010)
Log Message:
-----------
SCI: support for amiga pictures that change the palette
Modified Paths:
--------------
scummvm/trunk/engines/sci/graphics/palette.cpp
scummvm/trunk/engines/sci/graphics/palette.h
scummvm/trunk/engines/sci/graphics/picture.cpp
Modified: scummvm/trunk/engines/sci/graphics/palette.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/palette.cpp 2010-01-25 10:17:55 UTC (rev 47551)
+++ scummvm/trunk/engines/sci/graphics/palette.cpp 2010-01-25 11:15:40 UTC (rev 47552)
@@ -171,6 +171,21 @@
return _amigaEGAtable[color];
}
+// Called from picture class, some amiga sci1 games set half of the palette
+void SciPalette::modifyAmigaPalette(byte *data) {
+ int16 curColor, curPos = 0;
+ byte byte1, byte2;
+ for (curColor = 0; curColor < 16; curColor++) {
+ byte1 = data[curPos++];
+ byte2 = data[curPos++];
+ _sysPalette.colors[curColor].r = (byte1 & 0x0F) * 0x11;
+ _sysPalette.colors[curColor].g = ((byte2 & 0xF0) >> 4) * 0x11;
+ _sysPalette.colors[curColor].b = (byte2 & 0x0F) * 0x11;
+ }
+ _screen->setPalette(&_sysPalette);
+ // TODO: when games do this it seems the EGAmapping isnt used anymore, at least the colors are wrong in any case
+}
+
void SciPalette::setEGA() {
int curColor;
byte color1, color2;
Modified: scummvm/trunk/engines/sci/graphics/palette.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/palette.h 2010-01-25 10:17:55 UTC (rev 47551)
+++ scummvm/trunk/engines/sci/graphics/palette.h 2010-01-25 11:15:40 UTC (rev 47552)
@@ -39,6 +39,7 @@
void createFromData(byte *data, Palette *paletteOut);
bool setAmiga();
int16 mapAmigaColor(int16 color);
+ void modifyAmigaPalette(byte *data);
void setEGA();
bool setFromResource(GuiResourceId resourceId, uint16 flag);
void set(Palette *sciPal, uint16 flag);
Modified: scummvm/trunk/engines/sci/graphics/picture.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/picture.cpp 2010-01-25 10:17:55 UTC (rev 47551)
+++ scummvm/trunk/engines/sci/graphics/picture.cpp 2010-01-25 11:15:40 UTC (rev 47552)
@@ -561,6 +561,7 @@
curPos += 256 + 4 + 768;
} else {
// Some sort of 32 byte amiga palette, TODO: Find out whats in there
+ _palette->modifyAmigaPalette(&data[curPos]);
curPos += 32;
}
} else {
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