Rename paletteNum field for sprite in wizImages.

svn-id: r17312
This commit is contained in:
Travis Howell 2005-03-31 22:51:54 +00:00
parent ac247c9b94
commit 204809625f
7 changed files with 27 additions and 23 deletions

View File

@ -924,7 +924,7 @@ protected:
int spriteInfoGet_resId(int spriteId);
int spriteInfoGet_resState(int spriteId);
int spriteInfoGet_groupNum(int spriteId);
int spriteInfoGet_field_14(int spriteId);
int spriteInfoGet_paletteNum(int spriteId);
int spriteInfoGet_zorderPriority(int spriteId);
int spriteInfoGet_grp_tx(int spriteId);
int spriteInfoGet_grp_ty(int spriteId);
@ -949,7 +949,7 @@ protected:
int spriteGroupGet_scale_y_ratio_div(int spriteGroupId);
void spriteGroupGet_tx_ty(int spriteGroupId, int32 &tx, int32 &ty);
void spriteInfoSet_field_14(int spriteId, int value);
void spriteInfoSet_paletteNum(int spriteId, int value);
void spriteInfoSet_field_7C(int spriteId, int value);
void spriteInfoSet_field_80(int spriteId, int value);
void spriteInfoSet_resetSprite(int spriteId);

View File

@ -1262,8 +1262,8 @@ void ScummEngine_v100he::o100_wizImageOps() {
displayWizComplexImage(&_wizParams);
break;
case 57:
_wizParams.processFlags |= 0x8000;
_wizParams.unk_174 = pop();
_wizParams.processFlags |= kWPFPaletteNum;
_wizParams.img.paletteNum = pop();
break;
case 58:
_wizParams.processFlags |= 0x1000 | 0x100 | 0x2;
@ -1900,7 +1900,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() {
spriteId++;
for (; spriteId <= _curMaxSpriteId; spriteId++)
spriteInfoSet_field_14(spriteId, args[0]);
spriteInfoSet_paletteNum(spriteId, args[0]);
break;
case 59:
args[0] = pop();
@ -2616,7 +2616,7 @@ void ScummEngine_v100he::o100_getSpriteInfo() {
case 57:
spriteId = pop();
if (spriteId)
push(spriteInfoGet_field_14(spriteId));
push(spriteInfoGet_paletteNum(spriteId));
else
push(0);
break;

View File

@ -617,8 +617,8 @@ void ScummEngine_v90he::o90_wizImageOps() {
_wizParams.box.left = pop();
break;
case 40: // HE99+
_wizParams.processFlags |= 0x8000;
_wizParams.unk_174 = pop();
_wizParams.processFlags |= kWPFPaletteNum;
_wizParams.img.paletteNum = pop();
break;
case 46:
_wizParams.processFlags |= kWPFZoom;
@ -923,7 +923,7 @@ void ScummEngine_v90he::o90_getSpriteInfo() {
case 56:
spriteId = pop();
if (spriteId)
push(spriteInfoGet_field_14(spriteId));
push(spriteInfoGet_paletteNum(spriteId));
else
push(0);
break;
@ -1204,7 +1204,7 @@ void ScummEngine_v90he::o90_setSpriteInfo() {
spriteId++;
for (; spriteId <= _curMaxSpriteId; spriteId++)
spriteInfoSet_field_14(spriteId, args[0]);
spriteInfoSet_paletteNum(spriteId, args[0]);
break;
case 58: // HE 99+
args[0] = pop();

View File

@ -297,10 +297,10 @@ int ScummEngine_v90he::spriteInfoGet_groupNum(int spriteId) {
return _spriteTable[spriteId].group_num;
}
int ScummEngine_v90he::spriteInfoGet_field_14(int spriteId) {
int ScummEngine_v90he::spriteInfoGet_paletteNum(int spriteId) {
checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d");
return _spriteTable[spriteId].field_14;
return _spriteTable[spriteId].paletteNum;
}
int ScummEngine_v90he::spriteInfoGet_zorderPriority(int spriteId) {
@ -477,11 +477,11 @@ void ScummEngine_v90he::spriteGroupGet_tx_ty(int spriteGroupId, int32 &tx, int32
//
// spriteInfoSet functions
//
void ScummEngine_v90he::spriteInfoSet_field_14(int spriteId, int value) {
void ScummEngine_v90he::spriteInfoSet_paletteNum(int spriteId, int value) {
checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d");
if (_spriteTable[spriteId].field_14 != value) {
_spriteTable[spriteId].field_14 = value;
if (_spriteTable[spriteId].paletteNum != value) {
_spriteTable[spriteId].paletteNum = value;
_spriteTable[spriteId].flags |= kSFChanged | kSFNeedRedraw;
}
}
@ -747,7 +747,7 @@ void ScummEngine_v90he::spriteInfoSet_resetSprite(int spriteId) {
_spriteTable[spriteId].delayAmount = 0;
_spriteTable[spriteId].delayCount = 0;
_spriteTable[spriteId].class_flags = 0;
_spriteTable[spriteId].field_14 = 0;
_spriteTable[spriteId].paletteNum = 0;
_spriteTable[spriteId].field_7C = 0;
_spriteTable[spriteId].field_80 = 0;
_spriteTable[spriteId].zorderPriority = 0;
@ -1337,9 +1337,9 @@ void ScummEngine_v90he::spritesProcessWiz(bool arg) {
continue;
}
}
if (spi->field_14) {
wiz.processFlags |= 0x8000;
wiz.unk_174 = spi->field_14;
if (spi->paletteNum) {
wiz.processFlags |= kWPFPaletteNum;
wiz.img.paletteNum = spi->paletteNum;
}
if (spi->res_id && spi->group_num && _spriteGroups[spi->group_num].field_20) {
wiz.processFlags |= 0x10000;

View File

@ -71,7 +71,7 @@ struct SpriteInfo {
int res_id;
int res_state;
int group_num;
int field_14;
int paletteNum;
int zorderPriority;
Common::Rect bbox;
int dx;

View File

@ -1206,8 +1206,9 @@ void ScummEngine_v72he::drawWizComplexPolygon(int resnum, int state, int po_x, i
}
void ScummEngine_v72he::displayWizComplexImage(const WizParameters *params) {
if (params->processFlags & 0x80000) {
warning("displayWizComplexImage() unhandled flags = 0x80000");
int paletteNum = 0;
if (params->processFlags & kWPFPaletteNum) {
paletteNum = params->img.paletteNum;
}
int zoom = 256;
if (params->processFlags & kWPFZoom) {
@ -1268,6 +1269,7 @@ void ScummEngine_v72he::displayWizComplexImage(const WizParameters *params) {
pwi->state = state;
pwi->flags = flags;
pwi->unk = unk;
pwi->paletteNum = paletteNum;
++_wiz._imagesNum;
} else if (params->processFlags & (kWPFRotate | kWPFZoom)) {
drawWizComplexPolygon(params->img.resNum, state, po_x, po_y, unk, rotationAngle, zoom, r);
@ -1285,6 +1287,7 @@ void ScummEngine_v72he::displayWizComplexImage(const WizParameters *params) {
wi.state = state;
wi.flags = flags;
wi.unk = unk;
wi.paletteNum = paletteNum;
drawWizImage(rtImage, &wi);
}
}

View File

@ -42,6 +42,7 @@ struct WizImage {
int flags;
int state;
int unk;
int paletteNum;
};
struct WizParameters {
@ -66,7 +67,6 @@ struct WizParameters {
int unk_164;
int resDefImgW;
int resDefImgH;
int unk_174;
int unk_178;
uint8 remapColor[256];
uint8 remapIndex[256];
@ -100,6 +100,7 @@ enum WizProcessFlags {
kWPFUseFile = 0x800,
kWPFUseDefImgWidth = 0x2000,
kWPFUseDefImgHeight = 0x4000,
kWPFPaletteNum = 0x8000,
kWPFFillColor = 0x20000,
kWPFClipBox2 = 0x40000
};