mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-14 05:38:56 +00:00
SCI: support for amiga pictures that change the palette
svn-id: r47552
This commit is contained in:
parent
8d12d84609
commit
9f1962d006
@ -171,6 +171,21 @@ int16 SciPalette::mapAmigaColor(int16 color) {
|
||||
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;
|
||||
|
@ -39,6 +39,7 @@ public:
|
||||
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);
|
||||
|
@ -561,6 +561,7 @@ void SciGuiPicture::drawVectorData(byte *data, int dataSize) {
|
||||
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 {
|
||||
|
Loading…
Reference in New Issue
Block a user