diff options
author | Martin Kiewitz | 2010-06-20 17:08:39 +0000 |
---|---|---|
committer | Martin Kiewitz | 2010-06-20 17:08:39 +0000 |
commit | 7ecff0a300e2e8a809818472160121743971e17a (patch) | |
tree | c870fb48c105d6da3dee79231e7d7da5460bf59d /engines/sci/graphics | |
parent | e8262d989e31742f554d37c962254c6ac37a1a7f (diff) | |
download | scummvm-rg350-7ecff0a300e2e8a809818472160121743971e17a.tar.gz scummvm-rg350-7ecff0a300e2e8a809818472160121743971e17a.tar.bz2 scummvm-rg350-7ecff0a300e2e8a809818472160121743971e17a.zip |
SCI: implementing kPalVary(2)
svn-id: r50085
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r-- | engines/sci/graphics/palette.cpp | 16 | ||||
-rw-r--r-- | engines/sci/graphics/palette.h | 5 |
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); |