aboutsummaryrefslogtreecommitdiff
path: root/engines/drascula/palette.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/drascula/palette.cpp')
-rw-r--r--engines/drascula/palette.cpp69
1 files changed, 15 insertions, 54 deletions
diff --git a/engines/drascula/palette.cpp b/engines/drascula/palette.cpp
index 6a93f21e55..ba174c9237 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];
@@ -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];
-}
-
-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];
- }
+ pal[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;