diff options
-rw-r--r-- | scumm/scumm.h | 3 | ||||
-rw-r--r-- | scumm/scummvm.cpp | 19 |
2 files changed, 22 insertions, 0 deletions
diff --git a/scumm/scumm.h b/scumm/scumm.h index 8ac28ddd55..57b891fb99 100644 --- a/scumm/scumm.h +++ b/scumm/scumm.h @@ -47,6 +47,7 @@ class Bundle; class ScummDebugger; class Serializer; struct FindObjectInRoom; +class BaseCostumeRenderer; typedef ScummVM::Map<ScummVM::String, int> ObjectIDMap; @@ -419,6 +420,8 @@ protected: int _numActors; public: int _numCostumes; // FIXME - should be protected, used by Actor::remapActorPalette + + BaseCostumeRenderer* _bcr; char *_audioNames; int32 _numAudioNames; diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp index 20a4cdc15e..a9b2f77d4d 100644 --- a/scumm/scummvm.cpp +++ b/scumm/scummvm.cpp @@ -43,6 +43,10 @@ #include "gui/message.h" #include "sound/mixer.h" #include "sound/mididrv.h" + +#include "akos.h" +#include "costume.h" + #ifdef MACOSX #include <sys/types.h> #include <sys/stat.h> @@ -413,6 +417,7 @@ Scumm::Scumm (GameDetector *detector, OSystem *syst) _languageBuffer = NULL; _languageIndex = NULL; memset(_transText,0,sizeof(_transText)); + _bcr = NULL; // // Init all VARS to 0xFF @@ -724,6 +729,8 @@ Scumm::~Scumm () delete _languageBuffer; delete _audioNames; + delete _bcr; + if (_shadowPalette) free(_shadowPalette); @@ -734,7 +741,19 @@ Scumm::~Scumm () void Scumm::setFeatures (uint32 newFeatures) { + bool newCostumes = _features & GF_NEW_COSTUMES; + bool newNewCostumes = newFeatures & GF_NEW_COSTUMES; + _features = newFeatures; + + if (!_bcr || newCostumes!=newNewCostumes) + { + delete _bcr; + if (newNewCostumes) + _bcr = new AkosRenderer (this); + else + _bcr = new CostumeRenderer(this); + } } void Scumm::scummInit() { |