Ticket #7898: variable_dimension_patch

File variable_dimension_patch, 2.8 KB (added by SF/japj, 19 years ago)

variable dimension patch

Line 
1Index: object.cpp
2===================================================================
3RCS file: /cvsroot/scummvm/scummvm/object.cpp,v
4retrieving revision 1.9
5diff -u -r1.9 object.cpp
6--- object.cpp 2001/11/06 20:00:47 1.9
7+++ object.cpp 2001/11/06 20:48:56
8@@ -578,8 +578,8 @@
9 numobj = READ_LE_UINT16(&roomhdr->numObjects);
10 if (numobj==0)
11 error("addObjectToInventory: No object found in room %d", room);
12- if (numobj > 200)
13- error("addObjectToInventory: More (%d) than %d objects in room %d", numobj, 200, room);
14+ if (numobj > _numLocalObjects)
15+ error("addObjectToInventory: More (%d) than %d objects in room %d", numobj, _numLocalObjects, room);
16
17 for (i=0; i<numobj; i++) {
18 obcdptr = findResource(MKID('OBCD'), roomptr, i);
19Index: scummvm.cpp
20===================================================================
21RCS file: /cvsroot/scummvm/scummvm/scummvm.cpp,v
22retrieving revision 1.17
23diff -u -r1.17 scummvm.cpp
24--- scummvm.cpp 2001/11/06 20:18:26 1.17
25+++ scummvm.cpp 2001/11/06 20:48:58
26@@ -31,17 +31,17 @@
27 _numVerbs = 100;
28
29 _inventory = (uint16*)alloc(0x50 * sizeof(uint16));
30- _verbs = (VerbSlot*)alloc(100 * sizeof(VerbSlot));
31- _objs = (ObjectData*)alloc(200 * sizeof(ObjectData));
32- _vars = (int16*)alloc(800 * sizeof(int16));
33- _bitVars = (byte*)alloc(2048 >> 3);
34+ _verbs = (VerbSlot*)alloc(_numVerbs * sizeof(VerbSlot));
35+ _objs = (ObjectData*)alloc(_numLocalObjects * sizeof(ObjectData));
36+ _vars = (int16*)alloc(_numVariables * sizeof(int16));
37+ _bitVars = (byte*)alloc(_numBitVariables >> 3);
38
39 allocResTypeData(5, MKID('NONE'), 0x50, "inventory", 0);
40 allocResTypeData(12,MKID('NONE'),10, "temp", 0);
41 allocResTypeData(11,MKID('NONE'),5, "scale table", 0);
42 allocResTypeData(9, MKID('NONE'),13,"actor name", 0);
43 allocResTypeData(10, MKID('NONE'),10,"buffer", 0);
44- allocResTypeData(8, MKID('NONE'),100,"verb", 0);
45+ allocResTypeData(8, MKID('NONE'),_numVerbs,"verb", 0);
46 allocResTypeData(7, MKID('NONE'),0x32,"string", 0);
47 allocResTypeData(13, MKID('NONE'),0x32,"flobject", 0);
48 allocResTypeData(14, MKID('NONE'),10,"boxes", 0);
49Index: verbs.cpp
50===================================================================
51RCS file: /cvsroot/scummvm/scummvm/verbs.cpp,v
52retrieving revision 1.6
53diff -u -r1.6 verbs.cpp
54--- verbs.cpp 2001/11/06 20:00:47 1.6
55+++ verbs.cpp 2001/11/06 20:48:58
56@@ -260,8 +260,8 @@
57 numobj = READ_LE_UINT16(&roomhdr->numObjects);
58 if (numobj==0)
59 error("No images found in room %d", room);
60- if (numobj > 200)
61- error("More (%d) than %d objects in room %d", numobj, 200, room);
62+ if (numobj > _numLocalObjects)
63+ error("More (%d) than %d objects in room %d", numobj, _numLocalObjects, room);
64
65 for (i=0; i<numobj; i++) {
66 obimptr = findResource(MKID('OBIM'), roomptr, i);