diff options
-rw-r--r-- | scumm/intern.h | 2 | ||||
-rw-r--r-- | scumm/script_v100he.cpp | 244 | ||||
-rw-r--r-- | scumm/script_v90he.cpp | 26 | ||||
-rw-r--r-- | scumm/sprite_he.cpp | 12 |
4 files changed, 243 insertions, 41 deletions
diff --git a/scumm/intern.h b/scumm/intern.h index c5db9a3d7b..67038efa07 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -885,6 +885,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_field_18(int spriteId); int spriteInfoGet_grp_tx(int spriteId); int spriteInfoGet_grp_ty(int spriteId); @@ -893,6 +894,7 @@ protected: int spriteInfoGet_wizSize(int spriteId); int spriteInfoGet_zoom(int spriteId); int spriteInfoGet_field_78(int spriteId); + int spriteInfoGet_field_7C(int spriteId); int spriteInfoGet_field_80(int spriteId); void getSpriteImageDim(int spriteId, int32 &w, int32 &h); void spriteInfoGet_tx_ty(int spriteId, int32 &tx, int32 &ty); diff --git a/scumm/script_v100he.cpp b/scumm/script_v100he.cpp index a4c85e2273..bb493955c6 100644 --- a/scumm/script_v100he.cpp +++ b/scumm/script_v100he.cpp @@ -1789,35 +1789,83 @@ void ScummEngine_v100he::o100_getResourceSize() { } void ScummEngine_v100he::o100_getSpriteGroupInfo() { + int32 tx, ty; + int spriteGroupId, type; + byte subOp = fetchScriptByte(); switch (subOp) { case 5: - pop(); + spriteGroupId = pop(); + if (spriteGroupId) + push(spriteGroupGet_allocateGroupSpritesList(spriteGroupId)); + else + push(0); break; - case 48: - pop(); + case 40: + spriteGroupId = pop(); + if (spriteGroupId) + push(spriteGroupGet_field_20(spriteGroupId)); + else + push(0); break; case 54: + // TODO pop(); pop(); + push(0); break; case 59: - pop(); + spriteGroupId = pop(); + if (spriteGroupId) + push(spriteGroupGet_field_10(spriteGroupId)); + else + push(0); break; case 60: - pop(); - pop(); + type = pop(); + spriteGroupId = pop(); + if (spriteGroupId) { + switch(type) { + case 0: + push(spriteGroupGet_field_30(spriteGroupId)); + break; + case 1: + push(spriteGroupGet_field_34(spriteGroupId)); + break; + case 2: + push(spriteGroupGet_field_38(spriteGroupId)); + break; + case 3: + push(spriteGroupGet_field_3C(spriteGroupId)); + break; + default: + push(0); + } + } else { + push(0); + } break; case 85: - pop(); + spriteGroupId = pop(); + if (spriteGroupId) { + spriteGroupGet_tx_ty(spriteGroupId, tx, ty); + push(tx); + } else { + push(0); + } break; case 86: - pop(); + spriteGroupId = pop(); + if (spriteGroupId) { + spriteGroupGet_tx_ty(spriteGroupId, tx, ty); + push(ty); + } else { + push(0); + } break; default: error("o100_getSpriteGroupInfo: Unknown case %d", subOp); } - push(0); debug(1,"o100_getSpriteGroupInfo stub (%d)", subOp); } @@ -1978,34 +2026,65 @@ void ScummEngine_v100he::o100_readFile() { void ScummEngine_v100he::o100_getSpriteInfo() { int args[16]; + int spriteId, flags; + int32 a, b; byte subOp = fetchScriptByte(); switch (subOp) { case 3: - pop(); + spriteId = pop(); + if (spriteId) + push(spriteInfoGet_flags_6(spriteId)); + else + push(0); break; case 4: - pop(); + spriteId = pop(); + if (spriteId) + push(spriteInfoGet_field_78(spriteId)); + else + push(1); break; case 7: - pop(); + spriteId = pop(); + if (spriteId) + push(spriteInfoGet_field_7C(spriteId)); + else + push(0); break; case 16: getStackList(args, ARRAYSIZE(args)); pop(); + push(0); break; case 26: - pop(); + spriteId = pop(); + if (spriteId) + push(spriteInfoGet_wizSize(spriteId)); + else + push(0); break; case 30: - pop(); + spriteId = pop(); + if (spriteId) + push(spriteInfoGet_grp_tx(spriteId)); + else + push(0); break; case 31: - pop(); + spriteId = pop(); + if (spriteId) + push(spriteInfoGet_grp_ty(spriteId)); + else + push(0); break; case 32: - pop(); + spriteId = pop(); + if (spriteId) + push(spriteInfoGet_flags_8(spriteId)); + else + push(1); break; case 33: getStackList(args, ARRAYSIZE(args)); @@ -2013,68 +2092,165 @@ void ScummEngine_v100he::o100_getSpriteInfo() { pop(); pop(); pop(); + push(0); break; case 38: - pop(); + spriteId = pop(); + if (spriteId) + push(spriteInfoGet_groupNum(spriteId)); + else + push(0); break; case 39: - pop(); + spriteId = pop(); + if (spriteId) { + getSpriteImageDim(spriteId, a, b); + push(b); + } else { + push(0); + } break; case 40: - pop(); + spriteId = pop(); + if (spriteId) + push(spriteInfoGet_resId(spriteId)); + else + push(0); break; case 48: - pop(); + spriteId = pop(); + if (spriteId) + push(spriteInfoGet_field_80(spriteId)); + else + push(0); break; case 54: pop(); pop(); + push(0); break; case 57: - pop(); + spriteId = pop(); + if (spriteId) + push(spriteInfoGet_field_14(spriteId)); + else + push(0); break; case 59: - pop(); + spriteId = pop(); + if (spriteId) + push(spriteInfoGet_field_18(spriteId)); + else + push(0); break; case 60: - pop(); - pop(); + flags = pop(); + spriteId = pop(); + if (spriteId) { + switch(flags) { + case 0: + push(spriteInfoGet_flags_1(spriteId)); + break; + case 1: + push(spriteInfoGet_flags_2(spriteId)); + break; + case 2: + push(spriteInfoGet_flags_3(spriteId)); + break; + case 3: + push(spriteInfoGet_flags_4(spriteId)); + break; + case 4: + push(spriteInfoGet_flags_5(spriteId)); + break; + default: + push(0); + } + } else { + push(0); + } break; case 65: - pop(); + spriteId = pop(); + if (spriteId) + push(spriteInfoGet_zoom(spriteId)); + else + push(0); break; case 70: - pop(); + spriteId = pop(); + if (spriteId) + push(spriteInfoGet_field_54(spriteId)); + else + push(0); break; case 73: - pop(); + spriteId = pop(); + if (spriteId) + push(spriteInfoGet_resState(spriteId)); + else + push(0); break; case 75: - pop(); + spriteId = pop(); + if (spriteId) { + spriteInfoGet_field_2C_30(spriteId, a, b); + push(a); + } else { + push(0); + } break; case 76: - pop(); + spriteId = pop(); + if (spriteId) { + spriteInfoGet_field_2C_30(spriteId, a, b); + push(b); + } else { + push(0); + } break; case 82: pop(); + push(0); break; case 83: pop(); - pop(); + spriteId = pop(); + if (spriteId) + push(spriteInfoGet_field_44(spriteId)); + else + push(0); break; case 84: - pop(); + spriteId = pop(); + if (spriteId) { + getSpriteImageDim(spriteId, a, b); + push(a); + } else { + push(0); + } break; case 85: - pop(); + spriteId = pop(); + if (spriteId) { + spriteInfoGet_tx_ty(spriteId, a, b); + push(a); + } else { + push(0); + } break; case 86: - pop(); + spriteId = pop(); + if (spriteId) { + spriteInfoGet_tx_ty(spriteId, a, b); + push(b); + } else { + push(0); + } break; default: error("o100_getSpriteInfo: Unknown case %d", subOp); } - push(0); debug(1,"o100_getSpriteInfo stub (%d)", subOp); } diff --git a/scumm/script_v90he.cpp b/scumm/script_v90he.cpp index d5786b58d8..abc116b5ef 100644 --- a/scumm/script_v90he.cpp +++ b/scumm/script_v90he.cpp @@ -847,6 +847,13 @@ void ScummEngine_v90he::o90_getSpriteInfo() { else push(0); break; + case 32: + spriteId = pop(); + if (spriteId) + push(spriteInfoGet_field_7C(spriteId)); + else + push(0); + break; case 33: spriteId = pop(); if (spriteId) @@ -868,6 +875,13 @@ void ScummEngine_v90he::o90_getSpriteInfo() { else push(0); break; + case 56: + spriteId = pop(); + if (spriteId) + push(spriteInfoGet_field_14(spriteId)); + else + push(0); + break; case 62: spriteId = pop(); if (spriteId) @@ -880,7 +894,7 @@ void ScummEngine_v90he::o90_getSpriteInfo() { if (spriteId) push(spriteInfoGet_field_78(spriteId)); else - push(0); + push(1); break; case 68: spriteId = pop(); @@ -1289,19 +1303,17 @@ void ScummEngine_v90he::o90_getSpriteGroupInfo() { break; case 43: spriteGroupId = pop(); - if (spriteGroupId) { + if (spriteGroupId) push(spriteGroupGet_field_10(spriteGroupId)); - } else { + else push(0); - } break; case 63: // HE 99+ spriteGroupId = pop(); - if (spriteGroupId) { + if (spriteGroupId) push(spriteGroupGet_field_20(spriteGroupId)); - } else { + else push(0); - } break; case 139: // HE 99+ // dummy case diff --git a/scumm/sprite_he.cpp b/scumm/sprite_he.cpp index dbb809db40..5a1e1fbf38 100644 --- a/scumm/sprite_he.cpp +++ b/scumm/sprite_he.cpp @@ -104,6 +104,12 @@ int ScummEngine_v90he::spriteInfoGet_groupNum(int spriteId) { return _spriteTable[spriteId].group_num; } +int ScummEngine_v90he::spriteInfoGet_field_14(int spriteId) { + checkRange(_varNumSprites, 1, spriteId, "spriteInfoGet_field_14: Invalid sprite %d"); + + return _spriteTable[spriteId].field_14; +} + int ScummEngine_v90he::spriteInfoGet_field_18(int spriteId) { checkRange(_varNumSprites, 1, spriteId, "spriteInfoGet_field_18: Invalid sprite %d"); @@ -158,6 +164,12 @@ int ScummEngine_v90he::spriteInfoGet_field_78(int spriteId) { return _spriteTable[spriteId].field_78; } +int ScummEngine_v90he::spriteInfoGet_field_7C(int spriteId) { + checkRange(_varNumSprites, 1, spriteId, "spriteInfoGet_field_7C: Invalid sprite %d"); + + return _spriteTable[spriteId].field_7C; +} + int ScummEngine_v90he::spriteInfoGet_field_80(int spriteId) { checkRange(_varNumSprites, 1, spriteId, "spriteInfoGet_field_80: Invalid sprite %d"); |