diff options
author | Paul Gilbert | 2014-03-11 21:40:49 -0400 |
---|---|---|
committer | Paul Gilbert | 2014-03-11 21:40:49 -0400 |
commit | 41e86d553e087e1b4276748064fb5893859196b2 (patch) | |
tree | d3bc56c1add10eafe6f0fcef4045cc590b8c0cd8 | |
parent | 5047c118f1b3bb60136bc4088e9db53f38dbb087 (diff) | |
download | scummvm-rg350-41e86d553e087e1b4276748064fb5893859196b2.tar.gz scummvm-rg350-41e86d553e087e1b4276748064fb5893859196b2.tar.bz2 scummvm-rg350-41e86d553e087e1b4276748064fb5893859196b2.zip |
MADS: Renamed game palette to palette flags
-rw-r--r-- | engines/mads/game.cpp | 2 | ||||
-rw-r--r-- | engines/mads/interface.cpp | 2 | ||||
-rw-r--r-- | engines/mads/palette.cpp | 22 | ||||
-rw-r--r-- | engines/mads/palette.h | 6 |
4 files changed, 15 insertions, 17 deletions
diff --git a/engines/mads/game.cpp b/engines/mads/game.cpp index e0d3ca1914..f290ab0fc3 100644 --- a/engines/mads/game.cpp +++ b/engines/mads/game.cpp @@ -166,7 +166,7 @@ void Game::sectionLoop() { _vm->_palette->resetGamePalette(18, 10); _scene._spriteSlots.reset(); } else { - _vm->_palette->initGamePalette(); + _vm->_palette->initPalette(); } _vm->_palette->_paletteUsage.load(3, 0xF0, 0xF1, 0xF2); diff --git a/engines/mads/interface.cpp b/engines/mads/interface.cpp index 68e2341ccc..0c983dc133 100644 --- a/engines/mads/interface.cpp +++ b/engines/mads/interface.cpp @@ -49,7 +49,7 @@ void InterfaceSurface::load(const Common::String &resName) { // Load in the palette Common::SeekableReadStream *palStream = madsPack.getItemStream(0); - uint32 *gamePalP = &_vm->_palette->_gamePalette[0]; + uint32 *gamePalP = &_vm->_palette->_palFlags[0]; byte *palP = &_vm->_palette->_mainPalette[0]; for (int i = 0; i < 16; ++i, gamePalP++, palP += 3) { diff --git a/engines/mads/palette.cpp b/engines/mads/palette.cpp index 2e4995e939..e63d9c03ed 100644 --- a/engines/mads/palette.cpp +++ b/engines/mads/palette.cpp @@ -179,7 +179,7 @@ int PaletteUsage::process(Common::Array<RGB6> &palette, uint flags) { int var36 = (palette[palIndex]._flags & 0x80) ? 0 : 2; for (int idx = palLow; idx < palIdx; ++idx) { - uint32 v = _vm->_palette->_gamePalette[idx]; + uint32 v = _vm->_palette->_palFlags[idx]; if ((v & var3A) && !(v & var36)) { int var10; @@ -205,7 +205,7 @@ int PaletteUsage::process(Common::Array<RGB6> &palette, uint flags) { if (!var48 && (!(flags & 0x1000) || (!(palette[palIndex]._flags & 0x60) && !(flags & 0x2000)))) { for (int idx = freeIndex; idx < palIdx && !var48; ++idx) { - if (!_vm->_palette->_gamePalette[idx]) { + if (!_vm->_palette->_palFlags[idx]) { --palCount; ++freeIndex; var48 = true; @@ -223,7 +223,7 @@ int PaletteUsage::process(Common::Array<RGB6> &palette, uint flags) { assert(var48); int var52 = (varA && palette[palIndex]._u2) ? 2 : 0; - _vm->_palette->_gamePalette[var4] |= var52 | rgbMask; + _vm->_palette->_palFlags[var4] |= var52 | rgbMask; palette[palIndex]._palIndex = var4; } @@ -307,7 +307,7 @@ int PaletteUsage::getGamePalFreeIndex(int *palIndex) { int count = 0; for (int i = 0; i < PALETTE_COUNT; ++i) { - if (!_vm->_palette->_gamePalette[i]) { + if (!_vm->_palette->_palFlags[i]) { ++count; if (*palIndex < 0) *palIndex = i; @@ -501,19 +501,19 @@ void Palette::setSystemPalette() { } void Palette::resetGamePalette(int lowRange, int highRange) { - Common::fill((byte *)&_gamePalette[0], (byte *)&_gamePalette[PALETTE_COUNT], 0); + Common::fill((byte *)&_palFlags[0], (byte *)&_palFlags[PALETTE_COUNT], 0); initVGAPalette(_mainPalette); // Init low range to common RGB values if (lowRange) { - Common::fill(&_gamePalette[0], &_gamePalette[lowRange], 1); + Common::fill(&_palFlags[0], &_palFlags[lowRange], 1); } // Init high range to common RGB values if (highRange) { - _gamePalette[255] = 1; + _palFlags[255] = 1; - Common::fill(&_gamePalette[255 - highRange], &_gamePalette[254], _gamePalette[255]); + Common::fill(&_palFlags[255 - highRange], &_palFlags[254], _palFlags[255]); } _rgbList.clear(); @@ -524,7 +524,7 @@ void Palette::resetGamePalette(int lowRange, int highRange) { _highRange = highRange; } -void Palette::initGamePalette() { +void Palette::initPalette() { RGB4 rgb; uint32 palMask = 1; @@ -543,7 +543,7 @@ void Palette::initGamePalette() { } for (int idx = 0; idx < PALETTE_COUNT; ++idx) - _gamePalette[idx] = palMask; + _palFlags[idx] = palMask; _v1 = 0; _rgbList.reset(); @@ -566,8 +566,6 @@ void Palette::initVGAPalette(byte *palette) { int vcx = 0; int var4 = vdx; do { - int var2 = var6 + vcx; - *destP++ = (var8) ? vdi & 0xFF : vbx & 0XFF; *destP++ = (var4) ? vdi & 0xFF : vbx & 0XFF; *destP++ = (vcx) ? vdi & 0xFF : vbx & 0XFF; diff --git a/engines/mads/palette.h b/engines/mads/palette.h index b540aa572f..2744d47190 100644 --- a/engines/mads/palette.h +++ b/engines/mads/palette.h @@ -130,7 +130,7 @@ protected: public: byte _mainPalette[PALETTE_SIZE]; byte _savedPalette[PALETTE_SIZE]; - uint32 _gamePalette[PALETTE_COUNT]; + uint32 _palFlags[PALETTE_COUNT]; PaletteUsage _paletteUsage; RGBList _rgbList; int _v1; @@ -205,9 +205,9 @@ public: void resetGamePalette(int v1, int v2); /** - * Initialises game palette + * Initialises the main palette */ - void initGamePalette(); + void initPalette(); /** * Set the first four palette entries with preset values |