aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/gui
diff options
context:
space:
mode:
authorMartin Kiewitz2009-10-14 19:39:07 +0000
committerMartin Kiewitz2009-10-14 19:39:07 +0000
commitbc49c6e63ed0ba4eb7f8b372872505665aec2383 (patch)
treeca679738a831c7602bf0c5ac21853f081a1a3584 /engines/sci/gui
parent3c5c9541545af978f035d2db544bcba48a48ece0 (diff)
downloadscummvm-rg350-bc49c6e63ed0ba4eb7f8b372872505665aec2383.tar.gz
scummvm-rg350-bc49c6e63ed0ba4eb7f8b372872505665aec2383.tar.bz2
scummvm-rg350-bc49c6e63ed0ba4eb7f8b372872505665aec2383.zip
SCI/newgui: kPalette / setIntensity / reimplemented setPalette optional parameter, fixed memory corruption in setIntensity
svn-id: r45091
Diffstat (limited to 'engines/sci/gui')
-rw-r--r--engines/sci/gui/gui.cpp4
-rw-r--r--engines/sci/gui/gui.h2
-rw-r--r--engines/sci/gui/gui_palette.cpp7
-rw-r--r--engines/sci/gui/gui_palette.h2
4 files changed, 8 insertions, 7 deletions
diff --git a/engines/sci/gui/gui.cpp b/engines/sci/gui/gui.cpp
index 97236e1206..dcf3d5f706 100644
--- a/engines/sci/gui/gui.cpp
+++ b/engines/sci/gui/gui.cpp
@@ -470,8 +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) {
- _palette->setIntensity(fromColor, toColor, intensity);
+void SciGui::paletteSetIntensity(int fromColor, int toColor, int intensity, bool setPalette) {
+ _palette->setIntensity(fromColor, toColor, intensity, setPalette);
}
void SciGui::paletteAnimate(int fromColor, int toColor, int speed) {
diff --git a/engines/sci/gui/gui.h b/engines/sci/gui/gui.h
index c74f860120..3073aeed38 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);
+ virtual void paletteSetIntensity(int fromColor, int toColor, int intensity, bool setPalette);
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 6cd7a432cd..f413f66766 100644
--- a/engines/sci/gui/gui_palette.cpp
+++ b/engines/sci/gui/gui_palette.cpp
@@ -275,9 +275,10 @@ void SciGuiPalette::setOnScreen() {
_screen->setPalette(&_sysPalette);
}
-void SciGuiPalette::setIntensity(int fromColor, int toColor, int intensity) {
- memset(&_sysPalette.intensity + fromColor, intensity, toColor - fromColor);
- setOnScreen();
+void SciGuiPalette::setIntensity(int fromColor, int toColor, int intensity, bool setPalette) {
+ memset(&_sysPalette.intensity[0] + fromColor, intensity, toColor - fromColor);
+ if (setPalette)
+ 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 8cd0a5695b..fa050c03bf 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);
+ void setIntensity(int fromColor, int toColor, int intensity, bool setPalette);
void animate(byte fromColor, byte toColor, int speed);
GuiPalette _sysPalette;