[Scummvm-cvs-logs] CVS: scummvm/scumm scumm.h,1.241,1.242 scummvm.cpp,2.209,2.210

Bertrand Augereau tramboi at users.sourceforge.net
Wed Jun 4 19:45:05 CEST 2003


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv5399

Modified Files:
	scumm.h scummvm.cpp 
Log Message:
added a global CostumeRenderer in the VM, to avoid actors reinstancing it every time

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.241
retrieving revision 1.242
diff -u -d -r1.241 -r1.242
--- scumm.h	4 Jun 2003 23:02:51 -0000	1.241
+++ scumm.h	5 Jun 2003 02:44:18 -0000	1.242
@@ -47,6 +47,7 @@
 class ScummDebugger;
 class Serializer;
 struct FindObjectInRoom;
+class BaseCostumeRenderer;
 
 typedef ScummVM::Map<ScummVM::String, int> ObjectIDMap;
 
@@ -419,6 +420,8 @@
 	int _numActors;
 public:
 	int _numCostumes;	// FIXME - should be protected, used by Actor::remapActorPalette
+
+	BaseCostumeRenderer* _bcr;
 	
 	char *_audioNames;
 	int32 _numAudioNames;

Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scummvm.cpp,v
retrieving revision 2.209
retrieving revision 2.210
diff -u -d -r2.209 -r2.210
--- scummvm.cpp	4 Jun 2003 23:02:51 -0000	2.209
+++ scummvm.cpp	5 Jun 2003 02:44:18 -0000	2.210
@@ -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 @@
 	_languageBuffer = NULL;
 	_languageIndex = NULL;
 	memset(_transText,0,sizeof(_transText));
+	_bcr = NULL;
 
 	//
 	// Init all VARS to 0xFF
@@ -724,6 +729,8 @@
 	delete _languageBuffer;
 	delete _audioNames;
 
+	delete _bcr;
+
 	if (_shadowPalette)
 		free(_shadowPalette);
 	
@@ -734,7 +741,19 @@
 
 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() {





More information about the Scummvm-git-logs mailing list