diff options
author | Johannes Schickel | 2009-06-29 16:08:28 +0000 |
---|---|---|
committer | Johannes Schickel | 2009-06-29 16:08:28 +0000 |
commit | 3b7f11d4cce9f72fc451fec74559dfc44352c76a (patch) | |
tree | f502b12ad2cc5e9a70df3da70d6aa81f7ee9a6e9 /engines | |
parent | c09985db2c8222feb2ab0aaa1aa2e562ce423141 (diff) | |
download | scummvm-rg350-3b7f11d4cce9f72fc451fec74559dfc44352c76a.tar.gz scummvm-rg350-3b7f11d4cce9f72fc451fec74559dfc44352c76a.tar.bz2 scummvm-rg350-3b7f11d4cce9f72fc451fec74559dfc44352c76a.zip |
Change LoLEngine::generateFlashPalette to take Palette objects as parameters.
svn-id: r41948
Diffstat (limited to 'engines')
-rw-r--r-- | engines/kyra/lol.cpp | 17 | ||||
-rw-r--r-- | engines/kyra/lol.h | 2 | ||||
-rw-r--r-- | engines/kyra/script_lol.cpp | 2 |
3 files changed, 8 insertions, 13 deletions
diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp index f9b0d03644..8f4bfaa87a 100644 --- a/engines/kyra/lol.cpp +++ b/engines/kyra/lol.cpp @@ -1695,26 +1695,21 @@ void LoLEngine::generateBrightnessPalette(const Palette &src, Palette &dst, int } } -void LoLEngine::generateFlashPalette(uint8 *src, uint8 *dst, int colorFlags) { - if (!src || !dst) - return; - - memcpy(dst, src, 6); - - uint8 *s = src + 6; - uint8 *d = dst + 6; +void LoLEngine::generateFlashPalette(const Palette &src, Palette &dst, int colorFlags) { + dst.copy(src, 0, 2); for (int i = 2; i < 128; i++) { for (int ii = 0; ii < 3; ii++) { - uint8 t = *s++ & 0x3f; + uint8 t = src[i * 3 + ii] & 0x3f; if (colorFlags & (1 << ii)) t += ((0x3f - t) >> 1); else t -= (t >> 1); - *d++ = t; + dst[i * 3 + ii] = t; } } - memcpy(d, s, 384); + + dst.copy(src, 128); } void LoLEngine::updateSequenceBackgroundAnimations() { diff --git a/engines/kyra/lol.h b/engines/kyra/lol.h index a9eb971fbd..12000c31fa 100644 --- a/engines/kyra/lol.h +++ b/engines/kyra/lol.h @@ -874,7 +874,7 @@ private: void transformRegion(int x1, int y1, int x2, int y2, int w, int h, int srcPage, int dstPage); void setPaletteBrightness(const Palette &srcPal, int brightness, int modifier); void generateBrightnessPalette(const Palette &src, Palette &dst, int brightness, int modifier); - void generateFlashPalette(uint8 *src, uint8 *dst, int colorFlags); + void generateFlashPalette(const Palette &src, Palette &dst, int colorFlags); void updateSequenceBackgroundAnimations(); bool _dialogueField; diff --git a/engines/kyra/script_lol.cpp b/engines/kyra/script_lol.cpp index 109621f2a0..a606419722 100644 --- a/engines/kyra/script_lol.cpp +++ b/engines/kyra/script_lol.cpp @@ -2105,7 +2105,7 @@ int LoLEngine::olol_paletteFlash(EMCState *script) { Palette &p2 = _screen->getPalette(3); uint8 ovl[256]; - generateFlashPalette(p1.getData(), p2.getData(), stackPos(0)); + generateFlashPalette(p1, p2, stackPos(0)); _screen->loadSpecialColors(p1); _screen->loadSpecialColors(p2); |