Change LoLEngine::generateFlashPalette to take Palette objects as parameters.

svn-id: r41948
This commit is contained in:
Johannes Schickel 2009-06-29 16:08:28 +00:00
parent c09985db2c
commit 3b7f11d4cc
3 changed files with 8 additions and 13 deletions

View File

@ -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() {

View File

@ -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;

View File

@ -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);