diff --git a/engines/cge2/cge2.h b/engines/cge2/cge2.h index 7fd54312445..d947f01636d 100644 --- a/engines/cge2/cge2.h +++ b/engines/cge2/cge2.h @@ -254,7 +254,7 @@ public: void snRmMTake(Sprite *spr); void snRmFTake(Sprite *spr); void snSetRef(Sprite *spr, int val); - void snFlash(int val); + void snFlash(bool on); void snCycle(int cnt); void snWalk(Sprite *spr, int val); void snReach(Sprite *spr, int val); diff --git a/engines/cge2/snail.cpp b/engines/cge2/snail.cpp index b6ae9dbdb0d..3fab991a695 100644 --- a/engines/cge2/snail.cpp +++ b/engines/cge2/snail.cpp @@ -555,8 +555,27 @@ void CGE2Engine::snSetRef(Sprite *spr, int val) { } } -void CGE2Engine::snFlash(int val) { - warning("STUB: CGE2Engine::snFlash()"); +void CGE2Engine::snFlash(bool on) { + if (on) { + Dac *pal = (Dac *)malloc(sizeof(Dac) * kPalCount); + if (pal) { + memcpy(pal, _vga->_sysPal, kPalSize); + for (int i = 0; i < kPalCount; i++) { + register int c; + c = pal[i]._r << 1; + pal[i]._r = (c < 64) ? c : 63; + c = pal[i]._g << 1; + pal[i]._g = (c < 64) ? c : 63; + c = pal[i]._b << 1; + pal[i]._b = (c < 64) ? c : 63; + } + _vga->setColors(pal, 64); + } + + free(pal); + } else + _vga->setColors(_vga->_sysPal, 64); + _dark = false; } void CGE2Engine::snCycle(int cnt) {