aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Brown2002-03-09 00:56:22 +0000
committerJames Brown2002-03-09 00:56:22 +0000
commit72518be8f1a03d73b12944a4e15350c4d8cb0888 (patch)
treee7a6b076a75a34575f94fc4e489452a47f4f0a69
parentf35c801db44093faec0b430a7727fa1e2510f26d (diff)
downloadscummvm-rg350-72518be8f1a03d73b12944a4e15350c4d8cb0888.tar.gz
scummvm-rg350-72518be8f1a03d73b12944a4e15350c4d8cb0888.tar.bz2
scummvm-rg350-72518be8f1a03d73b12944a4e15350c4d8cb0888.zip
Fixed NUM_aCTORS for MI2/Indy4, etc.
Probably broke some saved games again. svn-id: r3700
-rw-r--r--actor.cpp4
-rw-r--r--debug.cpp2
-rw-r--r--gfx.cpp6
-rw-r--r--script.cpp2
-rw-r--r--script_v1.cpp6
-rw-r--r--scumm.h16
-rw-r--r--scummvm.cpp6
7 files changed, 26 insertions, 16 deletions
diff --git a/actor.cpp b/actor.cpp
index 3650c9e68a..7811345037 100644
--- a/actor.cpp
+++ b/actor.cpp
@@ -785,7 +785,7 @@ void Scumm::walkActor(Actor *a) {
void Scumm::processActors() {
int i;
- Actor *actors[NUM_ACTORS],*a,**ac,**ac2,*tmp;
+ Actor *actors[MAX_ACTORS], *a,**ac,**ac2,*tmp;
int numactors = 0, cnt,cnt2;
for (i=1; i<NUM_ACTORS; i++) {
@@ -938,7 +938,7 @@ void Scumm::actorAnimate(Actor *a) {
}
void Scumm::setActorRedrawFlags() {
- uint i,j;
+ int i,j;
uint32 bits;
for (i=0; i<40; i++) {
diff --git a/debug.cpp b/debug.cpp
index 91bdf24f4d..7a0b720e0f 100644
--- a/debug.cpp
+++ b/debug.cpp
@@ -270,7 +270,7 @@ void ScummDebugger::printActors(int act) {
printf("+--------------------------------------------------------------+\n");
printf("|# |room| x y |elev|cos|width|box|mov|zp|frame|scale|spd|dir|\n");
printf("+--+----+--------+----+---+-----+---+---+--+-----+-----+---+---+\n");
- for(i=1; i<NUM_ACTORS; i++) {
+ for(i=1; i<_s->NUM_ACTORS; i++) {
if (act==-1 || act==i) {
a = &_s->actor[i];
if (a->visible)
diff --git a/gfx.cpp b/gfx.cpp
index f2020fab92..4b5a8ac2b1 100644
--- a/gfx.cpp
+++ b/gfx.cpp
@@ -533,8 +533,8 @@ void Scumm::unkVirtScreen4(int a) {
unkScreenEffect6();
break;
case 129:
-// setDirtyRange(0, 0, vs->height);
-// updateDirtyScreen(0);
+ setDirtyRange(0, 0, vs->height);
+ updateDirtyScreen(0);
/* XXX: EGA_proc4(0); */
warning("EGA_proc4"); /* FIXME */
break;
@@ -545,7 +545,7 @@ void Scumm::unkVirtScreen4(int a) {
unkScreenEffect5(1);
break;
default:
- error("unkVirtScreen4: default case %d", a);
+ warning("unkVirtScreen4: default case %d", a);
}
}
diff --git a/script.cpp b/script.cpp
index b6e3a9f02a..d50adc9566 100644
--- a/script.cpp
+++ b/script.cpp
@@ -254,7 +254,7 @@ void Scumm::executeScript() {
_opcode = fetchScriptByte();
_scriptPointerStart = _scriptPointer;
vm.slot[_currentScript].didexec = 1;
- // debug(1, "[%X] %s()", _opcode, _opcodes_lookup[_opcode]);
+ //debug(1, "[%X] %s()", _opcode, _opcodes_lookup[_opcode]);
op = getOpcode(_opcode);
(this->*op)();
}
diff --git a/script_v1.cpp b/script_v1.cpp
index fafac0da36..06ca5c26df 100644
--- a/script_v1.cpp
+++ b/script_v1.cpp
@@ -1938,16 +1938,16 @@ void Scumm::o5_setObjectName() {
int a;
int i;
byte *name;
-
+
if (obj < NUM_ACTORS)
error("Can't set actor %d name with new-name-of", obj);
if (!getOBCDFromObject(obj))
error("Can't set name of object %d", obj);
- name = getObjOrActorName(obj);
+ name = getObjOrActorName(obj);
size = getResourceDataSize(name);
- i = 0;
+ i = 0;
while ((a = fetchScriptByte()) != 0) {
name[i++] = a;
diff --git a/scumm.h b/scumm.h
index 39bf12e30d..0bcaff536a 100644
--- a/scumm.h
+++ b/scumm.h
@@ -48,9 +48,10 @@ enum {
NUM_SCRIPT_SLOT = 25,
NUM_LOCALSCRIPT = 60,
NUM_SHADOW_PALETTE = 8,
- NUM_ACTORS = 30
+ MAX_ACTORS = 30
};
+
const uint16 many_direction_tab[18] = {
4,
8,
@@ -807,9 +808,9 @@ enum GameFeatures {
GF_DEFAULT = GF_USE_KEY,
GF_SMALL_HEADER = 32,
- GF_EXTERNAL_CHARSET = GF_SMALL_HEADER,
- GF_SMALL_NAMES = 64,
- GF_OLD_BUNDLE = 128,
+ GF_EXTERNAL_CHARSET = GF_SMALL_HEADER,
+ GF_SMALL_NAMES = 64,
+ GF_OLD_BUNDLE = 128,
GF_16COLOR = 256,
GF_OLD256 = 512,
GF_AUDIOTRACKS = 1024,
@@ -861,9 +862,10 @@ struct Scumm {
byte OF_OWNER_ROOM;
- int _gameTempo, _saveSound;
+ int _gameTempo, _saveSound;
int _lastLoadedRoom;
int _roomResource;
+
byte _encbyte;
void *_fileHandle;
void *_sfxFile;
@@ -1076,7 +1078,7 @@ struct Scumm {
int16 x,y;
} mouse;
- Actor actor[NUM_ACTORS];
+ Actor actor[MAX_ACTORS];
uint32 gfxUsageBits[200];
@@ -2116,6 +2118,8 @@ struct Scumm {
byte VAR_DEFAULT_TALK_DELAY;
byte VAR_CHARSET_MASK;
+ int NUM_ACTORS;
+
byte _videoPath[50];
};
diff --git a/scummvm.cpp b/scummvm.cpp
index 09c33fe8b4..4d0a3fc386 100644
--- a/scummvm.cpp
+++ b/scummvm.cpp
@@ -222,6 +222,12 @@ void Scumm::scummMain(int argc, char **argv) {
else
setupScummVarsOld();
+
+ if (_features & GF_AFTER_V6)
+ NUM_ACTORS = 30;
+ else
+ NUM_ACTORS = 13;
+
if(_features & GF_AFTER_V7)
OF_OWNER_ROOM = 0xFF;
else