diff options
author | Johannes Schickel | 2009-06-25 23:04:08 +0000 |
---|---|---|
committer | Johannes Schickel | 2009-06-25 23:04:08 +0000 |
commit | fc0d0e2323e1a1bdd8219345af1cdaf1e879d7f4 (patch) | |
tree | 35242e348ecc2524f8fd1ef0c22b6e771f1f4ad9 /engines | |
parent | fb06b9217075c1c209f8ce3e928300dc2c6c6392 (diff) | |
download | scummvm-rg350-fc0d0e2323e1a1bdd8219345af1cdaf1e879d7f4.tar.gz scummvm-rg350-fc0d0e2323e1a1bdd8219345af1cdaf1e879d7f4.tar.bz2 scummvm-rg350-fc0d0e2323e1a1bdd8219345af1cdaf1e879d7f4.zip |
Cleanup palette setup.
svn-id: r41890
Diffstat (limited to 'engines')
-rw-r--r-- | engines/kyra/screen.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp index b742758391..44b3f53d1a 100644 --- a/engines/kyra/screen.cpp +++ b/engines/kyra/screen.cpp @@ -125,22 +125,18 @@ bool Screen::init() { memset(_palettes, 0, sizeof(_palettes)); - _screenPalette = new Palette(256); + const int paletteCount = (_vm->gameFlags().platform == Common::kPlatformAmiga) ? 12 : 4; + const int numColors = (_vm->gameFlags().platform == Common::kPlatformAmiga) ? 32 : 256; + + _screenPalette = new Palette(numColors); assert(_screenPalette); - if (_vm->gameFlags().platform == Common::kPlatformAmiga) { - for (int i = 0; i < 12; ++i) { - _palettes[i] = new Palette(32); - assert(_palettes[i]); - } - } else { - for (int i = 0; i < 4; ++i) { - _palettes[i] = new Palette(256); - assert(_palettes[i]); - } + for (int i = 0; i < paletteCount; ++i) { + _palettes[i] = new Palette(numColors); + assert(_palettes[i]); } - _internFadePalette = new Palette(_palettes[0]->getNumColors()); + _internFadePalette = new Palette(numColors); assert(_internFadePalette); setScreenPalette(getPalette(0)); |