aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/he
diff options
context:
space:
mode:
authorMax Horn2006-10-20 19:44:27 +0000
committerMax Horn2006-10-20 19:44:27 +0000
commit5e9041b1b558f8891435204b15e1db41f0686ad9 (patch)
tree1afbae9cf1e596e046e54fd1c29942d5860dc8dd /engines/scumm/he
parentff574a63ee368cdb4889dd0e17966b4a1ae1f117 (diff)
downloadscummvm-rg350-5e9041b1b558f8891435204b15e1db41f0686ad9.tar.gz
scummvm-rg350-5e9041b1b558f8891435204b15e1db41f0686ad9.tar.bz2
scummvm-rg350-5e9041b1b558f8891435204b15e1db41f0686ad9.zip
SCUMM: ArrayHeader related cleanup
svn-id: r24395
Diffstat (limited to 'engines/scumm/he')
-rw-r--r--engines/scumm/he/intern_he.h2
-rw-r--r--engines/scumm/he/script_v100he.cpp10
-rw-r--r--engines/scumm/he/script_v60he.cpp10
-rw-r--r--engines/scumm/he/script_v70he.cpp6
-rw-r--r--engines/scumm/he/script_v72he.cpp30
-rw-r--r--engines/scumm/he/script_v80he.cpp6
6 files changed, 32 insertions, 32 deletions
diff --git a/engines/scumm/he/intern_he.h b/engines/scumm/he/intern_he.h
index e538927a50..35d026dbb1 100644
--- a/engines/scumm/he/intern_he.h
+++ b/engines/scumm/he/intern_he.h
@@ -276,7 +276,7 @@ protected:
virtual void redrawBGAreas();
- ArrayHeader *defineArray(int array, int type, int dim2start, int dim2end, int dim1start, int dim1end);
+ byte *defineArray(int array, int type, int dim2start, int dim2end, int dim1start, int dim1end);
virtual int readArray(int array, int idx2, int idx1);
virtual void writeArray(int array, int idx2, int idx1, int value);
void redimArray(int arrayId, int newDim2start, int newDim2end,
diff --git a/engines/scumm/he/script_v100he.cpp b/engines/scumm/he/script_v100he.cpp
index d3ac0c2f32..0001d539fd 100644
--- a/engines/scumm/he/script_v100he.cpp
+++ b/engines/scumm/he/script_v100he.cpp
@@ -580,7 +580,7 @@ void ScummEngine_v100he::o100_actorOps() {
}
void ScummEngine_v100he::o100_arrayOps() {
- ArrayHeader *ah;
+ byte *data;
byte string[1024];
int dim1end, dim1start, dim2end, dim2start;
int id, len, b, c, list[128];
@@ -595,14 +595,14 @@ void ScummEngine_v100he::o100_arrayOps() {
case 35:
decodeScriptString(string);
len = resStrLen(string);
- ah = defineArray(array, kStringArray, 0, 0, 0, len);
- memcpy(ah->data, string, len);
+ data = defineArray(array, kStringArray, 0, 0, 0, len);
+ memcpy(data, string, len);
break;
case 77: // SO_ASSIGN_STRING
copyScriptString(string, sizeof(string));
len = resStrLen(string);
- ah = defineArray(array, kStringArray, 0, 0, 0, len);
- memcpy(ah->data, string, len);
+ data = defineArray(array, kStringArray, 0, 0, 0, len);
+ memcpy(data, string, len);
break;
case 128: // SO_ASSIGN_2DIM_LIST
diff --git a/engines/scumm/he/script_v60he.cpp b/engines/scumm/he/script_v60he.cpp
index 7610f9df01..6165f42495 100644
--- a/engines/scumm/he/script_v60he.cpp
+++ b/engines/scumm/he/script_v60he.cpp
@@ -856,7 +856,7 @@ uint8 virtScreenLoadUnpack(vsUnpackCtx *ctx, byte *data) {
void ScummEngine_v60he::o60_kernelGetFunctions() {
int args[29];
- ArrayHeader *ah;
+ byte *data;
getStackList(args, ARRAYSIZE(args));
switch (args[0]) {
@@ -864,8 +864,8 @@ void ScummEngine_v60he::o60_kernelGetFunctions() {
// Used to store images when decorating cake in
// Fatty Bear's Birthday Surprise
writeVar(0, 0);
- ah = defineArray(0, kByteArray, 0, virtScreenSave(0, args[1], args[2], args[3], args[4]));
- virtScreenSave(ah->data, args[1], args[2], args[3], args[4]);
+ data = defineArray(0, kByteArray, 0, virtScreenSave(0, args[1], args[2], args[3], args[4]));
+ virtScreenSave(data, args[1], args[2], args[3], args[4]);
push(readVar(0));
break;
default:
@@ -1078,8 +1078,8 @@ int ScummEngine_v60he::readFileToArray(int slot, int32 size) {
size = _hInFileTable[slot]->size() - _hInFileTable[slot]->pos();
writeVar(0, 0);
- ArrayHeader *ah = defineArray(0, kByteArray, 0, size);
- _hInFileTable[slot]->read(ah->data, size);
+ byte *data = defineArray(0, kByteArray, 0, size);
+ _hInFileTable[slot]->read(data, size);
return readVar(0);
}
diff --git a/engines/scumm/he/script_v70he.cpp b/engines/scumm/he/script_v70he.cpp
index 133d802311..c5dc545732 100644
--- a/engines/scumm/he/script_v70he.cpp
+++ b/engines/scumm/he/script_v70he.cpp
@@ -927,7 +927,7 @@ void ScummEngine_v70he::o70_isResourceLoaded() {
void ScummEngine_v70he::o70_readINI() {
byte option[256];
- ArrayHeader *ah;
+ byte *data;
const char *entry;
int len, type;
@@ -951,8 +951,8 @@ void ScummEngine_v70he::o70_readINI() {
writeVar(0, 0);
len = resStrLen((const byte *)entry);
- ah = defineArray(0, kStringArray, 0, len);
- memcpy(ah->data, entry, len);
+ data = defineArray(0, kStringArray, 0, len);
+ memcpy(data, entry, len);
push(readVar(0));
break;
diff --git a/engines/scumm/he/script_v72he.cpp b/engines/scumm/he/script_v72he.cpp
index db54180f5b..adc81ba992 100644
--- a/engines/scumm/he/script_v72he.cpp
+++ b/engines/scumm/he/script_v72he.cpp
@@ -381,7 +381,7 @@ const char *ScummEngine_v72he::getOpcodeDesc(byte i) {
static const int arrayDataSizes[] = { 0, 1, 4, 8, 8, 16, 32 };
-ScummEngine_v72he::ArrayHeader *ScummEngine_v72he::defineArray(int array, int type, int dim2start, int dim2end,
+byte *ScummEngine_v72he::defineArray(int array, int type, int dim2start, int dim2end,
int dim1start, int dim1end) {
int id;
int size;
@@ -427,7 +427,7 @@ ScummEngine_v72he::ArrayHeader *ScummEngine_v72he::defineArray(int array, int ty
ah->dim2start = TO_LE_32(dim2start);
ah->dim2end = TO_LE_32(dim2end);
- return ah;
+ return ah->data;
}
int ScummEngine_v72he::readArray(int array, int idx2, int idx1) {
@@ -1395,7 +1395,7 @@ void ScummEngine_v72he::o72_findObject() {
}
void ScummEngine_v72he::o72_arrayOps() {
- ArrayHeader *ah;
+ byte *data;
byte string[1024];
int dim1end, dim1start, dim2end, dim2start;
int id, len, b, c, list[128];
@@ -1410,8 +1410,8 @@ void ScummEngine_v72he::o72_arrayOps() {
case 7: // SO_ASSIGN_STRING
copyScriptString(string, sizeof(string));
len = resStrLen(string);
- ah = defineArray(array, kStringArray, 0, 0, 0, len);
- memcpy(ah->data, string, len);
+ data = defineArray(array, kStringArray, 0, 0, 0, len);
+ memcpy(data, string, len);
break;
case 126:
@@ -1489,8 +1489,8 @@ void ScummEngine_v72he::o72_arrayOps() {
case 194:
decodeScriptString(string);
len = resStrLen(string);
- ah = defineArray(array, kStringArray, 0, 0, 0, len);
- memcpy(ah->data, string, len);
+ data = defineArray(array, kStringArray, 0, 0, 0, len);
+ memcpy(data, string, len);
break;
case 208: // SO_ASSIGN_INT_LIST
b = pop();
@@ -1661,14 +1661,14 @@ void ScummEngine_v72he::o72_traceStatus() {
void ScummEngine_v72he::o72_kernelGetFunctions() {
int args[29];
- ArrayHeader *ah;
+ byte *data;
getStackList(args, ARRAYSIZE(args));
switch (args[0]) {
case 1:
writeVar(0, 0);
- ah = defineArray(0, kByteArray, 0, 0, 0, virtScreenSave(0, args[1], args[2], args[3], args[4]));
- virtScreenSave(ah->data, args[1], args[2], args[3], args[4]);
+ data = defineArray(0, kByteArray, 0, 0, 0, virtScreenSave(0, args[1], args[2], args[3], args[4]));
+ virtScreenSave(data, args[1], args[2], args[3], args[4]);
push(readVar(0));
break;
default:
@@ -1772,8 +1772,8 @@ int ScummEngine_v72he::readFileToArray(int slot, int32 size) {
size = _hInFileTable[slot]->size() - _hInFileTable[slot]->pos();
writeVar(0, 0);
- ArrayHeader *ah = defineArray(0, kByteArray, 0, 0, 0, size);
- _hInFileTable[slot]->read(ah->data, size + 1);
+ byte *data = defineArray(0, kByteArray, 0, 0, 0, size);
+ _hInFileTable[slot]->read(data, size + 1);
return readVar(0);
}
@@ -2107,7 +2107,7 @@ void ScummEngine_v72he::copyArrayHelper(ArrayHeader *ah, int idx2, int idx1, int
void ScummEngine_v72he::o72_readINI() {
byte option[128];
- ArrayHeader *ah;
+ byte *data;
const char *entry;
int len;
@@ -2131,8 +2131,8 @@ void ScummEngine_v72he::o72_readINI() {
writeVar(0, 0);
len = resStrLen((const byte *)entry);
- ah = defineArray(0, kStringArray, 0, 0, 0, len);
- memcpy(ah->data, entry, len);
+ data = defineArray(0, kStringArray, 0, 0, 0, len);
+ memcpy(data, entry, len);
push(readVar(0));
break;
diff --git a/engines/scumm/he/script_v80he.cpp b/engines/scumm/he/script_v80he.cpp
index 6ede98b2ec..5f4816ce9e 100644
--- a/engines/scumm/he/script_v80he.cpp
+++ b/engines/scumm/he/script_v80he.cpp
@@ -447,7 +447,7 @@ void ScummEngine_v80he::o80_sourceDebug() {
void ScummEngine_v80he::o80_readConfigFile() {
byte option[128], section[128], filename[256];
- ArrayHeader *ah;
+ byte *data;
Common::String entry;
int len, r;
@@ -477,8 +477,8 @@ void ScummEngine_v80he::o80_readConfigFile() {
writeVar(0, 0);
len = resStrLen((const byte *)entry.c_str());
- ah = defineArray(0, kStringArray, 0, 0, 0, len);
- memcpy(ah->data, entry.c_str(), len);
+ data = defineArray(0, kStringArray, 0, 0, 0, len);
+ memcpy(data, entry.c_str(), len);
push(readVar(0));
break;
default: