aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scumm/intern.h3
-rw-r--r--scumm/script_v100he.cpp45
-rw-r--r--scumm/script_v90he.cpp6
-rw-r--r--scumm/scumm.cpp1
-rw-r--r--scumm/sprite_he.cpp6
-rw-r--r--scumm/vars.cpp2
-rw-r--r--scumm/wiz_he.cpp27
-rw-r--r--scumm/wiz_he.h47
8 files changed, 85 insertions, 52 deletions
diff --git a/scumm/intern.h b/scumm/intern.h
index 41b101f678..b7a634c136 100644
--- a/scumm/intern.h
+++ b/scumm/intern.h
@@ -876,7 +876,7 @@ protected:
void drawWizComplexPolygon(int resNum, int state, int po_x, int po_y, int xmapNum, int angle, int zoom, const Common::Rect *r, int flags, int dstResNum, int paletteNum);
void captureWizImage(int resNum, const Common::Rect& r, bool frontBuffer, int compType);
void getWizImageDim(int resNum, int state, int32 &w, int32 &h);
- uint8 *drawWizImage(int resNum, int state, int x1, int y1, int xmapNum, const Common::Rect *clipBox, int flags, int dstResNum, int paletteNum);
+ uint8 *drawWizImage(int resNum, int state, int x1, int y1, int zorder, int xmapNum, int field_390, const Common::Rect *clipBox, int flags, int dstResNum, int paletteNum);
void drawWizPolygon(int resNum, int state, int id, int flags, int xmapNum, int dstResNum, int paletteNum);
void flushWizBuffer();
@@ -953,6 +953,7 @@ protected:
byte VAR_NUM_UNK;
byte VAR_POLYGONS_ONLY;
byte VAR_WINDOWS_VERSION;
+ byte VAR_U32_VERSION;
byte VAR_WIZ_TCOLOR;
};
diff --git a/scumm/script_v100he.cpp b/scumm/script_v100he.cpp
index 8e0045db86..801d3be9b4 100644
--- a/scumm/script_v100he.cpp
+++ b/scumm/script_v100he.cpp
@@ -1122,7 +1122,6 @@ void ScummEngine_v100he::o100_resourceRoutines() {
}
void ScummEngine_v100he::o100_wizImageOps() {
- byte filename[256];
int a, b;
byte subOp = fetchScriptByte();
@@ -1206,10 +1205,8 @@ void ScummEngine_v100he::o100_wizImageOps() {
break;
case 54:
_wizParams.processFlags |= 0x100000;
- //_wizParams.unk_180 = pop();
- //_wizParams.unk_184 = pop();
- pop();
- pop();
+ _wizParams.field_180 = pop();
+ _wizParams.field_184 = pop();
break;
case 55:
_wizParams.img.flags = pop();
@@ -1226,8 +1223,8 @@ void ScummEngine_v100he::o100_wizImageOps() {
case 58:
_wizParams.processFlags |= 0x1000 | 0x100 | 0x2;
_wizParams.processMode = 7;
- _wizParams.unk_164 = pop();
- _wizParams.unk_160 = pop();
+ _wizParams.field_168 = pop();
+ _wizParams.field_164 = pop();
_wizParams.compType = pop();
break;
case 64:
@@ -1247,7 +1244,7 @@ void ScummEngine_v100he::o100_wizImageOps() {
case 68:
_wizParams.processFlags |= kWPFNewFlags | kWPFSetPos | 2;
_wizParams.img.flags |= kWIFIsPolygon;
- _wizParams.unk_160 = _wizParams.img.y1 = _wizParams.img.x1 = pop();
+ _wizParams.field_164 = _wizParams.img.y1 = _wizParams.img.x1 = pop();
break;
case 70:
_wizParams.processFlags |= kWPFXmapNum;
@@ -1266,11 +1263,11 @@ void ScummEngine_v100he::o100_wizImageOps() {
processWizImage(&_wizParams);
break;
case 128:
- pop();
- pop();
- pop();
- pop();
- copyScriptString(filename, sizeof(filename));
+ _wizParams.field_239D = pop();
+ _wizParams.field_2399 = pop();
+ _wizParams.field_23A5 = pop();
+ _wizParams.field_23A1 = pop();
+ copyScriptString(_wizParams.string2, sizeof(_wizParams.string2));
_wizParams.processMode = 15;
break;
case 129:
@@ -1278,23 +1275,23 @@ void ScummEngine_v100he::o100_wizImageOps() {
break;
case 130:
_wizParams.processMode = 16;
- pop();
- pop();
- copyScriptString(filename, sizeof(filename));
+ _wizParams.field_23AD = pop();
+ _wizParams.field_23A9 = pop();
+ copyScriptString(_wizParams.string1, sizeof(_wizParams.string1));
break;
case 131:
_wizParams.processMode = 13;
break;
case 133:
_wizParams.processMode = 17;
- pop();
- pop();
- pop();
- pop();
- pop();
- pop();
- pop();
- pop();
+ _wizParams.field_23CD = pop();
+ _wizParams.field_23C9 = pop();
+ _wizParams.field_23C5 = pop();
+ _wizParams.field_23C1 = pop();
+ _wizParams.field_23BD = pop();
+ _wizParams.field_23B9 = pop();
+ _wizParams.field_23B5 = pop();
+ _wizParams.field_23B1 = pop();
break;
case 134:
_wizParams.processFlags |= kWPFFillColor | kWPFClipBox2;
diff --git a/scumm/script_v90he.cpp b/scumm/script_v90he.cpp
index 13b7ae0a9f..142fdd9858 100644
--- a/scumm/script_v90he.cpp
+++ b/scumm/script_v90he.cpp
@@ -693,8 +693,8 @@ void ScummEngine_v90he::o90_wizImageOps() {
case 85: // HE99+
_wizParams.processFlags |= 0x1000 | 0x100 | 0x2;
_wizParams.processMode = 7;
- _wizParams.unk_164 = pop();
- _wizParams.unk_160 = pop();
+ _wizParams.field_168 = pop();
+ _wizParams.field_164 = pop();
_wizParams.compType = pop();
break;
case 87: // HE99+
@@ -744,7 +744,7 @@ void ScummEngine_v90he::o90_wizImageOps() {
case 200:
_wizParams.processFlags |= kWPFNewFlags | kWPFSetPos | 2;
_wizParams.img.flags |= kWIFIsPolygon;
- _wizParams.unk_160 = _wizParams.img.y1 = _wizParams.img.x1 = pop();
+ _wizParams.field_164 = _wizParams.img.y1 = _wizParams.img.x1 = pop();
break;
case 209:
if (_wizParams.img.resNum)
diff --git a/scumm/scumm.cpp b/scumm/scumm.cpp
index 5cc818b037..94158ae417 100644
--- a/scumm/scumm.cpp
+++ b/scumm/scumm.cpp
@@ -1293,6 +1293,7 @@ ScummEngine_v72he::ScummEngine_v72he(GameDetector *detector, OSystem *syst, cons
VAR_NUM_UNK = 0xFF;
VAR_POLYGONS_ONLY = 0xFF;
VAR_WINDOWS_VERSION = 0xFF;
+ VAR_U32_VERSION = 0xFF;
VAR_WIZ_TCOLOR = 0xFF;
}
diff --git a/scumm/sprite_he.cpp b/scumm/sprite_he.cpp
index 8432a4795e..b4cf2ff316 100644
--- a/scumm/sprite_he.cpp
+++ b/scumm/sprite_he.cpp
@@ -1273,7 +1273,7 @@ void ScummEngine_v90he::spritesProcessWiz(bool arg) {
wiz.img.y1 = spi->ty - spr_wiz_y;
}
- //wiz.field_23EA = spi->field_90;
+ wiz.field_23EA = spi->field_90;
spi->curImageState = wiz.img.state = resState;
spi->curResId = wiz.img.resNum = resId;
wiz.processFlags = kWPFNewState | kWPFSetPos;
@@ -1339,8 +1339,8 @@ void ScummEngine_v90he::spritesProcessWiz(bool arg) {
wiz.img.flags |= kWIFRemapPalette;
if (spi->field_84) {
wiz.processFlags |= 0x200000;
- //wiz.field_390 = spi->field_84;
- //wiz.zorder = spi->zorderPriority;
+ wiz.img.field_390 = spi->field_84;
+ wiz.img.zorder = spi->zorderPriority;
}
if (spi->maskImgResNum) {
wiz.processFlags |= kWPFMaskImg;
diff --git a/scumm/vars.cpp b/scumm/vars.cpp
index 473cefdfae..9b7c3f2697 100644
--- a/scumm/vars.cpp
+++ b/scumm/vars.cpp
@@ -279,6 +279,7 @@ void ScummEngine_v72he::setupScummVars() {
if (_heversion >= 95) {
VAR_NUM_SPRITE_GROUPS = 105;
VAR_NUM_SPRITES = 106;
+ VAR_U32_VERSION = 107;
VAR_WIZ_TCOLOR = 117;
}
if (_heversion >= 98) {
@@ -564,6 +565,7 @@ void ScummEngine_v90he::initScummVars() {
if (_heversion >= 95) {
VAR(VAR_NUM_SPRITE_GROUPS) = MAX(64, _numSprites / 4) - 1;
VAR(VAR_NUM_SPRITES) = _numSprites - 1;
+ VAR(VAR_U32_VERSION) = -1;
VAR(VAR_WIZ_TCOLOR) = 5;
}
}
diff --git a/scumm/wiz_he.cpp b/scumm/wiz_he.cpp
index dffc6e45bd..2ce731ea41 100644
--- a/scumm/wiz_he.cpp
+++ b/scumm/wiz_he.cpp
@@ -907,12 +907,12 @@ void ScummEngine_v72he::displayWizImage(WizImage *pwi) {
drawWizPolygon(pwi->resNum, pwi->state, pwi->x1, pwi->flags, pwi->xmapNum, 0, 0);
} else {
const Common::Rect *r = NULL;
- drawWizImage(pwi->resNum, pwi->state, pwi->x1, pwi->y1, pwi->xmapNum, r, pwi->flags, 0, 0);
+ drawWizImage(pwi->resNum, pwi->state, pwi->x1, pwi->y1, pwi->zorder, pwi->xmapNum, pwi->field_390, r, pwi->flags, 0, 0);
}
}
-uint8 *ScummEngine_v72he::drawWizImage(int resNum, int state, int x1, int y1, int xmapNum, const Common::Rect *clipBox, int flags, int dstResNum, int paletteNum) {
- debug(2, "drawWizImage(resNum %d, x1 %d, y1 %d, flags 0x%X, xmapNum %d dstResNum %d paletteNum %d)", resNum, x1, y1, flags, xmapNum, dstResNum, paletteNum);
+uint8 *ScummEngine_v72he::drawWizImage(int resNum, int state, int x1, int y1, int zorder, int xmapNum, int field_390, const Common::Rect *clipBox, int flags, int dstResNum, int paletteNum) {
+ debug(2, "drawWizImage(resNum %d, x1 %d y1 %d flags 0x%X zorder %d xmapNum %d field_390 %d dstResNum %d paletteNum %d)", resNum, x1, y1, flags, zorder, xmapNum, field_390, dstResNum, paletteNum);
uint8 *dst = NULL;
const uint8 *palPtr = NULL;
if (_heversion >= 99) {
@@ -1165,13 +1165,13 @@ void ScummEngine_v72he::drawWizComplexPolygon(int resNum, int state, int po_x, i
break;
case 180:
flags |= kWIFFlipX | kWIFFlipY;
- drawWizImage(resNum, state, x1, y1, xmapNum, r, flags, dstResNum, paletteNum);
+ drawWizImage(resNum, state, x1, y1, 0, xmapNum, 0, r, flags, dstResNum, paletteNum);
break;
case 90:
//drawWizComplexPolygonHelper(resNum, state, x1, y1, r, flags, dstResNum, paletteNum);
break;
case 0:
- drawWizImage(resNum, state, x1, y1, xmapNum, r, flags, dstResNum, paletteNum);
+ drawWizImage(resNum, state, x1, y1, 0, xmapNum, 0, r, flags, dstResNum, paletteNum);
break;
default:
//drawWizPolygonTransform(resNum, state, pts, flags, VAR(VAR_WIZ_TCOLOR), r, dstResNum, paletteNum, xmapPtr);
@@ -1197,7 +1197,7 @@ void ScummEngine_v72he::drawWizPolygon(int resNum, int state, int id, int flags,
error("Invalid point count %d for Polygon %d", wp->numVerts, id);
}
const Common::Rect *r = NULL;
- uint8 *srcWizBuf = drawWizImage(resNum, state, 0, 0, xmapNum, r, kWIFBlitToMemBuffer, 0, paletteNum);
+ uint8 *srcWizBuf = drawWizImage(resNum, state, 0, 0, 0, xmapNum, 0, r, kWIFBlitToMemBuffer, 0, paletteNum);
if (srcWizBuf) {
uint8 *dst;
int32 wizW, wizH;
@@ -1294,7 +1294,7 @@ void ScummEngine_v72he::flushWizBuffer() {
drawWizPolygon(pwi->resNum, pwi->state, pwi->x1, pwi->flags, pwi->xmapNum, 0, pwi->paletteNum);
} else {
const Common::Rect *r = NULL;
- drawWizImage(pwi->resNum, pwi->state, pwi->x1, pwi->y1, pwi->xmapNum, r, pwi->flags, 0, pwi->paletteNum);
+ drawWizImage(pwi->resNum, pwi->state, pwi->x1, pwi->y1, pwi->zorder, pwi->xmapNum, pwi->field_390, r, pwi->flags, 0, pwi->paletteNum);
}
}
_wiz._imagesNum = 0;
@@ -1328,7 +1328,7 @@ void ScummEngine_v80he::loadWizCursor(int resId) {
}
const Common::Rect *r = NULL;
- uint8 *cursor = drawWizImage(resId, 0, 0, 0, 0, r, kWIFBlitToMemBuffer, 0, 0);
+ uint8 *cursor = drawWizImage(resId, 0, 0, 0, 0, 0, 0, r, kWIFBlitToMemBuffer, 0, 0);
int32 cw, ch;
getWizImageDim(resId, 0, cw, ch);
setCursorFromBuffer(cursor, cw, ch, cw);
@@ -1369,9 +1369,14 @@ void ScummEngine_v72he::displayWizComplexImage(const WizParameters *params) {
po_y = params->img.y1;
}
int xmapNum = 0;
- if (params->processFlags & 0x4) {
+ if (params->processFlags & kWPFXmapNum) {
xmapNum = params->xmapNum;
}
+ int field_390 = 0;
+ if (params->processFlags & 0x200000) {
+ field_390 = params->img.field_390;
+ warning("displayWizComplexImage() unhandled flag 0x200000");
+ }
const Common::Rect *r = NULL;
if (params->processFlags & kWPFClipBox) {
r = &params->box;
@@ -1405,9 +1410,11 @@ void ScummEngine_v72he::displayWizComplexImage(const WizParameters *params) {
pwi->resNum = params->img.resNum;
pwi->x1 = po_x;
pwi->y1 = po_y;
+ pwi->zorder = params->img.zorder;
pwi->state = state;
pwi->flags = flags;
pwi->xmapNum = xmapNum;
+ pwi->field_390 = field_390;
pwi->paletteNum = paletteNum;
++_wiz._imagesNum;
} else {
@@ -1419,7 +1426,7 @@ void ScummEngine_v72he::displayWizComplexImage(const WizParameters *params) {
if (flags & kWIFIsPolygon) {
drawWizPolygon(params->img.resNum, state, po_x, flags, xmapNum, dstResNum, paletteNum); // XXX , VAR(VAR_WIZ_TCOLOR));
} else {
- drawWizImage(params->img.resNum, state, po_x, po_y, xmapNum, r, flags, dstResNum, paletteNum);
+ drawWizImage(params->img.resNum, state, po_x, po_y, params->img.zorder, xmapNum, field_390, r, flags, dstResNum, paletteNum);
}
}
}
diff --git a/scumm/wiz_he.h b/scumm/wiz_he.h
index 218d3eaaee..ea98c60f15 100644
--- a/scumm/wiz_he.h
+++ b/scumm/wiz_he.h
@@ -39,41 +39,66 @@ struct WizImage {
int resNum;
int x1;
int y1;
- int flags;
+ int zorder;
int state;
+ int flags;
int xmapNum;
+ int field_390;
int paletteNum;
};
struct WizParameters {
+ int field_0;
byte filename[260];
Common::Rect box;
int processFlags;
int processMode;
- int unk_11C;
- int unk_120;
- int unk_124;
- int unk_128;
- int unk_12C;
- int unk_130;
- int unk_134;
- int unk_138;
+ int field_11C;
+ int field_120;
+ int field_124;
+ int field_128;
+ int field_12C;
+ int field_130;
+ int field_134;
+ int field_138;
int compType;
int fileWriteMode;
int angle;
int zoom;
int xmapNum;
- int unk_160;
- int unk_164;
+ int field_164;
+ int field_168;
int resDefImgW;
int resDefImgH;
int maskImgResNum;
+ int field_180;
+ int field_184;
uint8 remapColor[256];
uint8 remapIndex[256];
int remapNum;
int dstResNum;
byte fillColor;
+ byte string1[4096];
+ byte string2[4096];
+ int field_2399;
+ int field_239D;
+ int field_23A1;
+ int field_23A5;
+ int field_23A9;
+ int field_23AD;
+ int field_23B1;
+ int field_23B5;
+ int field_23B9;
+ int field_23BD;
+ int field_23C1;
+ int field_23C5;
+ int field_23C9;
+ int field_23CD;
Common::Rect box2;
+ int field_23DE;
+ int spriteId;
+ int groupNum;
+ int field_23EA;
WizImage img;
};