Add sprite function

svn-id: r16834
This commit is contained in:
Travis Howell 2005-02-20 23:55:11 +00:00
parent 8ae3fe1ffe
commit e62d949fb6
3 changed files with 22 additions and 2 deletions

View file

@ -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);

View file

@ -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();

View file

@ -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;