aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Kiewitz2010-06-20 12:21:57 +0000
committerMartin Kiewitz2010-06-20 12:21:57 +0000
commit36ca2ce421d1dfbf6517d6ea008bbd97b9f6ccb8 (patch)
tree5baf89cd6d2cf9e2550698147c2ec24f257d31a5
parent81f64c9e3e8cacf106c36eff2f443f29ed1f50c3 (diff)
downloadscummvm-rg350-36ca2ce421d1dfbf6517d6ea008bbd97b9f6ccb8.tar.gz
scummvm-rg350-36ca2ce421d1dfbf6517d6ea008bbd97b9f6ccb8.tar.bz2
scummvm-rg350-36ca2ce421d1dfbf6517d6ea008bbd97b9f6ccb8.zip
SCI: some cleanup for kPalVary
svn-id: r50074
-rw-r--r--engines/sci/graphics/palette.cpp13
-rw-r--r--engines/sci/graphics/palette.h4
2 files changed, 9 insertions, 8 deletions
diff --git a/engines/sci/graphics/palette.cpp b/engines/sci/graphics/palette.cpp
index 8af6b597d6..fbf3433c29 100644
--- a/engines/sci/graphics/palette.cpp
+++ b/engines/sci/graphics/palette.cpp
@@ -464,14 +464,14 @@ void GfxPalette::kernelAssertPalette(GuiResourceId resourceId) {
// Saving/restoring
// need to save start and target-palette, when palVaryOn = true
-void GfxPalette::startPalVary(uint16 paletteId, uint16 ticks) {
- kernelSetFromResource(paletteId, true);
+void GfxPalette::startPalVary(GuiResourceId resourceId, uint16 ticks) {
+ kernelSetFromResource(resourceId, true);
return;
- if (_palVaryId >= 0) // another palvary is taking place, return
+ if (_palVaryResourceId >= 0) // another palvary is taking place, return
return;
- _palVaryId = paletteId;
+ _palVaryResourceId = resourceId;
_palVaryStart = g_system->getMillis();
_palVaryEnd = _palVaryStart + ticks * 1000 / 60;
g_sci->getTimerManager()->installTimerProc(&palVaryCallback, 1000000 / 60, this);
@@ -486,10 +486,11 @@ void GfxPalette::togglePalVary(bool pause) {
void GfxPalette::stopPalVary() {
g_sci->getTimerManager()->removeTimerProc(&palVaryCallback);
- _palVaryId = -1; // invalidate the target palette
// HACK: just set the target palette
- kernelSetFromResource(_palVaryId, true);
+ kernelSetFromResource(_palVaryResourceId, true);
+
+ _palVaryResourceId = -1; // invalidate the target palette
}
void GfxPalette::palVaryCallback(void *refCon) {
diff --git a/engines/sci/graphics/palette.h b/engines/sci/graphics/palette.h
index fead340090..265f36ad54 100644
--- a/engines/sci/graphics/palette.h
+++ b/engines/sci/graphics/palette.h
@@ -60,7 +60,7 @@ public:
void kernelAnimateSet();
void kernelAssertPalette(GuiResourceId resourceId);
- void startPalVary(uint16 paletteId, uint16 ticks);
+ void startPalVary(GuiResourceId resourceId, uint16 ticks);
void togglePalVary(bool pause);
void stopPalVary();
@@ -72,7 +72,7 @@ private:
GfxScreen *_screen;
ResourceManager *_resMan;
- int16 _palVaryId;
+ GuiResourceId _palVaryResourceId;
uint32 _palVaryStart;
uint32 _palVaryEnd;