aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r--engines/sci/graphics/palette.cpp16
-rw-r--r--engines/sci/graphics/palette.h5
2 files changed, 16 insertions, 5 deletions
diff --git a/engines/sci/graphics/palette.cpp b/engines/sci/graphics/palette.cpp
index 812bbfb234..f4222fabdd 100644
--- a/engines/sci/graphics/palette.cpp
+++ b/engines/sci/graphics/palette.cpp
@@ -488,11 +488,11 @@ void GfxPalette::palVaryInit() {
_palVaryDirection = 0;
}
-void GfxPalette::kernelPalVaryInit(GuiResourceId resourceId, uint16 ticks, uint16 stepStop, int16 direction) {
+bool GfxPalette::kernelPalVaryInit(GuiResourceId resourceId, uint16 ticks, uint16 stepStop, int16 direction) {
//kernelSetFromResource(resourceId, true);
//return;
if (_palVaryResourceId != -1) // another palvary is taking place, return
- return;
+ return false;
_palVaryResourceId = resourceId;
Resource *palResource = _resMan->findResource(ResourceId(kResourceTypePalette, resourceId), 0);
@@ -513,10 +513,20 @@ void GfxPalette::kernelPalVaryInit(GuiResourceId resourceId, uint16 ticks, uint1
}
// Call signal increase every [ticks]
g_sci->getTimerManager()->installTimerProc(&palVaryCallback, 1000000 / 60 * ticks, this);
+ return true;
}
+ return false;
}
-void GfxPalette::kernelPalVaryToggle(bool pause) {
+int16 GfxPalette::kernelPalVaryGetCurrentStep() {
+ if (_palVaryDirection >= 0)
+ return _palVaryStep;
+ return -_palVaryStep;
+}
+
+void GfxPalette::kernelPalVaryPause(bool pause) {
+ if (_palVaryResourceId == -1)
+ return;
// this call is actually counting states, so calling this 3 times with true will require calling it later
// 3 times with false to actually remove pause
if (pause) {
diff --git a/engines/sci/graphics/palette.h b/engines/sci/graphics/palette.h
index 861684ecb4..7ea231f13b 100644
--- a/engines/sci/graphics/palette.h
+++ b/engines/sci/graphics/palette.h
@@ -62,8 +62,9 @@ public:
void kernelAnimateSet();
void kernelAssertPalette(GuiResourceId resourceId);
- void kernelPalVaryInit(GuiResourceId resourceId, uint16 ticks, uint16 stopPercentage, int16 direction);
- void kernelPalVaryToggle(bool pause);
+ bool kernelPalVaryInit(GuiResourceId resourceId, uint16 ticks, uint16 stopPercentage, int16 direction);
+ int16 kernelPalVaryGetCurrentStep();
+ void kernelPalVaryPause(bool pause);
void kernelPalVaryDeinit();
void palVaryUpdate();
void palVaryProcess(int signal, bool setPalette);