aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/screen_lol.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2009-06-22 02:34:35 +0000
committerJohannes Schickel2009-06-22 02:34:35 +0000
commitb448d506b89209d79bc153b6b0759ad926fa8794 (patch)
tree2424f442ef037a1a088c57d934b7b5a033efe890 /engines/kyra/screen_lol.cpp
parent3424dfda98c59543ec1bea464723dca2221a6965 (diff)
downloadscummvm-rg350-b448d506b89209d79bc153b6b0759ad926fa8794.tar.gz
scummvm-rg350-b448d506b89209d79bc153b6b0759ad926fa8794.tar.bz2
scummvm-rg350-b448d506b89209d79bc153b6b0759ad926fa8794.zip
Start refactoring palette handling into new class "Palette".
svn-id: r41739
Diffstat (limited to 'engines/kyra/screen_lol.cpp')
-rw-r--r--engines/kyra/screen_lol.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/engines/kyra/screen_lol.cpp b/engines/kyra/screen_lol.cpp
index 2556464394..a7e3c3a1bb 100644
--- a/engines/kyra/screen_lol.cpp
+++ b/engines/kyra/screen_lol.cpp
@@ -838,18 +838,18 @@ void Screen_LoL::fadeToBlack(int delay, const UpdateFunctor *upFunc) {
}
void Screen_LoL::fadeToPalette1(int delay) {
- loadSpecialColors(_palettes[0]);
- fadePalette(_palettes[0], delay);
+ loadSpecialColors(getPalette(1));
+ fadePalette(getPalette(1), delay);
_fadeFlag = 0;
}
void Screen_LoL::loadSpecialColors(uint8 *destPalette) {
- memcpy(destPalette + 0x240, _screenPalette + 0x240, 12);
+ memcpy(destPalette + 0x240, _screenPalette->getData() + 0x240, 12);
}
void Screen_LoL::copyColor(int dstColorIndex, int srcColorIndex) {
- uint8 *s = _screenPalette + srcColorIndex * 3;
- uint8 *d = _screenPalette + dstColorIndex * 3;
+ uint8 *s = _screenPalette->getData() + srcColorIndex * 3;
+ uint8 *d = _screenPalette->getData() + dstColorIndex * 3;
memcpy(d, s, 3);
uint8 ci[4];
@@ -862,8 +862,8 @@ void Screen_LoL::copyColor(int dstColorIndex, int srcColorIndex) {
}
bool Screen_LoL::fadeColor(int dstColorIndex, int srcColorIndex, uint32 elapsedTime, uint32 targetTime) {
- uint8 *dst = _screenPalette + 3 * dstColorIndex;
- uint8 *src = _screenPalette + 3 * srcColorIndex;
+ uint8 *dst = _screenPalette->getData() + 3 * dstColorIndex;
+ uint8 *src = _screenPalette->getData() + 3 * srcColorIndex;
uint8 *p = getPalette(1) + 3 * dstColorIndex;
bool res = false;
@@ -898,7 +898,7 @@ bool Screen_LoL::fadeColor(int dstColorIndex, int srcColorIndex, uint32 elapsedT
}
uint8 tpal[768];
- memcpy(tpal, _screenPalette, 768);
+ memcpy(tpal, _screenPalette->getData(), 768);
memcpy(tpal + dstColorIndex * 3, tmpPalEntry, 3);
setScreenPalette(tpal);
updateScreen();
@@ -908,7 +908,7 @@ bool Screen_LoL::fadeColor(int dstColorIndex, int srcColorIndex, uint32 elapsedT
bool Screen_LoL::fadePaletteStep(uint8 *pal1, uint8 *pal2, uint32 elapsedTime, uint32 targetTime) {
uint8 tpal[768];
- uint8 *p1 = _palettes[0];
+ uint8 *p1 = getPalette(1);
bool res = false;
for (int i = 0; i < 768; i++) {
@@ -936,7 +936,7 @@ bool Screen_LoL::fadePaletteStep(uint8 *pal1, uint8 *pal2, uint32 elapsedTime, u
uint8 *Screen_LoL::generateFadeTable(uint8 *dst, uint8 *src1, uint8 *src2, int numTabs) {
if (!src1)
- src1 = _screenPalette;
+ src1 = _screenPalette->getData();
uint8 *p1 = dst;
uint8 *p2 = src1;