mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-22 18:02:05 +00:00
SCI: some cleanup for kPalVary
svn-id: r50074
This commit is contained in:
parent
81f64c9e3e
commit
36ca2ce421
@ -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) {
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user