aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics
diff options
context:
space:
mode:
authorMartin Kiewitz2010-01-26 22:45:52 +0000
committerMartin Kiewitz2010-01-26 22:45:52 +0000
commite0d05a482ce93e029888ef388dfb1b90b438f2ee (patch)
tree2de753ab399d0ae63c985d53ee256dd1f1429042 /engines/sci/graphics
parent935ded3615bda21dc7e100b0e1f4b40793c518d4 (diff)
downloadscummvm-rg350-e0d05a482ce93e029888ef388dfb1b90b438f2ee.tar.gz
scummvm-rg350-e0d05a482ce93e029888ef388dfb1b90b438f2ee.tar.bz2
scummvm-rg350-e0d05a482ce93e029888ef388dfb1b90b438f2ee.zip
SCI: changed flags (uint16) to force (bool) for set/merge palette methods
svn-id: r47578
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r--engines/sci/graphics/gui.cpp6
-rw-r--r--engines/sci/graphics/gui.h2
-rw-r--r--engines/sci/graphics/palette.cpp16
-rw-r--r--engines/sci/graphics/palette.h6
-rw-r--r--engines/sci/graphics/picture.cpp6
-rw-r--r--engines/sci/graphics/portrait.cpp2
-rw-r--r--engines/sci/graphics/view.cpp4
7 files changed, 21 insertions, 21 deletions
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;