[Scummvm-cvs-logs] CVS: scummvm/scumm actor.cpp,1.41,1.42

Max Horn fingolfin at users.sourceforge.net
Tue Dec 24 16:32:02 CET 2002


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

Modified Files:
	actor.cpp 
Log Message:
allow array dynamically to make VC happy

Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/actor.cpp,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- actor.cpp	23 Dec 2002 23:30:13 -0000	1.41
+++ actor.cpp	25 Dec 2002 00:31:39 -0000	1.42
@@ -848,17 +848,21 @@
 void Scumm::processActors()
 {
 	int i;
-	Actor *actors[NUM_ACTORS], *a, **ac, **ac2, *tmp, **end;
+	Actor **actors, *a, **ac, **ac2, *tmp, **end;
 	int numactors = 0;
 
+	actors = new Actor*[NUM_ACTORS];
+	
 	// Make a list of all actors in this room
 	for (i = 1; i < NUM_ACTORS; i++) {
 		a = derefActor(i);
 		if (a->isInCurrentRoom())
 			actors[numactors++] = a;
 	}
-	if (!numactors)
+	if (!numactors) {
+		delete [] actors;
 		return;
+	}
 
 	end = actors + numactors;
 
@@ -883,6 +887,8 @@
 			CHECK_HEAP a->animateCostume();
 		}
 	}
+	
+	delete [] actors;
 }
 
 void Actor::drawActorCostume()





More information about the Scummvm-git-logs mailing list