aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMartin Kiewitz2009-10-14 18:35:15 +0000
committerMartin Kiewitz2009-10-14 18:35:15 +0000
commit3c5c9541545af978f035d2db544bcba48a48ece0 (patch)
tree87c8579d7e3a324cf8ad3e7b21a551c5022bb0d9 /engines
parent8e58d5ef80bf8a0e33a7ef698881ab20362f332a (diff)
downloadscummvm-rg350-3c5c9541545af978f035d2db544bcba48a48ece0.tar.gz
scummvm-rg350-3c5c9541545af978f035d2db544bcba48a48ece0.tar.bz2
scummvm-rg350-3c5c9541545af978f035d2db544bcba48a48ece0.zip
SCI/newgui: changed kPalette (setIntensity) to behave differently (seems we had it wrong) also changed nonsense clipping
svn-id: r45090
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/engine/kgraphics.cpp7
-rw-r--r--engines/sci/gui/gui.cpp7
-rw-r--r--engines/sci/gui/gui.h2
-rw-r--r--engines/sci/gui/gui_palette.cpp5
-rw-r--r--engines/sci/gui/gui_palette.h2
-rw-r--r--engines/sci/gui32/gui32.cpp2
-rw-r--r--engines/sci/gui32/gui32.h2
7 files changed, 12 insertions, 15 deletions
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index 3261f46263..d10a779bdb 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -581,12 +581,11 @@ reg_t kPalette(EngineState *s, int argc, reg_t *argv) {
break;
case 4: { // Set palette intensity
if (argc >= 4) {
- int fromColor = CLIP<int>(1, 255, argv[1].toUint16());
- int toColor = CLIP<int>(1, 255, argv[2].toUint16());
+ int fromColor = CLIP<int>(argv[1].toUint16(), 1, 255);
+ int toColor = CLIP<int>(argv[2].toUint16(), 1, 255);
int intensity = argv[3].toUint16();
- bool setPalette = (argc < 5) ? true : (argv[5].isNull()) ? true : false;
- s->_gui->paletteSetIntensity(fromColor, toColor, intensity, setPalette);
+ s->_gui->paletteSetIntensity(fromColor, toColor, intensity);
}
break;
}
diff --git a/engines/sci/gui/gui.cpp b/engines/sci/gui/gui.cpp
index a39b08c0bd..97236e1206 100644
--- a/engines/sci/gui/gui.cpp
+++ b/engines/sci/gui/gui.cpp
@@ -470,11 +470,8 @@ int16 SciGui::paletteFind(int r, int g, int b) {
return _palette->matchColor(&_palette->_sysPalette, r, g, b) & 0xFF;
}
-void SciGui::paletteSetIntensity(int fromColor, int toColor, int intensity, bool setPalette) {
- _palette->setIntensity(fromColor, toColor, intensity, &_palette->_sysPalette);
- if (setPalette) {
- _palette->setOnScreen();
- }
+void SciGui::paletteSetIntensity(int fromColor, int toColor, int intensity) {
+ _palette->setIntensity(fromColor, toColor, intensity);
}
void SciGui::paletteAnimate(int fromColor, int toColor, int speed) {
diff --git a/engines/sci/gui/gui.h b/engines/sci/gui/gui.h
index 3073aeed38..c74f860120 100644
--- a/engines/sci/gui/gui.h
+++ b/engines/sci/gui/gui.h
@@ -102,7 +102,7 @@ public:
virtual void paletteSet(int resourceNo, int flags);
virtual int16 paletteFind(int r, int g, int b);
- virtual void paletteSetIntensity(int fromColor, int toColor, int intensity, bool setPalette);
+ virtual void paletteSetIntensity(int fromColor, int toColor, int intensity);
virtual void paletteAnimate(int fromColor, int toColor, int speed);
virtual void shakeScreen(uint16 shakeCount, uint16 directions);
diff --git a/engines/sci/gui/gui_palette.cpp b/engines/sci/gui/gui_palette.cpp
index d30c499d4c..6cd7a432cd 100644
--- a/engines/sci/gui/gui_palette.cpp
+++ b/engines/sci/gui/gui_palette.cpp
@@ -275,8 +275,9 @@ void SciGuiPalette::setOnScreen() {
_screen->setPalette(&_sysPalette);
}
-void SciGuiPalette::setIntensity(int fromColor, int toColor, int intensity, GuiPalette *destPalette) {
- memset(destPalette->intensity + fromColor, intensity, toColor - fromColor);
+void SciGuiPalette::setIntensity(int fromColor, int toColor, int intensity) {
+ memset(&_sysPalette.intensity + fromColor, intensity, toColor - fromColor);
+ setOnScreen();
}
void SciGuiPalette::animate(byte fromColor, byte toColor, int speed) {
diff --git a/engines/sci/gui/gui_palette.h b/engines/sci/gui/gui_palette.h
index 038ced7e2b..8cd0a5695b 100644
--- a/engines/sci/gui/gui_palette.h
+++ b/engines/sci/gui/gui_palette.h
@@ -47,7 +47,7 @@ public:
void setOnScreen();
- void setIntensity(int fromColor, int toColor, int intensity, GuiPalette *destPalette);
+ void setIntensity(int fromColor, int toColor, int intensity);
void animate(byte fromColor, byte toColor, int speed);
GuiPalette _sysPalette;
diff --git a/engines/sci/gui32/gui32.cpp b/engines/sci/gui32/gui32.cpp
index 26f6120d52..261d4fca98 100644
--- a/engines/sci/gui32/gui32.cpp
+++ b/engines/sci/gui32/gui32.cpp
@@ -1372,7 +1372,7 @@ int16 SciGui32::paletteFind(int r, int g, int b) {
return bestindex;
}
-void SciGui32::paletteSetIntensity(int fromColor, int toColor, int intensity, bool setPalette) {
+void SciGui32::paletteSetIntensity(int fromColor, int toColor, int intensity) {
#if 0
_s->gfx_state->gfxResMan->setPaletteIntensity(fromColor, toColor, intensity);
#endif
diff --git a/engines/sci/gui32/gui32.h b/engines/sci/gui32/gui32.h
index 11b60b172c..e529addc1e 100644
--- a/engines/sci/gui32/gui32.h
+++ b/engines/sci/gui32/gui32.h
@@ -80,7 +80,7 @@ public:
void paletteSet(int resourceNo, int flags);
int16 paletteFind(int r, int g, int b);
- void paletteSetIntensity(int fromColor, int toColor, int intensity, bool setPalette);
+ void paletteSetIntensity(int fromColor, int toColor, int intensity);
void paletteAnimate(int fromColor, int toColor, int speed);
void shakeScreen(uint16 shakeCount, uint16 directions);