aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/gui
diff options
context:
space:
mode:
authorMartin Kiewitz2009-10-20 16:11:31 +0000
committerMartin Kiewitz2009-10-20 16:11:31 +0000
commit361977e7ed074ab0a099360ef58a0bf5a8b5182a (patch)
tree28656df38580226fcb90b4ab1601c630c9dca13f /engines/sci/gui
parent55dd109653c56c2847a06f9acb2fc3bf3834f730 (diff)
downloadscummvm-rg350-361977e7ed074ab0a099360ef58a0bf5a8b5182a.tar.gz
scummvm-rg350-361977e7ed074ab0a099360ef58a0bf5a8b5182a.tar.bz2
scummvm-rg350-361977e7ed074ab0a099360ef58a0bf5a8b5182a.zip
SCI/newgui: kPalette cleanup, preparing for sq5 paletteAnimate support
svn-id: r45273
Diffstat (limited to 'engines/sci/gui')
-rw-r--r--engines/sci/gui/gui.cpp12
-rw-r--r--engines/sci/gui/gui.h8
-rw-r--r--engines/sci/gui/gui_palette.cpp6
-rw-r--r--engines/sci/gui/gui_palette.h4
4 files changed, 15 insertions, 15 deletions
diff --git a/engines/sci/gui/gui.cpp b/engines/sci/gui/gui.cpp
index 24b87f68b9..a4d4dac4e1 100644
--- a/engines/sci/gui/gui.cpp
+++ b/engines/sci/gui/gui.cpp
@@ -457,20 +457,20 @@ int16 SciGui::picNotValid(int16 newPicNotValid) {
}
-void SciGui::paletteSet(int resourceNo, int flags) {
- _palette->setFromResource(resourceNo, flags);
+void SciGui::paletteSet(GuiResourceId resourceId, uint16 flags) {
+ _palette->setFromResource(resourceId, flags);
}
-int16 SciGui::paletteFind(int r, int g, int b) {
+int16 SciGui::paletteFind(uint16 r, uint16 g, uint16 b) {
return _palette->matchColor(&_palette->_sysPalette, r, g, b) & 0xFF;
}
-void SciGui::paletteSetIntensity(int fromColor, int toColor, int intensity, bool setPalette) {
+void SciGui::paletteSetIntensity(uint16 fromColor, uint16 toColor, uint16 intensity, bool setPalette) {
_palette->setIntensity(fromColor, toColor, intensity, setPalette);
}
-void SciGui::paletteAnimate(int fromColor, int toColor, int speed) {
- // kAnimate gets called for Amiga as well, but for colors above 32, so it doesnt make sense
+void SciGui::paletteAnimate(uint16 fromColor, uint16 toColor, uint16 speed) {
+ // we are also called on Amiga as well, but for colors above 32, so it doesnt make sense
if (!_s->resMan->isVGA())
return;
diff --git a/engines/sci/gui/gui.h b/engines/sci/gui/gui.h
index b0101c7781..697edf976d 100644
--- a/engines/sci/gui/gui.h
+++ b/engines/sci/gui/gui.h
@@ -100,10 +100,10 @@ public:
virtual int16 picNotValid(int16 newPicNotValid);
- 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 paletteAnimate(int fromColor, int toColor, int speed);
+ virtual void paletteSet(GuiResourceId resourceNo, uint16 flags);
+ virtual int16 paletteFind(uint16 r, uint16 g, uint16 b);
+ virtual void paletteSetIntensity(uint16 fromColor, uint16 toColor, uint16 intensity, bool setPalette);
+ virtual void paletteAnimate(uint16 fromColor, uint16 toColor, uint16 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 7b84beb17c..83b94e2085 100644
--- a/engines/sci/gui/gui_palette.cpp
+++ b/engines/sci/gui/gui_palette.cpp
@@ -170,8 +170,8 @@ void SciGuiPalette::setEGA() {
setOnScreen();
}
-bool SciGuiPalette::setFromResource(int16 resourceNo, int16 flag) {
- Resource *palResource = _resMan->findResource(ResourceId(kResourceTypePalette, resourceNo), 0);
+bool SciGuiPalette::setFromResource(GuiResourceId resourceId, uint16 flag) {
+ Resource *palResource = _resMan->findResource(ResourceId(kResourceTypePalette, resourceId), 0);
GuiPalette palette;
if (palResource) {
@@ -182,7 +182,7 @@ bool SciGuiPalette::setFromResource(int16 resourceNo, int16 flag) {
return false;
}
-void SciGuiPalette::set(GuiPalette *sciPal, int16 flag) {
+void SciGuiPalette::set(GuiPalette *sciPal, uint16 flag) {
uint32 systime = _sysPalette.timestamp;
if (flag == 2 || sciPal->timestamp != systime) {
merge(sciPal, &_sysPalette, flag);
diff --git a/engines/sci/gui/gui_palette.h b/engines/sci/gui/gui_palette.h
index 1bfc3aa3e4..9313d7e169 100644
--- a/engines/sci/gui/gui_palette.h
+++ b/engines/sci/gui/gui_palette.h
@@ -39,8 +39,8 @@ public:
void createFromData(byte *data, GuiPalette *paletteOut);
bool setAmiga();
void setEGA();
- bool setFromResource(int16 resourceNo, int16 flag);
- void set(GuiPalette *sciPal, int16 flag);
+ bool setFromResource(GuiResourceId resourceId, uint16 flag);
+ void set(GuiPalette *sciPal, uint16 flag);
void merge(GuiPalette *pFrom, GuiPalette *pTo, uint16 flag);
uint16 matchColor(GuiPalette *pPal, byte r, byte g, byte b);
void getSys(GuiPalette *pal);