From dc304dbde22772eb52644e05f58407f2fa60b6e5 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 9 Sep 2008 11:20:34 +0000 Subject: Cleanup. Simplified converse() svn-id: r34460 --- engines/drascula/palette.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'engines/drascula/palette.cpp') diff --git a/engines/drascula/palette.cpp b/engines/drascula/palette.cpp index 6a93f21e55..3dd2a779e8 100644 --- a/engines/drascula/palette.cpp +++ b/engines/drascula/palette.cpp @@ -27,6 +27,17 @@ namespace Drascula { +const char colorTable[][3] = { + { 0, 0, 0 }, { 0x10, 0x3E, 0x28 }, + { 0, 0, 0 }, // unused + { 0x16, 0x3F, 0x16 }, { 0x09, 0x3F, 0x12 }, + { 0x3F, 0x3F, 0x15 }, + { 0, 0, 0 }, // unused + { 0x38, 0, 0 }, { 0x3F, 0x27, 0x0B }, + { 0x2A, 0, 0x2A }, { 0x30, 0x30, 0x30 }, + { 98, 91, 100 } +}; + void DrasculaEngine::setRGB(byte *pal, int colorCount) { int x, cnt = 0; @@ -70,17 +81,6 @@ void DrasculaEngine::setPalette(byte *PalBuf) { void DrasculaEngine::color_abc(int cl) { _color = cl; - char colorTable[][3] = { - { 0, 0, 0 }, { 0x10, 0x3E, 0x28 }, - { 0, 0, 0 }, // unused - { 0x16, 0x3F, 0x16 }, { 0x09, 0x3F, 0x12 }, - { 0x3F, 0x3F, 0x15 }, - { 0, 0, 0 }, // unused - { 0x38, 0, 0 }, { 0x3F, 0x27, 0x0B }, - { 0x2A, 0, 0x2A }, { 0x30, 0x30, 0x30 }, - { 98, 91, 100 } - }; - for (int i = 0; i <= 2; i++) gamePalette[254][i] = colorTable[cl][i]; -- cgit v1.2.3 From f5fecc864f389d061cfadaf93d868e96ca6d4e72 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Wed, 10 Sep 2008 12:03:42 +0000 Subject: Merged all the methods to assign and set default palettes svn-id: r34479 --- engines/drascula/palette.cpp | 47 ++++---------------------------------------- 1 file changed, 4 insertions(+), 43 deletions(-) (limited to 'engines/drascula/palette.cpp') diff --git a/engines/drascula/palette.cpp b/engines/drascula/palette.cpp index 3dd2a779e8..ba174c9237 100644 --- a/engines/drascula/palette.cpp +++ b/engines/drascula/palette.cpp @@ -127,64 +127,25 @@ void DrasculaEngine::fadeFromBlack(int fadeSpeed) { } } -void DrasculaEngine::assignDefaultPalette() { +void DrasculaEngine::assignPalette(DacPalette256 pal) { int color, component; for (color = 235; color < 253; color++) for (component = 0; component < 3; component++) - defaultPalette[color][component] = gamePalette[color][component]; + pal[color][component] = gamePalette[color][component]; } -void DrasculaEngine::assignBrightPalette() { - int color, component; - - for (color = 235; color < 253; color++) { - for (component = 0; component < 3; component++) - brightPalette[color][component] = gamePalette[color][component]; - } -} - -void DrasculaEngine::assignDarkPalette() { - int color, component; - - for (color = 235; color < 253; color++) { - for (component = 0; component < 3; component++) - darkPalette[color][component] = gamePalette[color][component]; - } -} - -void DrasculaEngine::setDefaultPalette() { +void DrasculaEngine::setDefaultPalette(DacPalette256 pal) { int color, component; for (color = 235; color < 253; color++) { for (component = 0; component < 3; component++) { - gamePalette[color][component] = defaultPalette[color][component]; + gamePalette[color][component] = pal[color][component]; } } setPalette((byte *)&gamePalette); } -void DrasculaEngine::setBrightPalette() { - int color, component; - - for (color = 235; color < 253; color++) { - for (component = 0; component < 3; component++) - gamePalette[color][component] = brightPalette[color][component]; - } - - setPalette((byte *)&gamePalette); -} - -void DrasculaEngine::setDarkPalette() { - int color, component; - - for (color = 235; color < 253; color++ ) - for (component = 0; component < 3; component++) - gamePalette[color][component] = darkPalette[color][component]; - - setPalette((byte *)&gamePalette); -} - void DrasculaEngine::setPaletteBase(int darkness) { signed char fade; unsigned int color, component; -- cgit v1.2.3