diff options
author | Johannes Schickel | 2009-06-25 19:59:06 +0000 |
---|---|---|
committer | Johannes Schickel | 2009-06-25 19:59:06 +0000 |
commit | 5d4e7b540cd5180e7190b80f2245c744797b20b8 (patch) | |
tree | 4b40a89784414605f52cc5d104221eee6e20cd65 /engines | |
parent | 2b87ffc31ebb81954f36769333e2754e5062655d (diff) | |
download | scummvm-rg350-5d4e7b540cd5180e7190b80f2245c744797b20b8.tar.gz scummvm-rg350-5d4e7b540cd5180e7190b80f2245c744797b20b8.tar.bz2 scummvm-rg350-5d4e7b540cd5180e7190b80f2245c744797b20b8.zip |
Change Screen_LoL genereta overlay functionallity to accept a Palette object as source.
svn-id: r41884
Diffstat (limited to 'engines')
-rw-r--r-- | engines/kyra/lol.cpp | 4 | ||||
-rw-r--r-- | engines/kyra/scene_lol.cpp | 4 | ||||
-rw-r--r-- | engines/kyra/screen_lol.cpp | 10 | ||||
-rw-r--r-- | engines/kyra/screen_lol.h | 4 |
4 files changed, 11 insertions, 11 deletions
diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp index 4ac8a43ae0..4dee693a55 100644 --- a/engines/kyra/lol.cpp +++ b/engines/kyra/lol.cpp @@ -2067,7 +2067,7 @@ int LoLEngine::processMagicHealSelectTarget() { int LoLEngine::processMagicHeal(int charNum, int spellLevel) { if (!_healOverlay) { _healOverlay = new uint8[256]; - _screen->generateGrayOverlay(_screen->getPalette(1).getData(), _healOverlay, 52, 22, 20, 0, 256, true); + _screen->generateGrayOverlay(_screen->getPalette(1), _healOverlay, 52, 22, 20, 0, 256, true); } const uint8 *healShpFrames = 0; @@ -3849,7 +3849,7 @@ void LoLEngine::displayAutomap() { for (int i = 0; i < 109; i++) _automapShapes[i] = _screen->getPtrToShape(shp, i + 11); - _screen->generateGrayOverlay(_screen->getPalette(3).getData(), _mapOverlay, 52, 0, 0, 0, 256, false); + _screen->generateGrayOverlay(_screen->getPalette(3), _mapOverlay, 52, 0, 0, 0, 256, false); _screen->loadFont(Screen::FID_9_FNT, "FONT9PN.FNT"); _screen->loadFont(Screen::FID_6_FNT, "FONT6PN.FNT"); diff --git a/engines/kyra/scene_lol.cpp b/engines/kyra/scene_lol.cpp index e5231e56aa..50fb562a90 100644 --- a/engines/kyra/scene_lol.cpp +++ b/engines/kyra/scene_lol.cpp @@ -86,7 +86,7 @@ void LoLEngine::loadLevel(int index) { addLevelItems(); deleteMonstersFromBlock(_currentBlock); - _screen->generateGrayOverlay(_screen->getPalette(0).getData(), _screen->_grayOverlay, 32, 16, 0, 0, 128, true); + _screen->generateGrayOverlay(_screen->getPalette(0), _screen->_grayOverlay, 32, 16, 0, 0, 128, true); _sceneDefaultUpdate = 0; if (_screen->_fadeFlag == 3) @@ -423,7 +423,7 @@ void LoLEngine::loadLevelGraphics(const char *file, int specialColor, int weight for (int i = 0; i < 7; i++) { weight = 100 - (i * _lastSpecialColorWeight); weight = (weight > 0) ? (weight * 255) / 100 : 0; - _screen->generateLevelOverlay(_screen->getPalette(0).getData(), _screen->getLevelOverlay(i), _lastSpecialColor, weight); + _screen->generateLevelOverlay(_screen->getPalette(0), _screen->getLevelOverlay(i), _lastSpecialColor, weight); for (int ii = 0; ii < 128; ii++) { if (_screen->getLevelOverlay(i)[ii] == 255) diff --git a/engines/kyra/screen_lol.cpp b/engines/kyra/screen_lol.cpp index e75745d51c..a717a10931 100644 --- a/engines/kyra/screen_lol.cpp +++ b/engines/kyra/screen_lol.cpp @@ -144,7 +144,7 @@ void Screen_LoL::fprintStringIntro(const char *format, int x, int y, uint8 c1, u printText(buffer, x, y, c1, c2); } -void Screen_LoL::generateGrayOverlay(const uint8 *srcPal, uint8 *grayOverlay, int factor, int addR, int addG, int addB, int lastColor, bool skipSpecialColors) { +void Screen_LoL::generateGrayOverlay(const Palette &srcPal, uint8 *grayOverlay, int factor, int addR, int addG, int addB, int lastColor, bool skipSpecialColors) { Palette tmpPal(lastColor); for (int i = 0; i != lastColor; i++) { @@ -157,11 +157,11 @@ void Screen_LoL::generateGrayOverlay(const uint8 *srcPal, uint8 *grayOverlay, in } for (int i = 0; i < lastColor; i++) - grayOverlay[i] = findLeastDifferentColor(tmpPal.getData() + 3 * i, srcPal, lastColor, skipSpecialColors); + grayOverlay[i] = findLeastDifferentColor(tmpPal.getData() + 3 * i, srcPal.getData(), lastColor, skipSpecialColors); } -uint8 *Screen_LoL::generateLevelOverlay(const uint8 *srcPal, uint8 *ovl, int opColor, int weight) { - if (!srcPal || !ovl) +uint8 *Screen_LoL::generateLevelOverlay(const Palette &srcPal, uint8 *ovl, int opColor, int weight) { + if (!ovl) return ovl; if (weight > 255) @@ -186,7 +186,7 @@ uint8 *Screen_LoL::generateLevelOverlay(const uint8 *srcPal, uint8 *ovl, int opC int m = 0x7fff; int ii = 127; int x = 1; - const uint8 *s = srcPal + 3; + const uint8 *s = srcPal.getData() + 3; do { if (i == x) { diff --git a/engines/kyra/screen_lol.h b/engines/kyra/screen_lol.h index 278118ea1c..2867875218 100644 --- a/engines/kyra/screen_lol.h +++ b/engines/kyra/screen_lol.h @@ -76,8 +76,8 @@ public: bool fadePaletteStep(uint8 *pal1, uint8 *pal2, uint32 elapsedTime, uint32 targetTime); uint8 *generateFadeTable(uint8 *dst, uint8 *src1, uint8 *src2, int numTabs); - void generateGrayOverlay(const uint8 *srcPal, uint8 *grayOverlay, int factor, int addR, int addG, int addB, int lastColor, bool skipSpecialColors); - uint8 *generateLevelOverlay(const uint8 *srcPal, uint8 *ovl, int opColor, int weight); + void generateGrayOverlay(const Palette &Pal, uint8 *grayOverlay, int factor, int addR, int addG, int addB, int lastColor, bool skipSpecialColors); + uint8 *generateLevelOverlay(const Palette &Pal, uint8 *ovl, int opColor, int weight); uint8 *getLevelOverlay(int index) { return _levelOverlays[index]; } void copyBlockAndApplyOverlay(int page1, int x1, int y1, int page2, int x2, int y2, int w, int h, int dim, uint8 *ovl); |