Rename WizParameters field.

Correct start strip in drawBMAPBg()

svn-id: r17236
This commit is contained in:
Travis Howell 2005-03-26 06:00:58 +00:00
parent f735ee48af
commit 2938c66276
6 changed files with 35 additions and 21 deletions

View File

@ -785,7 +785,7 @@ void ScummEngine_v70he::redrawBGAreas() {
if (findResource(MKID('BMAP'), room) != NULL) {
if (_fullRedraw) {
_bgNeedsRedraw = false;
gdi.drawBMAPBg(room, &virtscr[0], _screenStartStrip);
gdi.drawBMAPBg(room, &virtscr[0]);
}
} else if (findResource(MKID('SMAP'), room) == NULL) {
warning("redrawBGAreas(): Both SMAP and BMAP are missing...");
@ -1538,18 +1538,17 @@ void Gdi::drawBitmap(const byte *ptr, VirtScreen *vs, int x, int y, const int wi
* @note This function essentially is a stripped down & special cased version of
* the generic Gdi::drawBitmap() method.
*/
void Gdi::drawBMAPBg(const byte *ptr, VirtScreen *vs, int startstrip) {
assert(ptr);
const byte *bmap_ptr;
byte code;
void Gdi::drawBMAPBg(const byte *ptr, VirtScreen *vs) {
const byte *z_plane_ptr;
byte *mask_ptr;
const byte *zplane_list[9];
bmap_ptr = _vm->findResourceData(MKID('BMAP'), ptr);
const byte *bmap_ptr = _vm->findResourceData(MKID('BMAP'), ptr);
assert(bmap_ptr);
code = *bmap_ptr++;
byte code = *bmap_ptr++;
int scrX = _vm->_screenStartStrip * 8;
byte *dst = (byte *)_vm->virtscr[0].backBuf + scrX;
// The following few lines more or less duplicate decompressBitmap(), only
// for an area spanning multiple strips. In particular, the codecs 13 & 14
@ -1560,13 +1559,13 @@ void Gdi::drawBMAPBg(const byte *ptr, VirtScreen *vs, int startstrip) {
switch (code) {
case 13:
drawStripHE((byte *)vs->backBuf, vs->pitch, bmap_ptr, vs->w, vs->h, false);
drawStripHE(dst, vs->pitch, bmap_ptr, vs->w, vs->h, false);
break;
case 14:
drawStripHE((byte *)vs->backBuf, vs->pitch, bmap_ptr, vs->w, vs->h, true);
drawStripHE(dst, vs->pitch, bmap_ptr, vs->w, vs->h, true);
break;
case 15:
fill((byte *)vs->backBuf, vs->pitch, *bmap_ptr, vs->w, vs->h);
fill(dst, vs->pitch, *bmap_ptr, vs->w, vs->h);
break;
default:
// Alternayive russian freddi3 uses badly formatted bitmaps
@ -1612,6 +1611,7 @@ void Gdi::drawBMAPObject(const byte *ptr, VirtScreen *vs, int obj, int x, int y,
Common::Rect rect2(scrX, 0, vs->w + scrX, vs->h);
if (rect1.intersects(rect2)) {
rect1.clip(rect2);
rect1.left -= rect2.left;
rect1.right -= rect2.left;
rect1.top -= rect2.top;

View File

@ -292,7 +292,7 @@ public:
void decodeNESGfx(const byte *room);
void decodeNESObject(const byte *ptr, int xpos, int ypos, int width, int height);
void drawBMAPBg(const byte *ptr, VirtScreen *vs, int startstrip);
void drawBMAPBg(const byte *ptr, VirtScreen *vs);
void drawBMAPObject(const byte *ptr, VirtScreen *vs, int obj, int x, int y, int w, int h);
void copyVirtScreenBuffers(Common::Rect rect);

View File

@ -1193,7 +1193,7 @@ void ScummEngine_v100he::o100_wizImageOps() {
_wizParams.unk_178 = pop();
break;
case 11:
_wizParams.processFlags |= 0x300;
_wizParams.processFlags |= kWPFClipBox | 0x100;
_wizParams.processMode = 2;
_wizParams.box.bottom = pop();
_wizParams.box.right = pop();
@ -1267,7 +1267,7 @@ void ScummEngine_v100he::o100_wizImageOps() {
_wizParams.unk_174 = pop();
break;
case 58:
_wizParams.processFlags |= 0x1102;
_wizParams.processFlags |= 0x1000 | 0x100 | 0x2;
_wizParams.processMode = 7;
_wizParams.unk_164 = pop();
_wizParams.unk_160 = pop();
@ -1277,7 +1277,7 @@ void ScummEngine_v100he::o100_wizImageOps() {
_wizParams.processFlags |= kWPFUseFile;
_wizParams.processMode = 4;
copyScriptString(_wizParams.filename);
_wizParams.unk_14C = pop();
_wizParams.fileWriteMode = pop();
break;
case 65:
_wizParams.processFlags |= kWPFZoom;

View File

@ -546,10 +546,10 @@ void ScummEngine_v90he::o90_wizImageOps() {
_wizParams.processFlags |= kWPFUseFile;
_wizParams.processMode = 4;
copyScriptString(_wizParams.filename);
_wizParams.unk_14C = pop();
_wizParams.fileWriteMode = pop();
break;
case 5:
_wizParams.processFlags |= 0x300;
_wizParams.processFlags |= kWPFClipBox | 0x100;
_wizParams.processMode = 2;
_wizParams.box.bottom = pop();
_wizParams.box.right = pop();
@ -628,7 +628,7 @@ void ScummEngine_v90he::o90_wizImageOps() {
_wizParams.unk_15C = pop();
break;
case 85: // HE99+
_wizParams.processFlags |= 0x1102;
_wizParams.processFlags |= 0x1000 | 0x100 | 0x2;
_wizParams.processMode = 7;
_wizParams.unk_164 = pop();
_wizParams.unk_160 = pop();

View File

@ -1388,11 +1388,14 @@ void ScummEngine_v90he::processWizImage(const WizParameters *params) {
if (params->processFlags & kWPFUseFile) {
File f;
if (!f.open((const char *)params->filename, File::kFileReadMode)) {
VAR(VAR_GAME_LOADED) = -3;
VAR(119) = -3;
warning("Unable to open for read '%s'", params->filename);
} else {
uint32 id = f.readUint32BE();
if (id != MKID('AWIZ') && id != MKID('MULT')) {
VAR(VAR_GAME_LOADED) = -1;
VAR(119) = -1;
} else {
uint32 size = f.readUint32BE();
f.seek(0, SEEK_SET);
@ -1401,8 +1404,10 @@ void ScummEngine_v90he::processWizImage(const WizParameters *params) {
nukeResource(rtImage, params->img.resNum);
warning("i/o error when reading '%s'", params->filename);
VAR(VAR_GAME_LOADED) = -2;
VAR(119) = -2;
} else {
VAR(VAR_GAME_LOADED) = 0;
VAR(119) = 0;
}
}
f.close();
@ -1411,10 +1416,16 @@ void ScummEngine_v90he::processWizImage(const WizParameters *params) {
break;
case 4:
if (params->processFlags & kWPFUseFile) {
if (params->unk_14C != 0) {
VAR(119) = -1;
} else {
File f;
switch(params->fileWriteMode) {
case 2:
VAR(119) = -1;
break;
case 1:
// TODO Write image to file
break;
case 0:
if (!f.open((const char *)params->filename, File::kFileWriteMode)) {
warning("Unable to open for write '%s'", params->filename);
VAR(119) = -3;
@ -1429,6 +1440,9 @@ void ScummEngine_v90he::processWizImage(const WizParameters *params) {
}
f.close();
}
break;
default:
error("processWizImage: processMode 4 unhandled fileWriteMode %d", params->fileWriteMode);
}
}
break;

View File

@ -58,7 +58,7 @@ struct WizParameters {
int unk_134;
int unk_138;
int compType;
int unk_14C;
int fileWriteMode;
int angle;
int zoom;
int unk_15C;