diff options
author | Johannes Schickel | 2009-06-29 16:49:53 +0000 |
---|---|---|
committer | Johannes Schickel | 2009-06-29 16:49:53 +0000 |
commit | 179a822b93b3bd4c5ff462441fdf1ca53f672b9d (patch) | |
tree | af5e665a2bd9804775693a75d8aa488bb3817ae5 /engines/kyra | |
parent | 07cdbd273db8887778a0b15048679ee78b2d72ce (diff) | |
download | scummvm-rg350-179a822b93b3bd4c5ff462441fdf1ca53f672b9d.tar.gz scummvm-rg350-179a822b93b3bd4c5ff462441fdf1ca53f672b9d.tar.bz2 scummvm-rg350-179a822b93b3bd4c5ff462441fdf1ca53f672b9d.zip |
Adapted various code parts to use Palette::fill.
svn-id: r41953
Diffstat (limited to 'engines/kyra')
-rw-r--r-- | engines/kyra/kyra_mr.cpp | 4 | ||||
-rw-r--r-- | engines/kyra/lol.cpp | 22 | ||||
-rw-r--r-- | engines/kyra/scene_hof.cpp | 4 | ||||
-rw-r--r-- | engines/kyra/scene_mr.cpp | 4 | ||||
-rw-r--r-- | engines/kyra/sequences_hof.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/sequences_lol.cpp | 2 |
6 files changed, 19 insertions, 19 deletions
diff --git a/engines/kyra/kyra_mr.cpp b/engines/kyra/kyra_mr.cpp index b7e5608e94..2a69c49679 100644 --- a/engines/kyra/kyra_mr.cpp +++ b/engines/kyra/kyra_mr.cpp @@ -329,7 +329,7 @@ Common::Error KyraEngine_MR::go() { void KyraEngine_MR::initMainMenu() { _menuAnim = new WSAMovie_v2(this); _menuAnim->open("REVENGE.WSA", 1, &_screen->getPalette(0)); - memset(_screen->getPalette(0).getData(), 0, 3); + _screen->getPalette(0).fill(0, 1, 0); _menu = new MainMenu(this); MainMenu::StaticData data = { @@ -391,7 +391,7 @@ void KyraEngine_MR::playVQA(const char *name) { _screen->showMouse(); // Taken from original, it used '1' here too - memset(_screen->getPalette(0).getData(), 1, 768); + _screen->getPalette(0).fill(0, 256, 1); _screen->setScreenPalette(_screen->getPalette(0)); _screen->clearPage(0); _screen->copyPalette(0, 1); diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp index 8f4bfaa87a..020e1ea3ea 100644 --- a/engines/kyra/lol.cpp +++ b/engines/kyra/lol.cpp @@ -778,17 +778,17 @@ int LoLEngine::mainMenu() { void LoLEngine::startup() { _screen->clearPage(0); - _screen->loadBitmap("PLAYFLD.CPS", 3, 3, &_screen->getPalette(0)); - - uint8 *tmpPal = new uint8[0x300]; - memcpy(tmpPal, _screen->getPalette(0).getData(), 0x300); - memset(_screen->getPalette(0).getData(), 0x3f, 0x180); - _screen->getPalette(0).copy(tmpPal, 1, 1); - memset(_screen->getPalette(0).getData() + 0x240, 0x3f, 12); - _screen->generateOverlay(_screen->getPalette(0), _screen->_paletteOverlay1, 1, 96); - _screen->generateOverlay(_screen->getPalette(0), _screen->_paletteOverlay2, 144, 65); - _screen->getPalette(0).copy(tmpPal, 0, 256); - delete[] tmpPal; + + Palette &pal = _screen->getPalette(0); + _screen->loadBitmap("PLAYFLD.CPS", 3, 3, &pal); + + _screen->copyPalette(1, 0); + pal.fill(0, 1, 0x3F); + pal.fill(2, 126, 0x3F); + pal.fill(192, 4, 0x3F); + _screen->generateOverlay(pal, _screen->_paletteOverlay1, 1, 96); + _screen->generateOverlay(pal, _screen->_paletteOverlay2, 144, 65); + _screen->copyPalette(0, 1); _screen->getPalette(1).clear(); _screen->getPalette(2).clear(); diff --git a/engines/kyra/scene_hof.cpp b/engines/kyra/scene_hof.cpp index e6f1336989..38346ab604 100644 --- a/engines/kyra/scene_hof.cpp +++ b/engines/kyra/scene_hof.cpp @@ -403,7 +403,7 @@ void KyraEngine_HoF::loadScenePal() { strcat(filename, ".COL"); _screen->loadBitmap(filename, 3, 3, 0); _screen->getPalette(1).copy(_screen->getCPagePtr(3), 0, 128); - memset(_screen->getPalette(1).getData(), 0, 3); + _screen->getPalette(1).fill(0, 1, 0); memcpy(_scenePal, _screen->getCPagePtr(3)+336, 432); } @@ -669,7 +669,7 @@ void KyraEngine_HoF::initSceneScreen(int unk1) { } if (_noScriptEnter) { - memset(_screen->getPalette(0).getData(), 0, 384); + _screen->getPalette(0).fill(0, 128, 0); _screen->setScreenPalette(_screen->getPalette(0)); } diff --git a/engines/kyra/scene_mr.cpp b/engines/kyra/scene_mr.cpp index 193b4bd81a..75dd3e1826 100644 --- a/engines/kyra/scene_mr.cpp +++ b/engines/kyra/scene_mr.cpp @@ -334,7 +334,7 @@ void KyraEngine_MR::loadScenePal() { _screen->loadBitmap(filename, 3, 3, 0); _screen->getPalette(2).copy(_screen->getCPagePtr(3), 0, 144); - memset(_screen->getPalette(2).getData(), 0, 3); + _screen->getPalette(2).fill(0, 1, 0); for (int i = 144; i <= 167; ++i) { uint8 *palette = _screen->getPalette(2).getData() + i * 3; @@ -607,7 +607,7 @@ void KyraEngine_MR::initSceneScreen(int unk1) { } if (_noScriptEnter) { - memset(_screen->getPalette(0).getData(), 0, 432); + _screen->getPalette(0).fill(0, 144, 0); if (!_wasPlayingVQA) _screen->setScreenPalette(_screen->getPalette(0)); } diff --git a/engines/kyra/sequences_hof.cpp b/engines/kyra/sequences_hof.cpp index 652bcb2b4a..90b2fdd580 100644 --- a/engines/kyra/sequences_hof.cpp +++ b/engines/kyra/sequences_hof.cpp @@ -2062,7 +2062,7 @@ void KyraEngine_HoF::seq_sequenceCommand(int command) { case 1: seq_playTalkText(_rnd.getRandomBit()); - memset(_screen->getPalette(0).getData(), 0x3F, 0x300); + _screen->getPalette(0).fill(0, 256, 0x3F); _screen->fadePalette(_screen->getPalette(0), 16); _screen->copyPalette(1, 0); diff --git a/engines/kyra/sequences_lol.cpp b/engines/kyra/sequences_lol.cpp index 871ea316b1..beea129f66 100644 --- a/engines/kyra/sequences_lol.cpp +++ b/engines/kyra/sequences_lol.cpp @@ -855,7 +855,7 @@ void LoLEngine::showCredits() { _screen->_charWidth = 0; _screen->loadBitmap("ROOM.CPS", 2, 2, &_screen->getPalette(0)); - memset(_screen->getPalette(0).getData() + 764, 0, 3); + _screen->getPalette(0).fill(255, 1, 0); _screen->fadeToBlack(30); _screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0, Screen::CR_NO_P_CHECK); |