Add functions for o90_getSpriteGroupInfo
svn-id: r16841
This commit is contained in:
parent
97688df92d
commit
b1e67c4ce8
3 changed files with 113 additions and 7 deletions
|
@ -898,6 +898,14 @@ protected:
|
||||||
void spriteInfoGet_tx_ty(int spriteId, int32 &tx, int32 &ty);
|
void spriteInfoGet_tx_ty(int spriteId, int32 &tx, int32 &ty);
|
||||||
void spriteInfoGet_field_2C_30(int spriteId, int32 &field_2C, int32 &field_30);
|
void spriteInfoGet_field_2C_30(int spriteId, int32 &field_2C, int32 &field_30);
|
||||||
|
|
||||||
|
int spriteGroupGet_field_10(int spriteId);
|
||||||
|
int spriteGroupGet_field_20(int spriteId);
|
||||||
|
int spriteGroupGet_field_30(int spriteId);
|
||||||
|
int spriteGroupGet_field_34(int spriteId);
|
||||||
|
int spriteGroupGet_field_38(int spriteId);
|
||||||
|
int spriteGroupGet_field_3C(int spriteId);
|
||||||
|
void spriteGroupGet_tx_ty(int spriteId, int32 &tx, int32 &ty);
|
||||||
|
|
||||||
void spriteInfoSet_field_14(int spriteId, int value);
|
void spriteInfoSet_field_14(int spriteId, int value);
|
||||||
void spriteInfoSet_field_7C(int spriteId, int value);
|
void spriteInfoSet_field_7C(int spriteId, int value);
|
||||||
void spriteInfoSet_field_80(int spriteId, int value);
|
void spriteInfoSet_field_80(int spriteId, int value);
|
||||||
|
|
|
@ -1143,35 +1143,82 @@ void ScummEngine_v90he::o90_setSpriteInfo() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScummEngine_v90he::o90_getSpriteGroupInfo() {
|
void ScummEngine_v90he::o90_getSpriteGroupInfo() {
|
||||||
|
int32 tx, ty;
|
||||||
|
int spriteId, type;
|
||||||
|
|
||||||
byte subOp = fetchScriptByte();
|
byte subOp = fetchScriptByte();
|
||||||
switch (subOp) {
|
switch (subOp) {
|
||||||
case 8: // HE 99+
|
case 8: // HE 99+
|
||||||
pop();
|
pop();
|
||||||
|
push(0);
|
||||||
break;
|
break;
|
||||||
case 30:
|
case 30:
|
||||||
pop();
|
spriteId = pop();
|
||||||
|
if (spriteId) {
|
||||||
|
spriteGroupGet_tx_ty(spriteId, tx, ty);
|
||||||
|
push(tx);
|
||||||
|
} else {
|
||||||
|
push(0);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 31:
|
case 31:
|
||||||
pop();
|
spriteId = pop();
|
||||||
|
if (spriteId) {
|
||||||
|
spriteGroupGet_tx_ty(spriteId, tx, ty);
|
||||||
|
push(ty);
|
||||||
|
} else {
|
||||||
|
push(0);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 42: // HE 99+
|
case 42: // HE 99+
|
||||||
pop();
|
type = pop();
|
||||||
pop();
|
spriteId = pop();
|
||||||
|
if (spriteId) {
|
||||||
|
switch(type) {
|
||||||
|
case 0:
|
||||||
|
push(spriteGroupGet_field_30(spriteId));
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
push(spriteGroupGet_field_34(spriteId));
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
push(spriteGroupGet_field_38(spriteId));
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
push(spriteGroupGet_field_3C(spriteId));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
push(0);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
push(0);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 43:
|
case 43:
|
||||||
pop();
|
spriteId = pop();
|
||||||
|
if (spriteId) {
|
||||||
|
push(spriteGroupGet_field_10(spriteId));
|
||||||
|
} else {
|
||||||
|
push(0);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 63: // HE 99+
|
case 63: // HE 99+
|
||||||
pop();
|
spriteId = pop();
|
||||||
|
if (spriteId) {
|
||||||
|
push(spriteGroupGet_field_20(spriteId));
|
||||||
|
} else {
|
||||||
|
push(0);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 139: // HE 99+
|
case 139: // HE 99+
|
||||||
|
// dummy case
|
||||||
pop();
|
pop();
|
||||||
pop();
|
pop();
|
||||||
|
push(0);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
error("o90_getSpriteGroupInfo: Unknown case %d", subOp);
|
error("o90_getSpriteGroupInfo: Unknown case %d", subOp);
|
||||||
}
|
}
|
||||||
push(0);
|
|
||||||
|
|
||||||
debug(1,"o90_getSpriteGroupInfo stub (%d)", subOp);
|
debug(1,"o90_getSpriteGroupInfo stub (%d)", subOp);
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,6 +35,10 @@ void ScummEngine_v90he::allocateArrays() {
|
||||||
spritesAllocTables(_numSprites, 64, 64);
|
spritesAllocTables(_numSprites, 64, 64);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// spriteInfoGet functions
|
||||||
|
//
|
||||||
|
|
||||||
int ScummEngine_v90he::spriteInfoGet_flags_1(int spriteId) {
|
int ScummEngine_v90he::spriteInfoGet_flags_1(int spriteId) {
|
||||||
checkRange(_numSprites, 1, spriteId, "_spriteTableGet_flags_1: Invalid sprite %d");
|
checkRange(_numSprites, 1, spriteId, "_spriteTableGet_flags_1: Invalid sprite %d");
|
||||||
|
|
||||||
|
@ -181,6 +185,53 @@ void ScummEngine_v90he::spriteInfoGet_field_2C_30(int spriteId, int32 &field_2C,
|
||||||
field_30 = _spriteTable[spriteId].field_30;
|
field_30 = _spriteTable[spriteId].field_30;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// spriteGroupGet functions
|
||||||
|
//
|
||||||
|
|
||||||
|
int ScummEngine_v90he::spriteGroupGet_field_10(int spriteId) {
|
||||||
|
checkRange(_numSprites, 1, spriteId, "spriteInfoGet_field_10: Invalid sprite %d");
|
||||||
|
|
||||||
|
return _spriteGroups[spriteId].field_10;
|
||||||
|
}
|
||||||
|
|
||||||
|
int ScummEngine_v90he::spriteGroupGet_field_20(int spriteId) {
|
||||||
|
checkRange(_numSprites, 1, spriteId, "spriteInfoGet_field_20: Invalid sprite %d");
|
||||||
|
|
||||||
|
return _spriteGroups[spriteId].field_20;
|
||||||
|
}
|
||||||
|
|
||||||
|
int ScummEngine_v90he::spriteGroupGet_field_30(int spriteId) {
|
||||||
|
checkRange(_numSprites, 1, spriteId, "spriteInfoGet_field_30: Invalid sprite %d");
|
||||||
|
|
||||||
|
return _spriteGroups[spriteId].field_30;
|
||||||
|
}
|
||||||
|
|
||||||
|
int ScummEngine_v90he::spriteGroupGet_field_34(int spriteId) {
|
||||||
|
checkRange(_numSprites, 1, spriteId, "spriteInfoGet_field_34: Invalid sprite %d");
|
||||||
|
|
||||||
|
return _spriteGroups[spriteId].field_34;
|
||||||
|
}
|
||||||
|
|
||||||
|
int ScummEngine_v90he::spriteGroupGet_field_38(int spriteId) {
|
||||||
|
checkRange(_numSprites, 1, spriteId, "spriteInfoGet_field_38: Invalid sprite %d");
|
||||||
|
|
||||||
|
return _spriteGroups[spriteId].field_38;
|
||||||
|
}
|
||||||
|
|
||||||
|
int ScummEngine_v90he::spriteGroupGet_field_3C(int spriteId) {
|
||||||
|
checkRange(_numSprites, 1, spriteId, "spriteInfoGet_field_3C: Invalid sprite %d");
|
||||||
|
|
||||||
|
return _spriteGroups[spriteId].field_3C;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ScummEngine_v90he::spriteGroupGet_tx_ty(int spriteId, int32 &tx, int32 &ty) {
|
||||||
|
checkRange(_numSprites, 1, spriteId, "spriteGroupGet_tx_ty: Invalid sprite %d");
|
||||||
|
|
||||||
|
tx = _spriteGroups[spriteId].tx;
|
||||||
|
ty = _spriteGroups[spriteId].ty;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// spriteInfoSet functions
|
// spriteInfoSet functions
|
||||||
//
|
//
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue