diff options
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/intern.h | 1 | ||||
-rw-r--r-- | scumm/script_v90he.cpp | 17 | ||||
-rw-r--r-- | scumm/sprite_he.cpp | 6 |
3 files changed, 22 insertions, 2 deletions
diff --git a/scumm/intern.h b/scumm/intern.h index 7d38d4b087..a33ca86cf5 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -891,6 +891,7 @@ protected: int spriteInfoGet_zoom(int spriteNun); int spriteInfoGet_field_78(int spriteNun); int spriteInfoGet_field_80(int spriteNun); + void getSpriteImageDim(int spriteNum, int32 &w, int32 &h); void spritesAllocTables(int numSprites, int numGroups, int numImgSprites); void spritesResetTables(bool refreshScreen); diff --git a/scumm/script_v90he.cpp b/scumm/script_v90he.cpp index fb623e0ea5..2be8fbafa5 100644 --- a/scumm/script_v90he.cpp +++ b/scumm/script_v90he.cpp @@ -699,6 +699,7 @@ void ScummEngine_v90he::o90_getDistanceBetweenPoints() { void ScummEngine_v90he::o90_getSpriteInfo() { int args[16]; int eax, esi; + int32 w, h; byte subOp = fetchScriptByte(); subOp -= 30; @@ -711,10 +712,22 @@ void ScummEngine_v90he::o90_getSpriteInfo() { pop(); break; case 2: - pop(); + eax = pop(); + if (eax) { + getSpriteImageDim(eax, w, h); + push(w); + } else { + push(0); + } break; case 3: - pop(); + eax = pop(); + if (eax) { + getSpriteImageDim(eax, w, h); + push(h); + } else { + push(0); + } break; case 4: pop(); diff --git a/scumm/sprite_he.cpp b/scumm/sprite_he.cpp index 6bfffc6be2..dd0e5d19df 100644 --- a/scumm/sprite_he.cpp +++ b/scumm/sprite_he.cpp @@ -155,6 +155,12 @@ int ScummEngine_v90he::spriteInfoGet_field_80(int spriteNum) { return _spriteTable[spriteNum].field_80; } +void ScummEngine_v90he::getSpriteImageDim(int spriteNum, int32 &w, int32 &h) { + checkRange(_numSprites, 1, spriteNum, "getSpriteImageDim: Invalid sprite %d"); + + getWizImageDim(_spriteTable[spriteNum].res_id, _spriteTable[spriteNum].res_state, w, h); +} + void ScummEngine_v90he::spritesAllocTables(int numSprites, int numGroups, int numImgLists) { _varNumSpriteGroups = numGroups; _numSpritesToProcess = 0; |