diff options
author | uruk | 2014-07-29 10:38:05 +0200 |
---|---|---|
committer | uruk | 2014-07-29 10:38:05 +0200 |
commit | d4e14253c45ef9e747a7b1e5082a959fa61c0eb5 (patch) | |
tree | e245f8bf591cfc57f14ba75a91396c1713d166ea | |
parent | 5016e09acf8884a9a06bc7871b564d3070875222 (diff) | |
download | scummvm-rg350-d4e14253c45ef9e747a7b1e5082a959fa61c0eb5.tar.gz scummvm-rg350-d4e14253c45ef9e747a7b1e5082a959fa61c0eb5.tar.bz2 scummvm-rg350-d4e14253c45ef9e747a7b1e5082a959fa61c0eb5.zip |
CGE2: Implement snFlash().
-rw-r--r-- | engines/cge2/cge2.h | 2 | ||||
-rw-r--r-- | engines/cge2/snail.cpp | 23 |
2 files changed, 22 insertions, 3 deletions
diff --git a/engines/cge2/cge2.h b/engines/cge2/cge2.h index 7fd5431244..d947f01636 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 b6ae9dbdb0..3fab991a69 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) { |