diff options
author | Paul Gilbert | 2014-04-12 11:00:29 -0400 |
---|---|---|
committer | Paul Gilbert | 2014-04-12 11:00:29 -0400 |
commit | 2a979e59a0481f62d67b8b323c79cccaa6552d0a (patch) | |
tree | e1286144d595129199438a85899662c33aaa15e0 /engines/mads/scene.cpp | |
parent | 5793daa75ea9364b163acaa83c1be126971444e4 (diff) | |
download | scummvm-rg350-2a979e59a0481f62d67b8b323c79cccaa6552d0a.tar.gz scummvm-rg350-2a979e59a0481f62d67b8b323c79cccaa6552d0a.tar.bz2 scummvm-rg350-2a979e59a0481f62d67b8b323c79cccaa6552d0a.zip |
MADS: Refactoring PaletteUsage to use external data arrays
Diffstat (limited to 'engines/mads/scene.cpp')
-rw-r--r-- | engines/mads/scene.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/engines/mads/scene.cpp b/engines/mads/scene.cpp index 9f8c922861..92c5cedc04 100644 --- a/engines/mads/scene.cpp +++ b/engines/mads/scene.cpp @@ -50,6 +50,8 @@ Scene::Scene(MADSEngine *vm): _vm(vm), _action(_vm), _depthSurface(vm), _layer = LAYER_GUI; _lookFlag = false; + _paletteUsageF.push_back(PaletteUsage::UsageEntry(0xF)); + _verbList.push_back(VerbInit(VERB_LOOK, VERB_THAT, PREP_NONE)); _verbList.push_back(VerbInit(VERB_TAKE, VERB_THAT, PREP_NONE)); _verbList.push_back(VerbInit(VERB_PUSH, VERB_THAT, PREP_NONE)); @@ -121,8 +123,8 @@ void Scene::loadScene(int sceneId, const Common::String &prefix, bool palFlag) { _spriteSlots.reset(false); _sequences.clear(); _kernelMessages.clear(); + _vm->_palette->_paletteUsage.load(&_scenePaletteUsage); - // TODO: palletteUsage reset? setPalette(_nullPalette); int flags = SCENEFLAG_LOAD_SHADOW; if (_vm->_dithering) flags |= SCENEFLAG_DITHER; @@ -144,7 +146,7 @@ void Scene::loadScene(int sceneId, const Common::String &prefix, bool palFlag) { loadVocab(); // Load palette usage - _vm->_palette->_paletteUsage.load(1, 0xF); + _vm->_palette->_paletteUsage.load(&_paletteUsageF); // Load interface flags = PALFLAG_RESERVED | ANIMFLAG_LOAD_BACKGROUND; @@ -157,7 +159,7 @@ void Scene::loadScene(int sceneId, const Common::String &prefix, bool palFlag) { MSurface depthSurface; _animationData->load(_userInterface, depthSurface, prefix, flags, nullptr, nullptr); - _vm->_palette->_paletteUsage.load(0); + _vm->_palette->_paletteUsage.load(&_scenePaletteUsage); _bandsRange = _sceneInfo->_yBandsEnd - _sceneInfo->_yBandsStart; _scaleRange = _sceneInfo->_maxScale - _sceneInfo->_minScale; @@ -576,6 +578,7 @@ void Scene::free() { _activeAnimation = nullptr; } + _vm->_palette->_paletteUsage.load(nullptr); _hotspots.clear(); _backgroundSurface.free(); _depthSurface.free(); |