diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/console.cpp | 2 | ||||
-rw-r--r-- | engines/sci/engine/kgraphics.cpp | 4 | ||||
-rw-r--r-- | engines/sci/graphics/gui.cpp | 6 | ||||
-rw-r--r-- | engines/sci/graphics/gui.h | 2 | ||||
-rw-r--r-- | engines/sci/graphics/palette.cpp | 16 | ||||
-rw-r--r-- | engines/sci/graphics/palette.h | 6 | ||||
-rw-r--r-- | engines/sci/graphics/picture.cpp | 6 | ||||
-rw-r--r-- | engines/sci/graphics/portrait.cpp | 2 | ||||
-rw-r--r-- | engines/sci/graphics/view.cpp | 4 |
9 files changed, 24 insertions, 24 deletions
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp index 7c45365a19..3451ee01d3 100644 --- a/engines/sci/console.cpp +++ b/engines/sci/console.cpp @@ -994,7 +994,7 @@ bool Console::cmdSetPalette(int argc, const char **argv) { uint16 resourceId = atoi(argv[1]); - _vm->_gamestate->_gui->paletteSet(resourceId, 2); + _vm->_gamestate->_gui->paletteSet(resourceId, true); return true; } diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp index 474b12d0d5..d58809f578 100644 --- a/engines/sci/engine/kgraphics.cpp +++ b/engines/sci/engine/kgraphics.cpp @@ -524,8 +524,8 @@ reg_t kPalette(EngineState *s, int argc, reg_t *argv) { case 1: // Set resource palette if (argc==3) { GuiResourceId resourceId = argv[1].toUint16(); - uint16 flags = argv[2].toUint16(); - s->_gui->paletteSet(resourceId, flags); + bool force = argv[2].toUint16() == 2 ? true : false; + s->_gui->paletteSet(resourceId, force); } break; case 2: { // Set palette-flag(s) diff --git a/engines/sci/graphics/gui.cpp b/engines/sci/graphics/gui.cpp index 388598d5ba..31716979a9 100644 --- a/engines/sci/graphics/gui.cpp +++ b/engines/sci/graphics/gui.cpp @@ -566,11 +566,11 @@ int16 SciGui::picNotValid(int16 newPicNotValid) { } -void SciGui::paletteSet(GuiResourceId resourceId, uint16 flags) { +void SciGui::paletteSet(GuiResourceId resourceId, bool force) { // we are also called on EGA games as well, this doesnt make sense. doing this would actually break the system EGA palette if (!_s->resMan->isVGA()) return; - _palette->setFromResource(resourceId, flags); + _palette->setFromResource(resourceId, force); } void SciGui::paletteSetFlag(uint16 fromColor, uint16 toColor, uint16 flag) { @@ -890,7 +890,7 @@ void SciGui::stopPalVary() { _palVaryId = -1; // invalidate the target palette // HACK: just set the target palette - _palette->setFromResource(_palVaryId, 2); + _palette->setFromResource(_palVaryId, true); } void SciGui::palVaryCallback(void *refCon) { diff --git a/engines/sci/graphics/gui.h b/engines/sci/graphics/gui.h index 840dedb5a0..56905619f8 100644 --- a/engines/sci/graphics/gui.h +++ b/engines/sci/graphics/gui.h @@ -110,7 +110,7 @@ public: virtual int16 picNotValid(int16 newPicNotValid); - virtual void paletteSet(GuiResourceId resourceNo, uint16 flags); + virtual void paletteSet(GuiResourceId resourceNo, bool force); virtual void paletteSetFlag(uint16 fromColor, uint16 toColor, uint16 flag); virtual void paletteUnsetFlag(uint16 fromColor, uint16 toColor, uint16 flag); virtual int16 paletteFind(uint16 r, uint16 g, uint16 b); diff --git a/engines/sci/graphics/palette.cpp b/engines/sci/graphics/palette.cpp index feb26ffee8..e6169ffb2f 100644 --- a/engines/sci/graphics/palette.cpp +++ b/engines/sci/graphics/palette.cpp @@ -59,7 +59,7 @@ SciPalette::SciPalette(ResourceManager *resMan, Screen *screen, bool autoSetPale else if (_resMan->isAmiga32color()) setAmiga(); else - setFromResource(999, 2); + setFromResource(999, true); } } @@ -185,29 +185,29 @@ void SciPalette::setEGA() { setOnScreen(); } -bool SciPalette::setFromResource(GuiResourceId resourceId, uint16 flag) { +bool SciPalette::setFromResource(GuiResourceId resourceId, bool force) { Resource *palResource = _resMan->findResource(ResourceId(kResourceTypePalette, resourceId), 0); Palette palette; if (palResource) { createFromData(palResource->data, &palette); - set(&palette, 2); + set(&palette, true); return true; } return false; } -void SciPalette::set(Palette *sciPal, uint16 flag, bool forceRealMerge) { +void SciPalette::set(Palette *sciPal, bool force, bool forceRealMerge) { uint32 systime = _sysPalette.timestamp; - if (flag == 2 || sciPal->timestamp != systime) { - merge(sciPal, &_sysPalette, flag, forceRealMerge); + if (force || sciPal->timestamp != systime) { + merge(sciPal, &_sysPalette, force, forceRealMerge); sciPal->timestamp = _sysPalette.timestamp; if (_screen->_picNotValid == 0 && systime != _sysPalette.timestamp) setOnScreen(); } } -void SciPalette::merge(Palette *pFrom, Palette *pTo, uint16 flag, bool forceRealMerge) { +void SciPalette::merge(Palette *pFrom, Palette *pTo, bool force, bool forceRealMerge) { uint16 res; int i,j; @@ -228,7 +228,7 @@ void SciPalette::merge(Palette *pFrom, Palette *pTo, uint16 flag, bool forceReal if (!pFrom->colors[i].used)// color is not used - so skip it continue; // forced palette merging or dest color is not used yet or bit 1 of new color is set - if (flag == 2 || (!pTo->colors[i].used) || (pFrom->colors[i].used & 2)) { + if (force || (!pTo->colors[i].used) || (pFrom->colors[i].used & 2)) { pTo->colors[i].used = pFrom->colors[i].used; pTo->colors[i].r = pFrom->colors[i].r; pTo->colors[i].g = pFrom->colors[i].g; diff --git a/engines/sci/graphics/palette.h b/engines/sci/graphics/palette.h index 5fd9e13d36..b2d007c6b3 100644 --- a/engines/sci/graphics/palette.h +++ b/engines/sci/graphics/palette.h @@ -40,9 +40,9 @@ public: bool setAmiga(); void modifyAmigaPalette(byte *data); void setEGA(); - bool setFromResource(GuiResourceId resourceId, uint16 flag); - void set(Palette *sciPal, uint16 flag, bool forceRealMerge = false); - void merge(Palette *pFrom, Palette *pTo, uint16 flag, bool forceRealMerge); + bool setFromResource(GuiResourceId resourceId, bool force); + void set(Palette *sciPal, bool force, bool forceRealMerge = false); + void merge(Palette *pFrom, Palette *pTo, bool force, bool forceRealMerge); uint16 matchColor(Palette *pPal, byte r, byte g, byte b); void getSys(Palette *pal); diff --git a/engines/sci/graphics/picture.cpp b/engines/sci/graphics/picture.cpp index 165141e8b0..d599277dd4 100644 --- a/engines/sci/graphics/picture.cpp +++ b/engines/sci/graphics/picture.cpp @@ -102,7 +102,7 @@ void SciGuiPicture::drawSci11Vga() { // Create palette and set it _palette->createFromData(inbuffer + palette_data_ptr, &palette); - _palette->set(&palette, 2); + _palette->set(&palette, true); // display Cel-data if (has_cel) { @@ -130,7 +130,7 @@ void SciGuiPicture::drawSci32Vga() { // Create palette and set it _palette->createFromData(inbuffer + palette_data_ptr, &palette); - _palette->set(&palette, 2); + _palette->set(&palette, true); while (celCount > 0) { cel_RlePos = READ_LE_UINT16(inbuffer + cel_headerPos + 24); @@ -570,7 +570,7 @@ void SciGuiPicture::drawVectorData(byte *data, int dataSize) { palette.colors[i].used = data[curPos++]; palette.colors[i].r = data[curPos++]; palette.colors[i].g = data[curPos++]; palette.colors[i].b = data[curPos++]; } - _palette->set(&palette, 2); + _palette->set(&palette, true); } break; case PIC_OPX_VGA_EMBEDDED_VIEW: // draw cel diff --git a/engines/sci/graphics/portrait.cpp b/engines/sci/graphics/portrait.cpp index 6026520ee4..808d2dc6aa 100644 --- a/engines/sci/graphics/portrait.cpp +++ b/engines/sci/graphics/portrait.cpp @@ -140,7 +140,7 @@ void Portrait::doit(Common::Point position, uint16 resourceId, uint16 noun, uint uint syncOffset = 0; // Set the portrait palette - _palette->set(&_portraitPalette, 1, true); + _palette->set(&_portraitPalette, false, true); // Draw base bitmap drawBitmap(0); diff --git a/engines/sci/graphics/view.cpp b/engines/sci/graphics/view.cpp index df355bae3c..8694a389c6 100644 --- a/engines/sci/graphics/view.cpp +++ b/engines/sci/graphics/view.cpp @@ -493,7 +493,7 @@ void View::draw(Common::Rect rect, Common::Rect clipRect, Common::Rect clipRectT if (_embeddedPal) { // Merge view palette in... - _palette->set(&_viewPalette, 1); + _palette->set(&_viewPalette, false); } width = MIN(clipRect.width(), celWidth); @@ -545,7 +545,7 @@ void View::drawScaled(Common::Rect rect, Common::Rect clipRect, Common::Rect cli if (_embeddedPal) { // Merge view palette in... - _palette->set(&_viewPalette, 1); + _palette->set(&_viewPalette, false); } scaledWidth = (celInfo->width * scaleX) >> 7; |