[Scummvm-cvs-logs] CVS: scummvm/scumm actor.cpp,1.85,1.86 costume.cpp,1.39,1.40 debug.cpp,1.14,1.15 debugger.cpp,1.34,1.35 gfx.cpp,2.95,2.96 object.cpp,1.91,1.92 resource.cpp,1.76,1.77 saveload.cpp,1.66,1.67 script_v2.cpp,2.61,2.62 script_v5.cpp,1.76,1.77 script_v6.cpp,1.110,1.111 script_v8.cpp,2.153,2.154 scumm.h,1.186,1.187 scummvm.cpp,2.141,2.142

Max Horn fingolfin at users.sourceforge.net
Tue May 13 16:43:09 CEST 2003


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

Modified Files:
	actor.cpp costume.cpp debug.cpp debugger.cpp gfx.cpp 
	object.cpp resource.cpp saveload.cpp script_v2.cpp 
	script_v5.cpp script_v6.cpp script_v8.cpp scumm.h scummvm.cpp 
Log Message:
NUM_ACTORS -> _numActors (for consistency)

Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/actor.cpp,v
retrieving revision 1.85
retrieving revision 1.86
diff -u -d -r1.85 -r1.86
--- actor.cpp	13 May 2003 23:03:14 -0000	1.85
+++ actor.cpp	13 May 2003 23:42:39 -0000	1.86
@@ -773,7 +773,7 @@
 	int i;
 	Actor *a;
 
-	for (i = 1; i < NUM_ACTORS; i++) {
+	for (i = 1; i < _numActors; i++) {
 		a = derefActor(i);
 		if (a->isInCurrentRoom())
 			a->showActor();
@@ -784,7 +784,7 @@
 	int i;
 	Actor *a;
 
-	for (i = 1; i < NUM_ACTORS; i++) {
+	for (i = 1; i < _numActors; i++) {
 		a = derefActor(i);
 		if (a->isInCurrentRoom())
 			// FIXME: really V3, or should it maybe be GF_SMALL_HEADER
@@ -800,12 +800,12 @@
 	int i;
 	Actor *a;
 
-	for (i = 1; i < NUM_ACTORS; i++) {
+	for (i = 1; i < _numActors; i++) {
 		a = derefActor(i);
 		if (a->cost.animCounter2 && a->isInCurrentRoom() && a->sound) {
 			_currentScript = 0xFF;
 			_sound->addSoundToQueue(a->sound[0]);
-			for (i = 1; i < NUM_ACTORS; i++) {
+			for (i = 1; i < _numActors; i++) {
 				a = derefActor(i);
 				a->cost.animCounter2 = 0;
 			}
@@ -822,10 +822,10 @@
 	Actor **actors, *a, **ac, **ac2, *tmp, **end;
 	int numactors = 0;
 
-	actors = new Actor * [NUM_ACTORS];
+	actors = new Actor * [_numActors];
 	
 	// Make a list of all actors in this room
-	for (i = 1; i < NUM_ACTORS; i++) {
+	for (i = 1; i < _numActors; i++) {
 		a = derefActor(i);
 		if ((_features & GF_AFTER_V8) && a->layer < 0)
 			continue;
@@ -870,7 +870,7 @@
 	Actor *a;
 	int i;
 
-	for (i = 1; i < NUM_ACTORS; i++) {
+	for (i = 1; i < _numActors; i++) {
 		a = derefActor(i);
 		if (a->isInCurrentRoom() && a->costume && a->layer < 0) {
 			CHECK_HEAP getMaskFromBox(a->walkbox);
@@ -1084,7 +1084,7 @@
 	int i, j;
 
 	if (_fullRedraw) {
-		for (j = 1; j < NUM_ACTORS; j++) {
+		for (j = 1; j < _numActors; j++) {
 			Actor *a = derefActor(j);
 			a->needRedraw |= fg;
 			a->needBgReset |= bg;
@@ -1093,7 +1093,7 @@
 		for (i = 0; i < gdi._numStrips; i++) {
 			int strip = _screenStartStrip + i;
 			if (testGfxAnyUsageBits(strip)) {
-				for (j = 1; j < NUM_ACTORS; j++) {
+				for (j = 1; j < _numActors; j++) {
 					if (testGfxUsageBit(strip, j) && testGfxOtherUsageBits(strip, j)) {
 						Actor *a = derefActor(j);
 						assert(a->number == j);
@@ -1111,7 +1111,7 @@
 
 	if (!testGfxAnyUsageBits(x >> 3))
 		return 0;
-	for (i = 1; i < NUM_ACTORS; i++) {
+	for (i = 1; i < _numActors; i++) {
 		Actor *a = derefActor(i);
 		assert(a->number == i);
 		if (testGfxUsageBit(x >> 3, i) && !getClass(i, 32) && y >= a->top && y <= a->bottom) {
@@ -1562,7 +1562,7 @@
 
 	for (i = 0; i < gdi._numStrips; i++) {
 		int strip = _screenStartStrip + i;
-		for (j = 1; j < NUM_ACTORS; j++) {
+		for (j = 1; j < _numActors; j++) {
 			a = derefActor(j);
 			if (testGfxUsageBit(strip, j) && a->top != 0xFF && a->needBgReset) {
 				clearGfxUsageBit(strip, j);
@@ -1572,7 +1572,7 @@
 		}
 	}
 
-	for (i = 1; i < NUM_ACTORS; i++) {
+	for (i = 1; i < _numActors; i++) {
 		a = derefActor(i);
 		a->needBgReset = false;
 	}

Index: costume.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/costume.cpp,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- costume.cpp	13 May 2003 23:03:18 -0000	1.39
+++ costume.cpp	13 May 2003 23:42:39 -0000	1.40
@@ -1414,7 +1414,7 @@
 	Actor *a;
 
 	if (_roomResource != 0)
-		for (i = 1; i < NUM_ACTORS; i++) {
+		for (i = 1; i < _numActors; i++) {
 			a = derefActor(i);
 			if (a->isInCurrentRoom() && a->costume == cost)
 				return true;

Index: debug.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/debug.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- debug.cpp	10 May 2003 21:49:57 -0000	1.14
+++ debug.cpp	13 May 2003 23:42:39 -0000	1.15
@@ -343,7 +343,7 @@
 	printf("+--------------------------------------------------------------------+\n");
 	printf("|# |room|  x |  y |elev|cos|width|box|mov| zp|frame|scale|spd|dir|cls|\n");
 	printf("+--+----+----+----+----+---+-----+---+---+---+-----+-----+---+---+---+\n");
-	for (i = 1; i < _s->NUM_ACTORS; i++) {
+	for (i = 1; i < _s->_numActors; i++) {
 		if (act == -1 || act == i) {
 			a = &_s->_actors[i];
 			if (a->visible)

Index: debugger.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/debugger.cpp,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- debugger.cpp	10 May 2003 21:49:57 -0000	1.34
+++ debugger.cpp	13 May 2003 23:42:39 -0000	1.35
@@ -515,8 +515,8 @@
 	}
 
 	actnum = atoi(argv[1]);
-	if (actnum >= _s->NUM_ACTORS) {
-		Debug_Printf("Actor %d is out of range (range: 1 - %d)\n", actnum, _s->NUM_ACTORS);
+	if (actnum >= _s->_numActors) {
+		Debug_Printf("Actor %d is out of range (range: 1 - %d)\n", actnum, _s->_numActors);
 		return true;
 	}
 
@@ -547,7 +547,7 @@
 	Debug_Printf("+--------------------------------------------------------------------+\n");
 	Debug_Printf("|# |room|  x |  y |elev|cos|width|box|mov| zp|frame|scale|spd|dir|cls|\n");
 	Debug_Printf("+--+----+----+----+----+---+-----+---+---+---+-----+-----+---+---+---+\n");
-	for (i = 1; i < _s->NUM_ACTORS; i++) {
+	for (i = 1; i < _s->_numActors; i++) {
 		a = &_s->_actors[i];
 		if (a->visible)
 			Debug_Printf("|%2d|%4d|%4d|%4d|%4d|%3d|%5d|%3d|%3d|%3d|%5d|%5d|%3d|%3d|$%02x|\n",

Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.cpp,v
retrieving revision 2.95
retrieving revision 2.96
diff -u -d -r2.95 -r2.96
--- gfx.cpp	12 May 2003 21:53:36 -0000	2.95
+++ gfx.cpp	13 May 2003 23:42:39 -0000	2.96
@@ -2017,7 +2017,7 @@
 		if (t - _screenStartStrip < camera._leftTrigger || t - _screenStartStrip > camera._rightTrigger)
 			setCameraAt(a->x, 0);
 
-		for (i = 1; i < NUM_ACTORS; i++) {
+		for (i = 1; i < _numActors; i++) {
 			a = derefActor(i);
 			if (a->isInCurrentRoom())
 				a->needRedraw = true;

Index: object.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/object.cpp,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -d -r1.91 -r1.92
--- object.cpp	10 May 2003 22:12:23 -0000	1.91
+++ object.cpp	13 May 2003 23:42:39 -0000	1.92
@@ -69,7 +69,7 @@
 	else
 		_classData[obj] &= ~(1 << (cls - 1));
 
-	if (1 <= obj && obj < NUM_ACTORS) {
+	if (1 <= obj && obj < _numActors) {
 		_actors[obj].classChanged(cls, set);
 	}
 }
@@ -149,7 +149,7 @@
 }
 
 int Scumm::getObjectOrActorXY(int object, int &x, int &y) {
-	if (object < NUM_ACTORS) {
+	if (object < _numActors) {
 		Actor *act = derefActorSafe(object, "getObjectOrActorXY");
 		if (!act) 
 			return 0; 
@@ -161,7 +161,7 @@
 	case WIO_NOT_FOUND:
 		return -1;
 	case WIO_INVENTORY:
-		if (_objectOwnerTable[object] < NUM_ACTORS)
+		if (_objectOwnerTable[object] < _numActors)
 			return derefActorSafe(_objectOwnerTable[object], "getObjectOrActorXY(2)")->getActorXYPos(x, y);
 		else
 			return 0xFF;
@@ -218,10 +218,10 @@
 	Actor *acta = NULL;
 	Actor *actb = NULL;
 
-	if (a < NUM_ACTORS)
+	if (a < _numActors)
 		acta = derefActorSafe(a, "getObjActToObjActDist");
 
-	if (b < NUM_ACTORS)
+	if (b < _numActors)
 		actb = derefActorSafe(b, "getObjActToObjActDist(2)");
 
 	if (acta && actb && acta->getRoom() == actb->getRoom() && acta->getRoom() && !acta->isInCurrentRoom())
@@ -833,7 +833,7 @@
 	byte *objptr;
 	int i;
 
-	if (obj < NUM_ACTORS)
+	if (obj < _numActors)
 		return derefActorSafe(obj, "getObjOrActorName")->getActorName();
 
 	if (_features & GF_SMALL_HEADER) {
@@ -1131,7 +1131,7 @@
 }
 
 int Scumm::getObjX(int obj) {
-	if (obj < NUM_ACTORS) {
+	if (obj < _numActors) {
 		if (obj < 1)
 			return 0;									/* fix for indy4's map */
 		return derefActorSafe(obj, "getObjX")->x;
@@ -1145,7 +1145,7 @@
 }
 
 int Scumm::getObjY(int obj) {
-	if (obj < NUM_ACTORS) {
+	if (obj < _numActors) {
 		if (obj < 1)
 			return 0;									/* fix for indy4's map */
 		return derefActorSafe(obj, "getObjY")->y;
@@ -1164,7 +1164,7 @@
 
 int Scumm::getObjNewDir(int obj) {
 	int dir;
-	if (obj < NUM_ACTORS) {
+	if (obj < _numActors) {
 		dir = derefActorSafe(obj, "getObjNewDir")->facing;
 	} else {
 		int x, y;
@@ -1230,7 +1230,7 @@
 	if (is_obj_1) {
 		if (getObjectOrActorXY(b, x, y) == -1)
 			return -1;
-		if (b < NUM_ACTORS)
+		if (b < _numActors)
 			i = derefActorSafe(b, "unkObjProc1")->scalex;
 	} else {
 		x = b;
@@ -1240,7 +1240,7 @@
 	if (is_obj_2) {
 		if (getObjectOrActorXY(e, x2, y2) == -1)
 			return -1;
-		if (e < NUM_ACTORS)
+		if (e < _numActors)
 			j = derefActorSafe(e, "unkObjProc1(2)")->scalex;
 	} else {
 		x2 = e;

Index: resource.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/resource.cpp,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -d -r1.76 -r1.77
--- resource.cpp	13 May 2003 23:33:01 -0000	1.76
+++ resource.cpp	13 May 2003 23:42:39 -0000	1.77
@@ -1753,7 +1753,7 @@
 	allocResTypeData(rtInventory, MKID('NONE'), _numInventory, "inventory", 0);
 	allocResTypeData(rtTemp, MKID('NONE'), 10, "temp", 0);
 	allocResTypeData(rtScaleTable, MKID('NONE'), 5, "scale table", 0);
-	allocResTypeData(rtActorName, MKID('NONE'), NUM_ACTORS, "actor name", 0);
+	allocResTypeData(rtActorName, MKID('NONE'), _numActors, "actor name", 0);
 	allocResTypeData(rtVerb, MKID('NONE'), _numVerbs, "verb", 0);
 	allocResTypeData(rtString, MKID('NONE'), _numArray, "array", 0);
 	allocResTypeData(rtFlObject, MKID('NONE'), _numFlObject, "flobject", 0);

Index: saveload.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/saveload.cpp,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -d -r1.66 -r1.67
--- saveload.cpp	12 May 2003 22:08:38 -0000	1.66
+++ saveload.cpp	13 May 2003 23:42:40 -0000	1.67
@@ -607,7 +607,7 @@
 	if (!s->isSaving() && savegameVersion < VER_V14)
 		upgradeGfxUsageBits();
 
-	s->saveLoadArrayOf(_actors, NUM_ACTORS, sizeof(_actors[0]), actorEntries);
+	s->saveLoadArrayOf(_actors, _numActors, sizeof(_actors[0]), actorEntries);
 
 	if (savegameVersion < VER_V9)
 		s->saveLoadArrayOf(vm.slot, 25, sizeof(vm.slot[0]), scriptSlotEntries);

Index: script_v2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v2.cpp,v
retrieving revision 2.61
retrieving revision 2.62
diff -u -d -r2.61 -r2.62
--- script_v2.cpp	11 May 2003 11:13:24 -0000	2.61
+++ script_v2.cpp	13 May 2003 23:42:40 -0000	2.62
@@ -1115,7 +1115,7 @@
 	} while (a);
 	work[i] = 0;
 
-	if (obj < NUM_ACTORS)
+	if (obj < _numActors)
 		error("Can't set actor %d name with new-name-of", obj);
 
 	name = getObjOrActorName(obj);

Index: script_v5.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v5.cpp,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -d -r1.76 -r1.77
--- script_v5.cpp	13 May 2003 23:33:01 -0000	1.76
+++ script_v5.cpp	13 May 2003 23:42:40 -0000	1.77
@@ -539,7 +539,7 @@
 		newClass = getVarOrDirectWord(0x80);
 		if (newClass == 0) {
 			_classData[obj] = 0;
-			if ((_features & GF_SMALL_HEADER) && obj <= NUM_ACTORS) {
+			if ((_features & GF_SMALL_HEADER) && obj <= _numActors) {
 				Actor *a;
 				a = derefActorSafe(obj, "setClass");
 				a->ignoreBoxes = 0;
@@ -1924,7 +1924,7 @@
 	}
 	work[i] = 0;
 
-	if (obj < NUM_ACTORS)
+	if (obj < _numActors)
 		error("Can't set actor %d name with new-name-of", obj);
 
 	if (!getOBCDFromObject(obj)) {

Index: script_v6.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v6.cpp,v
retrieving revision 1.110
retrieving revision 1.111
diff -u -d -r1.110 -r1.111
--- script_v6.cpp	13 May 2003 23:33:01 -0000	1.110
+++ script_v6.cpp	13 May 2003 23:42:40 -0000	1.111
@@ -989,7 +989,7 @@
 	if (!a)
 		return;
 
-	if (obj >= NUM_ACTORS) {
+	if (obj >= _numActors) {
 		if (whereIsObject(obj) == WIO_NOT_FOUND)
 			return;
 		int y, dir;
@@ -1296,7 +1296,7 @@
 	int obj = pop();
 	int i;
 
-	if (obj < NUM_ACTORS)
+	if (obj < _numActors)
 		error("Can't set actor %d name with new-name-of", obj);
 
 	if (!(_features & GF_AFTER_V7) && !getOBCDFromObject(obj))

Index: script_v8.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v8.cpp,v
retrieving revision 2.153
retrieving revision 2.154
diff -u -d -r2.153 -r2.154
--- script_v8.cpp	12 May 2003 22:08:38 -0000	2.153
+++ script_v8.cpp	13 May 2003 23:42:41 -0000	2.154
@@ -868,7 +868,7 @@
 
 	createBoxMatrix();
 
-	for(i = 1; i < NUM_ACTORS; i++) {
+	for(i = 1; i < _numActors; i++) {
 		a = &_actors[i];
 		if (a && a->isInCurrentRoom())
 			a->adjustActorPos();

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.186
retrieving revision 1.187
diff -u -d -r1.186 -r1.187
--- scumm.h	13 May 2003 23:33:01 -0000	1.186
+++ scumm.h	13 May 2003 23:42:41 -0000	1.187
@@ -379,7 +379,7 @@
 	Gdi gdi;
 
 protected:
-	Actor *_actors;	// Has NUM_ACTORS elements
+	Actor *_actors;	// Has _numActors elements
 	
 	uint16 *_inventory;
 	byte *_arrays;
@@ -411,7 +411,7 @@
 	int _numGlobalObjects, _numArray, _numVerbs, _numFlObject;
 	int _numInventory, _numRooms, _numScripts, _numSounds;
 	int _numCharsets, _numNewNames, _numGlobalScripts;
-	int NUM_ACTORS;
+	int _numActors;
 public:
 	int _numCostumes;	// FIXME - should be protected, used by Actor::remapActorPalette
 	

Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scummvm.cpp,v
retrieving revision 2.141
retrieving revision 2.142
diff -u -d -r2.141 -r2.142
--- scummvm.cpp	13 May 2003 23:33:01 -0000	2.141
+++ scummvm.cpp	13 May 2003 23:42:41 -0000	2.142
@@ -232,7 +232,7 @@
 	_numCharsets = 0;
 	_numNewNames = 0;
 	_numGlobalScripts = 0;
-	NUM_ACTORS = 0;
+	_numActors = 0;
 	_numCostumes = 0;
 	_audioNames = NULL;
 	_numAudioNames = 0;
@@ -683,8 +683,8 @@
 	setupCursor();
 	
 	// Allocate and Initialize actors
-	_actors = new Actor[NUM_ACTORS];
-	for (i = 1; i < NUM_ACTORS; i++) {
+	_actors = new Actor[_numActors];
+	for (i = 1; i < _numActors; i++) {
 		a = derefActor(i);
 		a->number = i;
 		a->initActorClass(this);
@@ -1110,7 +1110,7 @@
 	clearEnqueue();
 	stopCycle(0);
 
-	for (i = 1; i < NUM_ACTORS; i++) {
+	for (i = 1; i < _numActors; i++) {
 		at = derefActor(i);
 		at->hideActor();
 	}
@@ -1886,7 +1886,7 @@
 }
 
 Actor *Scumm::derefActorSafe(int id, const char *errmsg) {
-	if (id < 1 || id >= NUM_ACTORS) {
+	if (id < 1 || id >= _numActors) {
 		debug(2, "Invalid actor %d in %s (script %d, opcode 0x%x) - This is potentially a BIG problem.",
 			 id, errmsg, vm.slot[_curExecScript].number, _opcode);
 		return NULL;
@@ -2202,13 +2202,13 @@
 	setupOpcodes();
 
 	if (_features & GF_AFTER_V8)
-		NUM_ACTORS = 80;
+		_numActors = 80;
 	else if ((_features & GF_AFTER_V7) || (_gameId == GID_SAMNMAX))
-		NUM_ACTORS = 30;
+		_numActors = 30;
 	else if (_gameId == GID_MANIAC)
-		NUM_ACTORS = 24;	// Temporary (?) hack to get to the character selection screen
+		_numActors = 24;
 	else
-		NUM_ACTORS = 13;
+		_numActors = 13;
 
 	if (_features & GF_AFTER_V7)
 		OF_OWNER_ROOM = 0xFF;





More information about the Scummvm-git-logs mailing list