[Scummvm-cvs-logs] CVS: residual lua.cpp,1.129,1.130 objectstate.cpp,1.7,1.8 objectstate.h,1.8,1.9 scene.h,1.25,1.26

Pawel Kolodziejski aquadran at users.sourceforge.net
Fri Apr 8 06:15:19 CEST 2005


Update of /cvsroot/scummvm/residual
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28949

Modified Files:
	lua.cpp objectstate.cpp objectstate.h scene.h 
Log Message:
added code for freeing object states

Index: lua.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/lua.cpp,v
retrieving revision 1.129
retrieving revision 1.130
diff -u -d -r1.129 -r1.130
--- lua.cpp	8 Apr 2005 11:49:00 -0000	1.129
+++ lua.cpp	8 Apr 2005 12:09:17 -0000	1.130
@@ -1686,9 +1686,8 @@
 }
 
 static void FreeObjectState() {
-	/*ObjectState *object = */check_object(1);
-	warning("State: freeObjectState(...)");
-	//scene.deleteObjectState(object);
+	ObjectState *object = check_object(1);
+	g_engine->currScene()->deleteObjectState(object);
 }
 
 static void GetCurrentScript() {

Index: objectstate.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/objectstate.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- objectstate.cpp	20 Mar 2005 21:04:01 -0000	1.7
+++ objectstate.cpp	8 Apr 2005 12:09:17 -0000	1.8
@@ -30,3 +30,9 @@
 	if (_zbitmap)
 		_zbitmap->setNumber(initialImage);
 }
+
+ObjectState::~ObjectState() {
+	g_resourceloader->uncache(_bitmap->getFilename());
+	if (_zbitmap)
+		g_resourceloader->uncache(_zbitmap->getFilename());
+}
\ No newline at end of file

Index: objectstate.h
===================================================================
RCS file: /cvsroot/scummvm/residual/objectstate.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- objectstate.h	1 Jan 2005 12:27:56 -0000	1.8
+++ objectstate.h	8 Apr 2005 12:09:17 -0000	1.9
@@ -34,6 +34,8 @@
 	};
 
 	ObjectState(int setupID, ObjectState::Position pos, const char *bitmap, const char *zbitmap, bool visible);
+	ObjectState::~ObjectState();
+
 	int setupID() const { return _setupID; }
 	Position pos() const { return _pos; }
 	const char *bitmapFilename() const {

Index: scene.h
===================================================================
RCS file: /cvsroot/scummvm/residual/scene.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- scene.h	18 Jan 2005 17:25:04 -0000	1.25
+++ scene.h	8 Apr 2005 12:09:17 -0000	1.26
@@ -86,6 +86,13 @@
 	void addObjectState(ObjectState *s) {
 		_states.push_back(s);
 	}
+	void deleteObjectState(ObjectState *s) {
+		while (!_states.empty()) {
+			delete _states.back();
+			_states.pop_back();
+		}
+	}
+
 	ObjectState *findState(const char *filename);
 
 	struct Setup {		// Camera setup data





More information about the Scummvm-git-logs mailing list