[Scummvm-cvs-logs] CVS: scummvm/scumm charset.cpp,2.72,2.73 debugger.cpp,1.101,1.102 object.cpp,1.153,1.154 resource.cpp,1.178,1.179 script.cpp,1.138,1.139 script_v2.cpp,2.222,2.223 script_v5.cpp,1.214,1.215 script_v6.cpp,1.223,1.224 script_v8.cpp,2.209,2.210 scumm.h,1.337,1.338 scummvm.cpp,2.519,2.520 sound.cpp,1.299,1.300 string.cpp,1.174,1.175 verbs.cpp,1.83,1.84

Max Horn fingolfin at users.sourceforge.net
Fri Dec 26 15:13:01 CET 2003


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

Modified Files:
	charset.cpp debugger.cpp object.cpp resource.cpp script.cpp 
	script_v2.cpp script_v5.cpp script_v6.cpp script_v8.cpp 
	scumm.h scummvm.cpp sound.cpp string.cpp verbs.cpp 
Log Message:
got rid of those _maxFOO macros, replaced them by access to the equivalent _numFOO variables

Index: charset.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/charset.cpp,v
retrieving revision 2.72
retrieving revision 2.73
diff -u -d -r2.72 -r2.73
--- charset.cpp	15 Dec 2003 14:54:35 -0000	2.72
+++ charset.cpp	26 Dec 2003 23:11:33 -0000	2.73
@@ -50,7 +50,7 @@
 }
 
 void CharsetRendererCommon::setCurID(byte id) {
-	checkRange(_vm->_maxCharsets - 1, 0, id, "Printing with bad charset %d");
+	checkRange(_vm->_numCharsets - 1, 0, id, "Printing with bad charset %d");
 
 	_curId = id;
 
@@ -65,7 +65,7 @@
 }
 
 void CharsetRendererV3::setCurID(byte id) {
-	checkRange(_vm->_maxCharsets - 1, 0, id, "Printing with bad charset %d");
+	checkRange(_vm->_numCharsets - 1, 0, id, "Printing with bad charset %d");
 
 	_curId = id;
 
@@ -949,7 +949,7 @@
 	int w, h;
 	int drawTop;
 
-	checkRange(_vm->_maxCharsets - 1, 0, _curId, "Printing with bad charset %d");
+	checkRange(_vm->_numCharsets - 1, 0, _curId, "Printing with bad charset %d");
 
 	if ((vs = _vm->findVirtScreen(_top)) == NULL)
 		return;
@@ -1005,7 +1005,7 @@
 	const byte *charPtr;
 	int is2byte = (chr >= 0x80 && _vm->_CJKMode) ? 1 : 0;
 
-	checkRange(_vm->_maxCharsets - 1, 1, _curId, "Printing with bad charset %d");
+	checkRange(_vm->_numCharsets - 1, 1, _curId, "Printing with bad charset %d");
 	
 	if ((vs = _vm->findVirtScreen(_top)) == NULL && (vs = _vm->findVirtScreen(_top + getFontHeight())) == NULL)
 		return;

Index: debugger.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/debugger.cpp,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -d -r1.101 -r1.102
--- debugger.cpp	25 Dec 2003 22:49:10 -0000	1.101
+++ debugger.cpp	26 Dec 2003 23:11:33 -0000	1.102
@@ -268,8 +268,8 @@
 	scriptnum = atoi(argv[1]);
 
 	// FIXME: what is the max range on these?
-	// if (scriptnum >= _vm->_maxScripts) {
-	//	DebugPrintf("Script number %d is out of range (range: 1 - %d)\n", scriptnum, _vm->_maxScripts);
+	// if (scriptnum >= _vm->_numScripts) {
+	//	DebugPrintf("Script number %d is out of range (range: 1 - %d)\n", scriptnum, _vm->_numScripts);
 	//	return true;
 	//}
 
@@ -449,7 +449,7 @@
 	}
 
 	if (!strcmp(argv[2], "pickup")) {
-		for (i = 0; i < _vm->_maxInventoryItems; i++) {
+		for (i = 0; i < _vm->_numInventory; i++) {
 			if (_vm->_inventory[i] == (uint16)obj) {
 				_vm->putOwner(obj, _vm->VAR(_vm->VAR_EGO));
 				_vm->runInventoryScript(obj);

Index: object.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/object.cpp,v
retrieving revision 1.153
retrieving revision 1.154
diff -u -d -r1.153 -r1.154
--- object.cpp	25 Dec 2003 21:56:12 -0000	1.153
+++ object.cpp	26 Dec 2003 23:11:33 -0000	1.154
@@ -178,7 +178,7 @@
 		return WIO_NOT_FOUND;
 
 	if (_objectOwnerTable[object] != OF_OWNER_ROOM) {
-		for (i = 0; i < _maxInventoryItems; i++)
+		for (i = 0; i < _numInventory; i++)
 			if (_inventory[i] == object)
 				return WIO_INVENTORY;
 		return WIO_NOT_FOUND;
@@ -829,7 +829,7 @@
 		return;
 	}
 
-	for (i = 0; i < _maxInventoryItems; i++) {
+	for (i = 0; i < _numInventory; i++) {
 		if (_inventory[i] == obj) {
 			j = whereIsObject(obj);
 			if (j == WIO_INVENTORY) {
@@ -837,7 +837,7 @@
 				_inventory[i] = 0;
 			}
 			a = _inventory;
-			for (i = 0; i < _maxInventoryItems - 1; i++, a++) {
+			for (i = 0; i < _numInventory - 1; i++, a++) {
 				if (!a[0] && a[1]) {
 					a[0] = a[1];
 					a[1] = 0;
@@ -941,7 +941,7 @@
 	byte *ptr;
 
 	if (_objectOwnerTable[obj] != OF_OWNER_ROOM) {
-		for (i = 0; i < _maxInventoryItems; i++) {
+		for (i = 0; i < _numInventory; i++) {
 			if (_inventory[i] == obj)
 				return getResourceAddress(rtInventory, i);
 		}
@@ -1180,11 +1180,11 @@
 
 int ScummEngine::getInventorySlot() {
 	int i;
-	for (i = 0; i < _maxInventoryItems; i++) {
+	for (i = 0; i < _numInventory; i++) {
 		if (_inventory[i] == 0)
 			return i;
 	}
-	error("Inventory full, %d max items", _maxInventoryItems);
+	error("Inventory full, %d max items", _numInventory);
 	return -1;
 }
 
@@ -1269,7 +1269,7 @@
 
 int ScummEngine::findInventory(int owner, int idx) {
 	int count = 1, i, obj;
-	for (i = 0; i < _maxInventoryItems; i++) {
+	for (i = 0; i < _numInventory; i++) {
 		obj = _inventory[i];
 		if (obj && getOwner(obj) == owner && count++ == idx)
 			return obj;
@@ -1280,7 +1280,7 @@
 int ScummEngine::getInventoryCount(int owner) {
 	int i, obj;
 	int count = 0;
-	for (i = 0; i < _maxInventoryItems; i++) {
+	for (i = 0; i < _numInventory; i++) {
 		obj = _inventory[i];
 		if (obj && getOwner(obj) == owner)
 			count++;
@@ -1587,7 +1587,7 @@
 
 int ScummEngine::findFlObjectSlot() {
 	int i;
-	for (i = 1; i < _maxFLObject; i++) {
+	for (i = 1; i < _numFlObject; i++) {
 		if (_baseFLObject[i] == NULL)
 			return i;
 	}

Index: resource.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/resource.cpp,v
retrieving revision 1.178
retrieving revision 1.179
diff -u -d -r1.178 -r1.179
--- resource.cpp	25 Dec 2003 15:09:23 -0000	1.178
+++ resource.cpp	26 Dec 2003 23:11:34 -0000	1.179
@@ -163,7 +163,7 @@
 	if (!(_features & GF_SMALL_HEADER) && !_dynamicRoomOffsets)
 		return;
 
-	for (int i = 0; i < _maxRooms; i++) {
+	for (int i = 0; i < _numRooms; i++) {
 		if (_roomFileOffsets[i] != 0xFFFFFFFF)
 			_roomFileOffsets[i] = 0;
 	}
@@ -559,7 +559,7 @@
 		no = 1;
 
 	assert(no < (int)sizeof(_charsetData) / 16);
-	checkRange(_maxCharsets - 1, 1, no, "Loading illegal charset %d");
+	checkRange(_numCharsets - 1, 1, no, "Loading illegal charset %d");
 
 //  ensureResourceLoaded(rtCharset, no);
 	ptr = getResourceAddress(rtCharset, no);
@@ -572,7 +572,7 @@
 }
 
 void ScummEngine::nukeCharset(int i) {
-	checkRange(_maxCharsets - 1, 1, i, "Nuking illegal charset %d");
+	checkRange(_numCharsets - 1, 1, i, "Nuking illegal charset %d");
 	nukeResource(rtCharset, i);
 }
 

Index: script.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script.cpp,v
retrieving revision 1.138
retrieving revision 1.139
diff -u -d -r1.138 -r1.139
--- script.cpp	15 Dec 2003 20:33:40 -0000	1.138
+++ script.cpp	26 Dec 2003 23:11:34 -0000	1.139
@@ -345,11 +345,11 @@
 	ss = &vm.slot[_currentScript];
 	switch (ss->where) {
 	case WIO_INVENTORY:					/* inventory script * */
-		for (idx = 0; idx < _maxInventoryItems; idx++)
+		for (idx = 0; idx < _numInventory; idx++)
 			if (_inventory[idx] == ss->number)
 				break;
 		_scriptOrgPointer = getResourceAddress(rtInventory, idx);
-		assert(idx < _maxInventoryItems);
+		assert(idx < _numInventory);
 		_lastCodePtr = &_baseInventoryItems[idx];
 		break;
 
@@ -361,21 +361,21 @@
 			_lastCodePtr = &res.address[rtRoomScripts][_roomResource];
 		} else {
 			_scriptOrgPointer = getResourceAddress(rtRoom, _roomResource);
-			assert(_roomResource < _maxRooms);
+			assert(_roomResource < _numRooms);
 			_lastCodePtr = &_baseRooms[_roomResource];
 		}
 		break;
 
 	case WIO_GLOBAL:							/* global script */
 		_scriptOrgPointer = getResourceAddress(rtScript, ss->number);
-		assert(ss->number < _maxScripts);
+		assert(ss->number < _numScripts);
 		_lastCodePtr = &_baseScripts[ss->number];
 		break;
 
 	case WIO_FLOBJECT:						/* flobject script */
 		idx = getObjectIndex(ss->number);
 		_scriptOrgPointer = getResourceAddress(rtFlObject, _objs[idx].fl_object_index);
-		assert(idx < _maxFLObject);
+		assert(idx < _numFlObject);
 		_lastCodePtr = &_baseFLObject[idx];
 		break;
 	default:

Index: script_v2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v2.cpp,v
retrieving revision 2.222
retrieving revision 2.223
diff -u -d -r2.222 -r2.223
--- script_v2.cpp	17 Dec 2003 17:35:40 -0000	2.222
+++ script_v2.cpp	26 Dec 2003 23:11:34 -0000	2.223
@@ -789,7 +789,7 @@
 	switch (verb) {
 	case 0:		// SO_DELETE_VERBS
 		slot = getVarOrDirectByte(PARAM_1) + 1;
-		assert(0 < slot && slot < _maxVerbs);
+		assert(0 < slot && slot < _numVerbs);
 
 		//printf("o2_verbOps delete slot = %d\n", slot);
 		killVerb(slot);
@@ -819,7 +819,7 @@
 		//		verb, slot, x, y, prep, _scriptPointer);
 
 		VerbSlot *vs;
-		assert(0 < slot && slot < _maxVerbs);
+		assert(0 < slot && slot < _numVerbs);
 
 		vs = &_verbs[slot];
 		vs->verbid = verb;

Index: script_v5.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v5.cpp,v
retrieving revision 1.214
retrieving revision 1.215
diff -u -d -r1.214 -r1.215
--- script_v5.cpp	25 Dec 2003 21:33:30 -0000	1.214
+++ script_v5.cpp	26 Dec 2003 23:11:34 -0000	1.215
@@ -2395,7 +2395,7 @@
 	verb = getVarOrDirectByte(PARAM_1);
 
 	slot = getVerbSlot(verb, 0);
-	checkRange(_maxVerbs - 1, 0, slot, "Illegal new verb slot %d");
+	checkRange(_numVerbs - 1, 0, slot, "Illegal new verb slot %d");
 
 	vs = &_verbs[slot];
 	vs->verbid = verb;
@@ -2490,11 +2490,11 @@
 		case 9:		// SO_VERB_NEW
 			slot = getVerbSlot(verb, 0);
 			if (slot == 0) {
-				for (slot = 1; slot < _maxVerbs; slot++) {
+				for (slot = 1; slot < _numVerbs; slot++) {
 					if (_verbs[slot].verbid == 0)
 						break;
 				}
-				if (slot == _maxVerbs)
+				if (slot == _numVerbs)
 					error("Too many verbs");
 			}
 			vs = &_verbs[slot];

Index: script_v6.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v6.cpp,v
retrieving revision 1.223
retrieving revision 1.224
diff -u -d -r1.223 -r1.224
--- script_v6.cpp	25 Dec 2003 21:56:12 -0000	1.223
+++ script_v6.cpp	26 Dec 2003 23:11:34 -0000	1.224
@@ -38,8 +38,10 @@
 #include "sound/mixer.h"
 
 #include "scumm/smush/insane.h"
+#ifndef INSANE
 #include "scumm/dialogs.h"		// FIXME: This is just for the FT-INSANE warning. 
 				// Remove when INSANE is implemented
+#endif
 
 namespace Scumm {
 
@@ -1134,7 +1136,7 @@
 	if (room == 0)
 		room = _roomResource;
 
-	for (i = 0; i < _maxInventoryItems; i++) {
+	for (i = 0; i < _numInventory; i++) {
 		if (_inventory[i] == (uint16)obj) {
 			putOwner(obj, VAR(VAR_EGO));
 			runInventoryScript(obj);
@@ -1829,7 +1831,7 @@
 	if (op == 196) {
 		_curVerb = pop();
 		_curVerbSlot = getVerbSlot(_curVerb, 0);
-		checkRange(_maxVerbs - 1, 0, _curVerbSlot, "Illegal new verb slot %d");
+		checkRange(_numVerbs - 1, 0, _curVerbSlot, "Illegal new verb slot %d");
 		return;
 	}
 	vs = &_verbs[_curVerbSlot];
@@ -1873,11 +1875,11 @@
 	case 132:		// SO_VERB_NEW
 		slot = getVerbSlot(_curVerb, 0);
 		if (slot == 0) {
-			for (slot = 1; slot < _maxVerbs; slot++) {
+			for (slot = 1; slot < _numVerbs; slot++) {
 				if (_verbs[slot].verbid == 0)
 					break;
 			}
-			if (slot == _maxVerbs)
+			if (slot == _numVerbs)
 				error("Too many verbs");
 			_curVerbSlot = slot;
 		}

Index: script_v8.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v8.cpp,v
retrieving revision 2.209
retrieving revision 2.210
diff -u -d -r2.209 -r2.210
--- script_v8.cpp	26 Dec 2003 13:13:56 -0000	2.209
+++ script_v8.cpp	26 Dec 2003 23:11:35 -0000	2.210
@@ -1114,12 +1114,12 @@
 	if (subOp == 0x96) {
 		_curVerb = pop();
 		_curVerbSlot = getVerbSlot(_curVerb, 0);
-		checkRange(_maxVerbs - 1, 0, _curVerbSlot, "Illegal new verb slot %d");
+		checkRange(_numVerbs - 1, 0, _curVerbSlot, "Illegal new verb slot %d");
 		//printf("Setting current actor to %d\n", _curActor);
 		return;
 	}
 
-	assert(0 <= _curVerbSlot && _curVerbSlot < _maxVerbs);
+	assert(0 <= _curVerbSlot && _curVerbSlot < _numVerbs);
 	vs = &_verbs[_curVerbSlot];
 	assert(vs);
 
@@ -1129,11 +1129,11 @@
 		break;
 	case 0x97:		// SO_VERB_NEW New verb
 		if (_curVerbSlot == 0) {
-			for (slot = 1; slot < _maxVerbs; slot++) {
+			for (slot = 1; slot < _numVerbs; slot++) {
 				if (_verbs[slot].verbid == 0)
 					break;
 			}
-			if (slot >= _maxVerbs) {
+			if (slot >= _numVerbs) {
 				error("Too many verbs");
 			}
 			_curVerbSlot = slot;

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.337
retrieving revision 1.338
diff -u -d -r1.337 -r1.338
--- scumm.h	25 Dec 2003 02:55:00 -0000	1.337
+++ scumm.h	26 Dec 2003 23:11:35 -0000	1.338
@@ -195,21 +195,6 @@
 	GID_MONKEY_SEGA
 };
 
-#define _maxRooms res.num[rtRoom]
-#define _maxScripts res.num[rtScript]
-#define _maxCostumes res.num[rtCostume]
-#define _maxInventoryItems res.num[rtInventory]
-#define _maxCharsets res.num[rtCharset]
-#define _maxStrings res.num[rtString]
-#define _maxVerbs res.num[rtVerb]
-#define _maxActorNames res.num[rtActorName]
-#define _maxBuffer res.num[rtBuffer]
-#define _maxScaleTable res.num[rtScaleTable]
-#define _maxTemp res.num[rtTemp]
-#define _maxFLObject res.num[rtFlObject]
-#define _maxMatrixes res.num[rtMatrix]
-#define _maxBoxes res.num[rtBox]
-
 #define _baseRooms res.address[rtRoom]
 #define _baseScripts res.address[rtScript]
 #define _baseInventoryItems res.address[rtInventory]
@@ -286,6 +271,7 @@
 	/** Graphics manager */
 	Gdi gdi;
 
+protected:
 	/** Central resource data. */
 	struct {
 		byte mode[rtNumTypes];
@@ -298,7 +284,6 @@
 		uint32 *roomoffs[rtNumTypes];
 	} res;
 
-protected:
 	VirtualMachineState vm;
 
 public:
@@ -396,10 +381,11 @@
 	int _numVariables, _numBitVariables, _numLocalObjects;
 	int _numGlobalObjects, _numArray, _numVerbs, _numFlObject;
 	int _numInventory, _numRooms, _numScripts, _numSounds;
-	int _numCharsets, _numNewNames, _numGlobalScripts;
+	int _numNewNames, _numGlobalScripts;
 	int _numActors;
 public:
 	int _numCostumes;	// FIXME - should be protected, used by Actor::remapActorPalette
+	int _numCharsets;	// FIXME - should be protected, used by CharsetRenderer
 
 	int getNumSounds() const { return _numSounds; }
 	BaseCostumeRenderer* _costumeRenderer;

Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scummvm.cpp,v
retrieving revision 2.519
retrieving revision 2.520
diff -u -d -r2.519 -r2.520
--- scummvm.cpp	26 Dec 2003 07:31:39 -0000	2.519
+++ scummvm.cpp	26 Dec 2003 23:11:35 -0000	2.520
@@ -961,6 +961,12 @@
 	if (_gameId == GID_MONKEY || _gameId == GID_MONKEY_SEGA)
 		_scummVars[74] = 1225;
 
+	if (_imuse) {
+		_imuse->setBase(res.address[rtSound]);
+
+		_imuse->setMasterVolume(ConfMan.getInt("master_volume"));
+		_imuse->set_music_volume(ConfMan.getInt("music_volume"));
+	}
 	_sound->setupSound();
 
 	// If requested, load a save game instead of running the boot script
@@ -1062,7 +1068,7 @@
 	memset(vm.cutScenePtr, 0, sizeof(vm.cutScenePtr));
 	memset(vm.cutSceneData, 0, sizeof(vm.cutSceneData));
 
-	for (i = 0; i < _maxVerbs; i++) {
+	for (i = 0; i < _numVerbs; i++) {
 		_verbs[i].verbid = 0;
 		_verbs[i].right = _screenWidth - 1;
 		_verbs[i].old.left = -1;
@@ -1448,7 +1454,7 @@
 			if (VAR(value) == 2)
 				runScript(restoreScript, 0, 0, &args);
 		} else if (_version > 3) {
-			for (int i = 0; i < _maxVerbs; i++)
+			for (int i = 0; i < _numVerbs; i++)
 				drawVerb(i, 0);
 		} else {
 			redrawVerbs();
@@ -2141,7 +2147,7 @@
 	nukeResource(rtMatrix, 1);
 	nukeResource(rtMatrix, 2);
 
-	for (i = 1; i < _maxScaleTable; i++)
+	for (i = 1; i < res.num[rtScaleTable]; i++)
 		nukeResource(rtScaleTable, i);
 
 	memset(_localScriptList, 0, sizeof(_localScriptList));
@@ -2316,7 +2322,7 @@
 	if (ptr) {
 		int s1, s2, y1, y2;
 		if (_version == 8) {
-			for (i = 1; i < _maxScaleTable; i++, ptr += 16) {
+			for (i = 1; i < res.num[rtScaleTable]; i++, ptr += 16) {
 				s1 = READ_LE_UINT32(ptr);
 				y1 = READ_LE_UINT32(ptr + 4);
 				s2 = READ_LE_UINT32(ptr + 8);
@@ -2324,7 +2330,7 @@
 				setScaleSlot(i, 0, y1, s1, 0, y2, s2);
 			}
 		} else {
-			for (i = 1; i < _maxScaleTable; i++, ptr += 8) {
+			for (i = 1; i < res.num[rtScaleTable]; i++, ptr += 8) {
 				s1 = READ_LE_UINT16(ptr);
 				y1 = READ_LE_UINT16(ptr + 2);
 				s2 = READ_LE_UINT16(ptr + 4);
@@ -2521,6 +2527,9 @@
 	readIndexFile();                    // Reread index (reset objectstate etc)
 	createResource(rtTemp, 6, 500);     // Create temp buffer
 	initScummVars();                    // Reinit scumm variables
+	if (_imuse) {
+		_imuse->setBase(res.address[rtSound]);
+	}
 	_sound->setupSound();               // Reinit sound engine
 
 	// Re-run bootscript

Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/sound.cpp,v
retrieving revision 1.299
retrieving revision 1.300
diff -u -d -r1.299 -r1.300
--- sound.cpp	26 Dec 2003 13:13:56 -0000	1.299
+++ sound.cpp	26 Dec 2003 23:11:35 -0000	1.300
@@ -762,12 +762,6 @@
  */
 
 void Sound::setupSound() {
-	if (_scumm->_imuse) {
-		_scumm->_imuse->setBase(_scumm->res.address[rtSound]);
-
-		_scumm->_imuse->setMasterVolume(ConfMan.getInt("master_volume"));
-		_scumm->_imuse->set_music_volume(ConfMan.getInt("music_volume"));
-	}
 	delete _sfxFile;
 	_sfxFile = openSfxFile();
 }

Index: string.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/string.cpp,v
retrieving revision 1.174
retrieving revision 1.175
diff -u -d -r1.174 -r1.175
--- string.cpp	26 Dec 2003 13:13:56 -0000	1.174
+++ string.cpp	26 Dec 2003 23:11:35 -0000	1.175
@@ -599,7 +599,7 @@
 
 	num = readVar(var);
 	if (num) {
-		for (k = 1; k < _maxVerbs; k++) {
+		for (k = 1; k < _numVerbs; k++) {
 			if (num == _verbs[k].verbid && !_verbs[k].type && !_verbs[k].saveid) {
 				const byte *ptr = getResourceAddress(rtVerb, k);
 				ptr = translateTextAndPlaySpeech(ptr);

Index: verbs.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/verbs.cpp,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -d -r1.83 -r1.84
--- verbs.cpp	15 Dec 2003 14:54:35 -0000	1.83
+++ verbs.cpp	26 Dec 2003 23:11:35 -0000	1.84
@@ -267,7 +267,7 @@
 
 	int i;
 	int verb = (_cursor.state > 0 ? checkMouseOver(_mouse.x, _mouse.y) : 0);
-	for (i = _maxVerbs-1; i >= 0; i--) {
+	for (i = _numVerbs-1; i >= 0; i--) {
 		if (i == verb && _verbs[verb].hicolor)
 			drawVerb(i, 1);
 		else
@@ -286,7 +286,7 @@
 	if (_mouseButStat < MBS_MAX_KEY) {
 		/* Check keypresses */
 		vs = &_verbs[1];
-		for (i = 1; i < _maxVerbs; i++, vs++) {
+		for (i = 1; i < _numVerbs; i++, vs++) {
 			if (vs->verbid && vs->saveid == 0 && vs->curmode == 1) {
 				if (_mouseButStat == vs->key) {
 					// Trigger verb as if the user clicked it
@@ -340,7 +340,7 @@
 
 int ScummEngine::checkMouseOver(int x, int y) const {
 	VerbSlot *vs;
-	int i = _maxVerbs - 1;
+	int i = _numVerbs - 1;
 
 	vs = &_verbs[i];
 	do {
@@ -503,7 +503,7 @@
 
 int ScummEngine::getVerbSlot(int id, int mode) const {
 	int i;
-	for (i = 1; i < _maxVerbs; i++) {
+	for (i = 1; i < _numVerbs; i++) {
 		if (_verbs[i].verbid == id && _verbs[i].saveid == mode) {
 			return i;
 		}





More information about the Scummvm-git-logs mailing list