aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorBertrand Augereau2003-06-05 02:44:18 +0000
committerBertrand Augereau2003-06-05 02:44:18 +0000
commit23196c1257772d3aa109ae735a48ac0356b92153 (patch)
treeaeb12aab4287232fbbf9d94edf003786bb43f98f /scumm
parent870572ca49c39c25dc0d8c77cfe015cdab05ee05 (diff)
downloadscummvm-rg350-23196c1257772d3aa109ae735a48ac0356b92153.tar.gz
scummvm-rg350-23196c1257772d3aa109ae735a48ac0356b92153.tar.bz2
scummvm-rg350-23196c1257772d3aa109ae735a48ac0356b92153.zip
added a global CostumeRenderer in the VM, to avoid actors reinstancing it every time
svn-id: r8307
Diffstat (limited to 'scumm')
-rw-r--r--scumm/scumm.h3
-rw-r--r--scumm/scummvm.cpp19
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() {