diff options
author | Martin Kiewitz | 2009-10-05 20:02:29 +0000 |
---|---|---|
committer | Martin Kiewitz | 2009-10-05 20:02:29 +0000 |
commit | e77f997e33bc4d7fb4b28c399c4762d9f7b2d5e3 (patch) | |
tree | e38420e54bc9ad071e646ba69bfe8635ba20176d | |
parent | 16580e53bf71ad99bb7f41186c85981d1c728147 (diff) | |
download | scummvm-rg350-e77f997e33bc4d7fb4b28c399c4762d9f7b2d5e3.tar.gz scummvm-rg350-e77f997e33bc4d7fb4b28c399c4762d9f7b2d5e3.tar.bz2 scummvm-rg350-e77f997e33bc4d7fb4b28c399c4762d9f7b2d5e3.zip |
SCI/newgui: EGA picture drawing is now using EGA palette
svn-id: r44675
-rw-r--r-- | engines/sci/gui/gui_picture.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/engines/sci/gui/gui_picture.cpp b/engines/sci/gui/gui_picture.cpp index 4013d6f58e..212065ac02 100644 --- a/engines/sci/gui/gui_picture.cpp +++ b/engines/sci/gui/gui_picture.cpp @@ -295,8 +295,8 @@ void SciGuiPicture::drawVectorData(byte *data, int dataSize) { byte pic_op; byte pic_color = 0, pic_priority = 0x0F, pic_control = 0x0F; int16 x = 0, y = 0, oldx, oldy; - byte EGApalette = 0; byte EGApalettes[PIC_EGAPALETTE_TOTALSIZE] = {0}; + byte *EGApalette = &EGApalettes[_EGApaletteNo]; bool EGAmapping = false; int curPos = 0; uint16 size; @@ -314,6 +314,9 @@ void SciGuiPicture::drawVectorData(byte *data, int dataSize) { if (getSciVersion() >= SCI_VERSION_1_EGA) sci1 = true; + if (!_s->resMan->isVGA()) + EGAmapping = true; + for (i = 0; i < PIC_EGAPALETTE_TOTALSIZE; i += PIC_EGAPALETTE_SIZE) memcpy(&EGApalettes[i], &vector_defaultEGApalette, sizeof(vector_defaultEGApalette)); @@ -323,7 +326,7 @@ void SciGuiPicture::drawVectorData(byte *data, int dataSize) { switch (pic_op = data[curPos++]) { case PIC_OP_SET_COLOR: byte = data[curPos++]; - pic_color = EGAmapping ? EGApalettes[byte] : byte; + pic_color = EGAmapping ? EGApalette[byte] : byte; break; case PIC_OP_DISABLE_VISUAL: pic_color = 0xFF; @@ -466,7 +469,7 @@ void SciGuiPicture::drawVectorData(byte *data, int dataSize) { break; case PIC_OPX_SCI0_SET_PALETTE: byte = data[curPos++]; - if (EGApalette >= PIC_EGAPALETTE_COUNT) { + if (byte >= PIC_EGAPALETTE_COUNT) { error("picture trying to write to invalid palette %d", EGApalette); } byte *= PIC_EGAPALETTE_SIZE; |