aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra
diff options
context:
space:
mode:
authorJohannes Schickel2009-06-29 16:06:31 +0000
committerJohannes Schickel2009-06-29 16:06:31 +0000
commitbf81e432e14c48fa303fb2d36664ced2eca3e11b (patch)
tree24e730bf64f959ffe4f88e0e3baef68afab773de /engines/kyra
parentf7bbd359bb4edcd6cda67c3c3ee8f71fc63b546e (diff)
downloadscummvm-rg350-bf81e432e14c48fa303fb2d36664ced2eca3e11b.tar.gz
scummvm-rg350-bf81e432e14c48fa303fb2d36664ced2eca3e11b.tar.bz2
scummvm-rg350-bf81e432e14c48fa303fb2d36664ced2eca3e11b.zip
Change LoLEngine::generateBrightnessPalette to take Palette objects as parameters.
svn-id: r41944
Diffstat (limited to 'engines/kyra')
-rw-r--r--engines/kyra/lol.cpp18
-rw-r--r--engines/kyra/lol.h2
-rw-r--r--engines/kyra/scene_lol.cpp2
3 files changed, 11 insertions, 11 deletions
diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp
index e4002f7274..f687aaec4d 100644
--- a/engines/kyra/lol.cpp
+++ b/engines/kyra/lol.cpp
@@ -1673,14 +1673,14 @@ void LoLEngine::transformRegion(int x1, int y1, int x2, int y2, int w, int h, in
}
void LoLEngine::setPaletteBrightness(Palette &pal, int brightness, int modifier) {
- generateBrightnessPalette(pal.getData(), _screen->getPalette(1).getData(), brightness, modifier);
+ generateBrightnessPalette(pal, _screen->getPalette(1), brightness, modifier);
_screen->fadePalette(_screen->getPalette(1), 5, 0);
_screen->_fadeFlag = 0;
}
-void LoLEngine::generateBrightnessPalette(uint8 *src, uint8 *dst, int brightness, int modifier) {
- memcpy(dst, src, 0x300);
- _screen->loadSpecialColors(dst);
+void LoLEngine::generateBrightnessPalette(const Palette &src, Palette &dst, int brightness, int modifier) {
+ dst.copy(src);
+ _screen->loadSpecialColors(dst.getData());
brightness = (8 - brightness) << 5;
if (modifier >= 0 && modifier < 8 && (_flagsTable[31] & 0x08)) {
@@ -2211,11 +2211,11 @@ int LoLEngine::processMagicIce(int charNum, int spellLevel) {
tpal[i * 3 + 2] = 0x3f;
}
- generateBrightnessPalette(tpal.getData(), tpal.getData(), _brightness, _lampEffect);
- generateBrightnessPalette(swampCol.getData(), swampCol.getData(), _brightness, _lampEffect);
+ generateBrightnessPalette(tpal, tpal, _brightness, _lampEffect);
+ generateBrightnessPalette(swampCol, swampCol, _brightness, _lampEffect);
swampCol[0] = swampCol[1] = swampCol[2] = tpal[0] = tpal[1] = tpal[2] = 0;
- generateBrightnessPalette(_screen->getPalette(0).getData(), s.getData(), _brightness, _lampEffect);
+ generateBrightnessPalette(_screen->getPalette(0), s, _brightness, _lampEffect);
int sX = 112;
int sY = 0;
@@ -2304,7 +2304,7 @@ int LoLEngine::processMagicIce(int charNum, int spellLevel) {
enableSysTimer(2);
if (_currentLevel != 11)
- generateBrightnessPalette(_screen->getPalette(0).getData(), swampCol.getData(), _brightness, _lampEffect);
+ generateBrightnessPalette(_screen->getPalette(0), swampCol, _brightness, _lampEffect);
playSpellAnimation(0, 0, 0, 2, 0, 0, 0, tpal.getData(), swampCol.getData(), 40, 0);
@@ -3662,7 +3662,7 @@ void LoLEngine::restoreSwampPalette() {
for (int i = 1; i < 768; i++)
SWAP(s[i], d[i]);
- generateBrightnessPalette(d, d2, _brightness, _lampEffect);
+ generateBrightnessPalette(_screen->getPalette(0), _screen->getPalette(1), _brightness, _lampEffect);
_screen->loadSpecialColors(s);
_screen->loadSpecialColors(d2);
diff --git a/engines/kyra/lol.h b/engines/kyra/lol.h
index 1373d6bc94..c632b8558d 100644
--- a/engines/kyra/lol.h
+++ b/engines/kyra/lol.h
@@ -873,7 +873,7 @@ private:
void fadeText();
void transformRegion(int x1, int y1, int x2, int y2, int w, int h, int srcPage, int dstPage);
void setPaletteBrightness(Palette &pal, int brightness, int modifier);
- void generateBrightnessPalette(uint8 *src, uint8 *dst, int brightness, int modifier);
+ void generateBrightnessPalette(const Palette &src, Palette &dst, int brightness, int modifier);
void generateFlashPalette(uint8 *src, uint8 *dst, int colorFlags);
void updateSequenceBackgroundAnimations();
diff --git a/engines/kyra/scene_lol.cpp b/engines/kyra/scene_lol.cpp
index 56d1081d9a..a93cacc56e 100644
--- a/engines/kyra/scene_lol.cpp
+++ b/engines/kyra/scene_lol.cpp
@@ -438,7 +438,7 @@ void LoLEngine::loadLevelGraphics(const char *file, int specialColor, int weight
_screen->getLevelOverlay(7)[i] = i & 0xff;
_loadSuppFilesFlag = 0;
- generateBrightnessPalette(_screen->getPalette(0).getData(), _screen->getPalette(1).getData(), _brightness, _lampEffect);
+ generateBrightnessPalette(_screen->getPalette(0), _screen->getPalette(1), _brightness, _lampEffect);
char tname[13];
snprintf(tname, sizeof(tname), "LEVEL%.02d.TLC", _currentLevel);