aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2009-06-29 16:08:16 +0000
committerJohannes Schickel2009-06-29 16:08:16 +0000
commitc09985db2c8222feb2ab0aaa1aa2e562ce423141 (patch)
tree26e43408d41eda8c7ba3275848b9868c14831fc6
parent3bde2647b6ebc4c596c98f8550b3b432441235da (diff)
downloadscummvm-rg350-c09985db2c8222feb2ab0aaa1aa2e562ce423141.tar.gz
scummvm-rg350-c09985db2c8222feb2ab0aaa1aa2e562ce423141.tar.bz2
scummvm-rg350-c09985db2c8222feb2ab0aaa1aa2e562ce423141.zip
Change Screen_LoL::loadSpecialColors to take an Palette object as parameter.
svn-id: r41947
-rw-r--r--engines/kyra/lol.cpp6
-rw-r--r--engines/kyra/scene_lol.cpp2
-rw-r--r--engines/kyra/screen_lol.cpp8
-rw-r--r--engines/kyra/screen_lol.h2
-rw-r--r--engines/kyra/script_lol.cpp12
-rw-r--r--engines/kyra/script_tim.cpp2
6 files changed, 16 insertions, 16 deletions
diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp
index 312234905b..f9b0d03644 100644
--- a/engines/kyra/lol.cpp
+++ b/engines/kyra/lol.cpp
@@ -1680,7 +1680,7 @@ void LoLEngine::setPaletteBrightness(const Palette &srcPal, int brightness, int
void LoLEngine::generateBrightnessPalette(const Palette &src, Palette &dst, int brightness, int modifier) {
dst.copy(src);
- _screen->loadSpecialColors(dst.getData());
+ _screen->loadSpecialColors(dst);
brightness = (8 - brightness) << 5;
if (modifier >= 0 && modifier < 8 && (_flagsTable[31] & 0x08)) {
@@ -3663,8 +3663,8 @@ void LoLEngine::restoreSwampPalette() {
SWAP(s[i], d[i]);
generateBrightnessPalette(_screen->getPalette(0), _screen->getPalette(1), _brightness, _lampEffect);
- _screen->loadSpecialColors(s);
- _screen->loadSpecialColors(d2);
+ _screen->loadSpecialColors(_screen->getPalette(2));
+ _screen->loadSpecialColors(_screen->getPalette(1));
playSpellAnimation(0, 0, 0, 2, 0, 0, 0, s, d2, 40, 0);
}
diff --git a/engines/kyra/scene_lol.cpp b/engines/kyra/scene_lol.cpp
index a93cacc56e..945495517f 100644
--- a/engines/kyra/scene_lol.cpp
+++ b/engines/kyra/scene_lol.cpp
@@ -1434,7 +1434,7 @@ void LoLEngine::prepareSpecialScene(int fieldType, int hasDialogue, int suspendG
if (fadeFlag) {
_screen->getPalette(3).copy(_screen->getPalette(0), 128);
- _screen->loadSpecialColors(_screen->getPalette(3).getData());
+ _screen->loadSpecialColors(_screen->getPalette(3));
_screen->fadePalette(_screen->getPalette(3), 10);
_screen->_fadeFlag = 0;
}
diff --git a/engines/kyra/screen_lol.cpp b/engines/kyra/screen_lol.cpp
index cf72d9414a..a3c5cc6123 100644
--- a/engines/kyra/screen_lol.cpp
+++ b/engines/kyra/screen_lol.cpp
@@ -285,7 +285,7 @@ void Screen_LoL::fadeClearSceneWindow(int delay) {
Palette tpal(getPalette(0).getNumColors());
tpal.copy(getPalette(0), 128);
- loadSpecialColors(tpal.getData());
+ loadSpecialColors(tpal);
fadePalette(tpal, delay);
fillRect(112, 0, 288, 120, 0);
@@ -837,13 +837,13 @@ void Screen_LoL::fadeToBlack(int delay, const UpdateFunctor *upFunc) {
}
void Screen_LoL::fadeToPalette1(int delay) {
- loadSpecialColors(getPalette(1).getData());
+ loadSpecialColors(getPalette(1));
fadePalette(getPalette(1), delay);
_fadeFlag = 0;
}
-void Screen_LoL::loadSpecialColors(uint8 *destPalette) {
- memcpy(destPalette + 0x240, _screenPalette->getData() + 0x240, 12);
+void Screen_LoL::loadSpecialColors(Palette &dst) {
+ dst.copy(*_screenPalette, 192, 4);
}
void Screen_LoL::copyColor(int dstColorIndex, int srcColorIndex) {
diff --git a/engines/kyra/screen_lol.h b/engines/kyra/screen_lol.h
index 2867875218..1c94392b4e 100644
--- a/engines/kyra/screen_lol.h
+++ b/engines/kyra/screen_lol.h
@@ -70,7 +70,7 @@ public:
// palette stuff
void fadeToBlack(int delay=0x54, const UpdateFunctor *upFunc = 0);
void fadeToPalette1(int delay);
- void loadSpecialColors(uint8 *destPalette);
+ void loadSpecialColors(Palette &dst);
void copyColor(int dstColorIndex, int srcColorIndex);
bool fadeColor(int dstColorIndex, int srcColorIndex, uint32 elapsedTime, uint32 targetTime);
bool fadePaletteStep(uint8 *pal1, uint8 *pal2, uint32 elapsedTime, uint32 targetTime);
diff --git a/engines/kyra/script_lol.cpp b/engines/kyra/script_lol.cpp
index df238742d6..109621f2a0 100644
--- a/engines/kyra/script_lol.cpp
+++ b/engines/kyra/script_lol.cpp
@@ -865,7 +865,7 @@ int LoLEngine::olol_fadeClearSceneWindow(EMCState *script) {
int LoLEngine::olol_fadeSequencePalette(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_fadeSequencePalette(%p)", (const void *)script);
_screen->getPalette(3).copy(_screen->getPalette(0), 128);
- _screen->loadSpecialColors(_screen->getPalette(3).getData());
+ _screen->loadSpecialColors(_screen->getPalette(3));
_screen->fadePalette(_screen->getPalette(3), 10);
_screen->_fadeFlag = 0;
return 1;
@@ -2106,8 +2106,8 @@ int LoLEngine::olol_paletteFlash(EMCState *script) {
uint8 ovl[256];
generateFlashPalette(p1.getData(), p2.getData(), stackPos(0));
- _screen->loadSpecialColors(p1.getData());
- _screen->loadSpecialColors(p2.getData());
+ _screen->loadSpecialColors(p1);
+ _screen->loadSpecialColors(p2);
if (_smoothScrollModeNormal) {
for (int i = 0; i < 256; i++)
@@ -2401,7 +2401,7 @@ int LoLEngine::tlol_fadeClearWindow(const TIM *tim, const uint16 *param) {
case 1:
_screen->getPalette(3).copy(_screen->getPalette(0), 128);
- _screen->loadSpecialColors(_screen->getPalette(3).getData());
+ _screen->loadSpecialColors(_screen->getPalette(3));
_screen->fadePalette(_screen->getPalette(3), 10);
_screen->_fadeFlag = 0;
break;
@@ -2411,7 +2411,7 @@ int LoLEngine::tlol_fadeClearWindow(const TIM *tim, const uint16 *param) {
break;
case 3:
- _screen->loadSpecialColors(_screen->getPalette(3).getData());
+ _screen->loadSpecialColors(_screen->getPalette(3));
_screen->fadePalette(_screen->getPalette(3), 10);
_screen->_fadeFlag = 0;
break;
@@ -2425,7 +2425,7 @@ int LoLEngine::tlol_fadeClearWindow(const TIM *tim, const uint16 *param) {
break;
case 5:
- _screen->loadSpecialColors(_screen->getPalette(3).getData());
+ _screen->loadSpecialColors(_screen->getPalette(3));
_screen->fadePalette(_screen->getPalette(1), 10);
_screen->_fadeFlag = 0;
break;
diff --git a/engines/kyra/script_tim.cpp b/engines/kyra/script_tim.cpp
index b7fd3c3bd4..424a62aaf8 100644
--- a/engines/kyra/script_tim.cpp
+++ b/engines/kyra/script_tim.cpp
@@ -970,7 +970,7 @@ TIMInterpreter::Animation *TIMInterpreter_LoL::initAnimStruct(int index, const c
anim->wsa->displayFrame(0, 0, x, y, 0, 0, 0);
if (wsaFlags & 3) {
- _screen->loadSpecialColors(_screen->getPalette(3).getData());
+ _screen->loadSpecialColors(_screen->getPalette(3));
_screen->fadePalette(_screen->getPalette(3), 10);
_screen->_fadeFlag = 0;
}