aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Howell2005-02-21 00:25:30 +0000
committerTravis Howell2005-02-21 00:25:30 +0000
commit4f2cd36bd9c2eaebb74c7ede5367290679254cca (patch)
treebd3193318feb71166f9ec5c490dcf2d710539ea4
parent70982f556e2560eef2b8230326bc7cad7e64a6bf (diff)
downloadscummvm-rg350-4f2cd36bd9c2eaebb74c7ede5367290679254cca.tar.gz
scummvm-rg350-4f2cd36bd9c2eaebb74c7ede5367290679254cca.tar.bz2
scummvm-rg350-4f2cd36bd9c2eaebb74c7ede5367290679254cca.zip
More getSpriteInfo functions
svn-id: r16836
-rw-r--r--scumm/intern.h2
-rw-r--r--scumm/script_v90he.cpp44
-rw-r--r--scumm/sprite_he.cpp24
3 files changed, 57 insertions, 13 deletions
diff --git a/scumm/intern.h b/scumm/intern.h
index 0392ca5628..2c1399f59f 100644
--- a/scumm/intern.h
+++ b/scumm/intern.h
@@ -895,6 +895,8 @@ protected:
int spriteInfoGet_field_78(int spriteNun);
int spriteInfoGet_field_80(int spriteNun);
void getSpriteImageDim(int spriteNum, int32 &w, int32 &h);
+ void spriteInfoGet_tx_ty(int spriteNum, int32 &tx, int32 &ty);
+ void spriteInfoGet_field_2C_30(int spriteNum, int32 &field_2C, int32 &field_30);
void spriteInfoSet_field_14(int spriteNum, int value);
void spriteInfoSet_field_7C(int spriteNum, int value);
diff --git a/scumm/script_v90he.cpp b/scumm/script_v90he.cpp
index f675bf065a..64aec9e826 100644
--- a/scumm/script_v90he.cpp
+++ b/scumm/script_v90he.cpp
@@ -699,23 +699,33 @@ void ScummEngine_v90he::o90_getDistanceBetweenPoints() {
void ScummEngine_v90he::o90_getSpriteInfo() {
int args[16];
int eax, esi;
- int32 w, h;
+ int32 a, b;
byte subOp = fetchScriptByte();
subOp -= 30;
debug(1,"o90_getSpriteInfo stub (%d)", subOp);
switch (subOp) {
case 0:
- pop();
- break;
+ eax = pop();
+ if (eax) {
+ spriteInfoGet_tx_ty(eax, a, b);
+ push(a);
+ } else {
+ push(0);
+ }
case 1:
- pop();
- break;
+ eax = pop();
+ if (eax) {
+ spriteInfoGet_tx_ty(eax, a, b);
+ push(b);
+ } else {
+ push(0);
+ }
case 2:
eax = pop();
if (eax) {
- getSpriteImageDim(eax, w, h);
- push(w);
+ getSpriteImageDim(eax, a, b);
+ push(a);
} else {
push(0);
}
@@ -723,17 +733,29 @@ void ScummEngine_v90he::o90_getSpriteInfo() {
case 3:
eax = pop();
if (eax) {
- getSpriteImageDim(eax, w, h);
- push(h);
+ getSpriteImageDim(eax, a, b);
+ push(b);
} else {
push(0);
}
break;
case 4:
- pop();
+ eax = pop();
+ if (eax) {
+ spriteInfoGet_field_2C_30(eax, a, b);
+ push(a);
+ } else {
+ push(0);
+ }
break;
case 5:
- pop();
+ eax = pop();
+ if (eax) {
+ spriteInfoGet_field_2C_30(eax, a, b);
+ push(b);
+ } else {
+ push(0);
+ }
break;
case 6:
eax = pop();
diff --git a/scumm/sprite_he.cpp b/scumm/sprite_he.cpp
index bce46f6727..6434178e6b 100644
--- a/scumm/sprite_he.cpp
+++ b/scumm/sprite_he.cpp
@@ -110,13 +110,19 @@ int ScummEngine_v90he::spriteInfoGet_field_18(int spriteNum) {
int ScummEngine_v90he::spriteInfoGet_grp_tx(int spriteNum) {
checkRange(_numSprites, 1, spriteNum, "spriteInfoGet_grp_tx: Invalid sprite %d");
- return _spriteTable[spriteNum].tx;
+ if (_spriteTable[spriteNum].group_num)
+ return _spriteTable[spriteNum].tx + _spriteGroups[spriteNum].tx;
+ else
+ 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;
+ if (_spriteTable[spriteNum].group_num)
+ return _spriteTable[spriteNum].ty + _spriteGroups[spriteNum].ty;
+ else
+ return _spriteTable[spriteNum].ty;
}
int ScummEngine_v90he::spriteInfoGet_field_44(int spriteNum) {
@@ -161,6 +167,20 @@ void ScummEngine_v90he::getSpriteImageDim(int spriteNum, int32 &w, int32 &h) {
getWizImageDim(_spriteTable[spriteNum].res_id, _spriteTable[spriteNum].res_state, w, h);
}
+void ScummEngine_v90he::spriteInfoGet_tx_ty(int spriteNum, int32 &tx, int32 &ty) {
+ checkRange(_numSprites, 1, spriteNum, "spriteInfoGet_tx_ty: Invalid sprite %d");
+
+ tx = _spriteTable[spriteNum].tx;
+ ty = _spriteTable[spriteNum].ty;
+}
+
+void ScummEngine_v90he::spriteInfoGet_field_2C_30(int spriteNum, int32 &field_2C, int32 &field_30) {
+ checkRange(_numSprites, 1, spriteNum, "spriteInfoGet_field_2C_30: Invalid sprite %d");
+
+ field_2C = _spriteTable[spriteNum].field_2C;
+ field_30 = _spriteTable[spriteNum].field_30;
+}
+
//
// spriteInfoSet functions
//