aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorTravis Howell2005-02-20 23:55:11 +0000
committerTravis Howell2005-02-20 23:55:11 +0000
commite62d949fb6364d46df9dcd04125e110e56d49c2c (patch)
tree8ab93a036ab707a07c3b8803e274dc8a0bc781cd /scumm
parent8ae3fe1ffefa4ba47428a4a4d246260e4f22de7f (diff)
downloadscummvm-rg350-e62d949fb6364d46df9dcd04125e110e56d49c2c.tar.gz
scummvm-rg350-e62d949fb6364d46df9dcd04125e110e56d49c2c.tar.bz2
scummvm-rg350-e62d949fb6364d46df9dcd04125e110e56d49c2c.zip
Add sprite function
svn-id: r16834
Diffstat (limited to 'scumm')
-rw-r--r--scumm/intern.h1
-rw-r--r--scumm/script_v90he.cpp17
-rw-r--r--scumm/sprite_he.cpp6
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;