diff options
author | Martin Kiewitz | 2010-01-25 11:15:40 +0000 |
---|---|---|
committer | Martin Kiewitz | 2010-01-25 11:15:40 +0000 |
commit | 9f1962d00681b0571c476d94b0c70b2151b27d7f (patch) | |
tree | 911fe62c19fc24e93679a62bf0acbb2dd49dcb20 /engines/sci | |
parent | 8d12d846098797df7904e9d128a14d3c05942d83 (diff) | |
download | scummvm-rg350-9f1962d00681b0571c476d94b0c70b2151b27d7f.tar.gz scummvm-rg350-9f1962d00681b0571c476d94b0c70b2151b27d7f.tar.bz2 scummvm-rg350-9f1962d00681b0571c476d94b0c70b2151b27d7f.zip |
SCI: support for amiga pictures that change the palette
svn-id: r47552
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/graphics/palette.cpp | 15 | ||||
-rw-r--r-- | engines/sci/graphics/palette.h | 1 | ||||
-rw-r--r-- | engines/sci/graphics/picture.cpp | 1 |
3 files changed, 17 insertions, 0 deletions
diff --git a/engines/sci/graphics/palette.cpp b/engines/sci/graphics/palette.cpp index b7233b5412..617fc5bbf8 100644 --- a/engines/sci/graphics/palette.cpp +++ b/engines/sci/graphics/palette.cpp @@ -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; diff --git a/engines/sci/graphics/palette.h b/engines/sci/graphics/palette.h index 55a904ff18..67a0beb3b0 100644 --- a/engines/sci/graphics/palette.h +++ b/engines/sci/graphics/palette.h @@ -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); diff --git a/engines/sci/graphics/picture.cpp b/engines/sci/graphics/picture.cpp index de35aebbf4..e5dc8110d6 100644 --- a/engines/sci/graphics/picture.cpp +++ b/engines/sci/graphics/picture.cpp @@ -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 { |