diff options
-rw-r--r-- | scumm/intern.h | 13 | ||||
-rw-r--r-- | scumm/script_v90he.cpp | 84 | ||||
-rw-r--r-- | scumm/sprite_he.cpp | 72 |
3 files changed, 157 insertions, 12 deletions
diff --git a/scumm/intern.h b/scumm/intern.h index f891eaccc0..7d38d4b087 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -879,6 +879,19 @@ protected: int spriteInfoGet_flags_6(int spriteNum); int spriteInfoGet_flags_7(int spriteNum); int spriteInfoGet_flags_8(int spriteNum); + int spriteInfoGet_resId(int spriteNun); + int spriteInfoGet_resState(int spriteNun); + int spriteInfoGet_groupNum(int spriteNun); + int spriteInfoGet_field_18(int spriteNun); + int spriteInfoGet_grp_tx(int spriteNun); + int spriteInfoGet_grp_ty(int spriteNun); + int spriteInfoGet_field_44(int spriteNun); + int spriteInfoGet_field_54(int spriteNun); + int spriteInfoGet_wizSize(int spriteNun); + int spriteInfoGet_zoom(int spriteNun); + int spriteInfoGet_field_78(int spriteNun); + int spriteInfoGet_field_80(int spriteNun); + void spritesAllocTables(int numSprites, int numGroups, int numImgSprites); void spritesResetTables(bool refreshScreen); void spriteGroupCheck(int sprGrpId); diff --git a/scumm/script_v90he.cpp b/scumm/script_v90he.cpp index 329b433bed..fb623e0ea5 100644 --- a/scumm/script_v90he.cpp +++ b/scumm/script_v90he.cpp @@ -723,16 +723,32 @@ void ScummEngine_v90he::o90_getSpriteInfo() { pop(); break; case 6: - pop(); + eax = pop(); + if (eax) + push(spriteInfoGet_wizSize(eax)); + else + push(0); break; case 7: - pop(); + eax = pop(); + if (eax) + push(spriteInfoGet_groupNum(eax)); + else + push(0); break; case 8: - pop(); + eax = pop(); + if (eax) + push(spriteInfoGet_grp_tx(eax)); + else + push(0); break; case 9: - pop(); + eax = pop(); + if (eax) + push(spriteInfoGet_grp_ty(eax)); + else + push(0); break; case 12: esi = pop(); @@ -762,7 +778,11 @@ void ScummEngine_v90he::o90_getSpriteInfo() { } break; case 13: - pop(); + eax = pop(); + if (eax) + push(spriteInfoGet_field_18(eax)); + else + push(0); break; case 15: if (_heversion == 99) { @@ -783,13 +803,25 @@ void ScummEngine_v90he::o90_getSpriteInfo() { } break; case 22: - pop(); + eax = pop(); + if (eax) + push(spriteInfoGet_resState(eax)); + else + push(0); break; case 33: - pop(); + eax = pop(); + if (eax) + push(spriteInfoGet_resId(eax)); + else + push(0); break; case 38: - pop(); + eax = pop(); + if (eax) + push(spriteInfoGet_flags_8(eax)); + else + push(1); break; case 52: eax = pop(); @@ -799,13 +831,25 @@ void ScummEngine_v90he::o90_getSpriteInfo() { push(0); break; case 62: - pop(); + eax = pop(); + if (eax) + push(spriteInfoGet_zoom(eax)); + else + push(0); break; case 67: - pop(); + eax = pop(); + if (eax) + push(spriteInfoGet_field_78(eax)); + else + push(0); break; case 68: - pop(); + eax = pop(); + if (eax) + push(spriteInfoGet_field_54(eax)); + else + push(0); break; case 94: eax = pop(); @@ -818,9 +862,25 @@ void ScummEngine_v90he::o90_getSpriteInfo() { getStackList(args, ARRAYSIZE(args)); pop(); break; - case 168: + case 109: + // dummy case pop(); + push(0); + break; + case 110: + eax = pop(); + if (eax) + push(spriteInfoGet_field_80(eax)); + else + push(0); + break; + case 168: pop(); + eax = pop(); + if (eax) + push(spriteInfoGet_field_44(eax)); + else + push(0); break; default: error("o90_getSpriteInfo: Unknown case %d", subOp); diff --git a/scumm/sprite_he.cpp b/scumm/sprite_he.cpp index 72d7433915..6bfffc6be2 100644 --- a/scumm/sprite_he.cpp +++ b/scumm/sprite_he.cpp @@ -83,6 +83,78 @@ int ScummEngine_v90he::spriteInfoGet_flags_8(int spriteNum) { return ((_spriteTable[spriteNum].flags & kSF31) != 0) ? 1 : 0; } +int ScummEngine_v90he::spriteInfoGet_resId(int spriteNum) { + checkRange(_numSprites, 1, spriteNum, "spriteInfoGet_resId: Invalid sprite %d"); + + return _spriteTable[spriteNum].res_id; +} + +int ScummEngine_v90he::spriteInfoGet_resState(int spriteNum) { + checkRange(_numSprites, 1, spriteNum, "spriteInfoGet_resState: Invalid sprite %d"); + + return _spriteTable[spriteNum].res_state; +} + +int ScummEngine_v90he::spriteInfoGet_groupNum(int spriteNum) { + checkRange(_numSprites, 1, spriteNum, "spriteInfoGet_groupNum: Invalid sprite %d"); + + return _spriteTable[spriteNum].group_num; +} + +int ScummEngine_v90he::spriteInfoGet_field_18(int spriteNum) { + checkRange(_numSprites, 1, spriteNum, "spriteInfoGet_field_18: Invalid sprite %d"); + + return _spriteTable[spriteNum].field_18; +} + +int ScummEngine_v90he::spriteInfoGet_grp_tx(int spriteNum) { + checkRange(_numSprites, 1, spriteNum, "spriteInfoGet_grp_tx: Invalid sprite %d"); + + return _spriteTable[spriteNum].tx; +} + +int ScummEngine_v90he::spriteInfoGet_grp_ty(int spriteNum) { + checkRange(_numSprites, 1, spriteNum, "spriteInfoGet_grp_ty: Invalid sprite %d"); + + return _spriteTable[spriteNum].ty; +} + +int ScummEngine_v90he::spriteInfoGet_field_44(int spriteNum) { + checkRange(_numSprites, 1, spriteNum, "spriteInfoGet_field_44: Invalid sprite %d"); + + return _spriteTable[spriteNum].field_44; +} + +int ScummEngine_v90he::spriteInfoGet_field_54(int spriteNum) { + checkRange(_numSprites, 1, spriteNum, "spriteInfoGet_field_54: Invalid sprite %d"); + + return _spriteTable[spriteNum].field_54; +} + +int ScummEngine_v90he::spriteInfoGet_wizSize(int spriteNum) { + checkRange(_numSprites, 1, spriteNum, "spriteInfoGet_wizSize: Invalid sprite %d"); + + return _spriteTable[spriteNum].res_wiz_states; +} + +int ScummEngine_v90he::spriteInfoGet_zoom(int spriteNum) { + checkRange(_numSprites, 1, spriteNum, "spriteInfoGet_zoom: Invalid sprite %d"); + + return _spriteTable[spriteNum].zoom; +} + +int ScummEngine_v90he::spriteInfoGet_field_78(int spriteNum) { + checkRange(_numSprites, 1, spriteNum, "spriteInfoGet_field_78: Invalid sprite %d"); + + return _spriteTable[spriteNum].field_78; +} + +int ScummEngine_v90he::spriteInfoGet_field_80(int spriteNum) { + checkRange(_numSprites, 1, spriteNum, "spriteInfoGet_field_80: Invalid sprite %d"); + + return _spriteTable[spriteNum].field_80; +} + void ScummEngine_v90he::spritesAllocTables(int numSprites, int numGroups, int numImgLists) { _varNumSpriteGroups = numGroups; _numSpritesToProcess = 0; |