More sprite functions
svn-id: r16872
This commit is contained in:
parent
a33edcf009
commit
22b8b3e8eb
4 changed files with 102 additions and 25 deletions
|
@ -902,7 +902,7 @@ protected:
|
|||
int spriteInfoGet_field_80(int spriteId);
|
||||
void getSpriteImageDim(int spriteId, int32 &w, int32 &h);
|
||||
void spriteInfoGet_tx_ty(int spriteId, int32 &tx, int32 &ty);
|
||||
void spriteInfoGet_field_2C_30(int spriteId, int32 &field_2C, int32 &field_30);
|
||||
void spriteInfoGet_dx_dy(int spriteId, int32 &dx, int32 &dy);
|
||||
|
||||
int spriteGroupGet_allocateGroupSpritesList(int spriteGroupId);
|
||||
int spriteGroupGet_field_10(int spriteGroupId);
|
||||
|
@ -920,7 +920,7 @@ protected:
|
|||
void spriteInfoSet_resState(int spriteId, int value);
|
||||
void spriteInfoSet_tx_ty(int spriteId, int value1, int value2);
|
||||
void spriteInfoSet_groupNum(int spriteId, int value);
|
||||
void spriteInfoSet_field_2C_30(int spriteId, int value1, int value2);
|
||||
void spriteInfoSet_dx_dy(int spriteId, int value1, int value2);
|
||||
void spriteInfoSet_field_54(int spriteId, int value);
|
||||
void spriteInfoSet_field_44(int spriteId, int value1, int value2);
|
||||
void spriteInfoSet_field_18(int spriteId, int value);
|
||||
|
|
|
@ -1827,7 +1827,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() {
|
|||
spriteId++;
|
||||
|
||||
for (; spriteId <= _curMaxSpriteId; spriteId++)
|
||||
spriteInfoSet_field_2C_30(spriteId, args[0], args[1]);
|
||||
spriteInfoSet_dx_dy(spriteId, args[0], args[1]);
|
||||
break;
|
||||
case 75:
|
||||
args[0] = pop();
|
||||
|
@ -1838,9 +1838,9 @@ void ScummEngine_v100he::o100_setSpriteInfo() {
|
|||
spriteId++;
|
||||
|
||||
for (; spriteId <= _curMaxSpriteId; spriteId++) {
|
||||
spriteInfoGet_field_2C_30(spriteId, tmp[0], tmp[1]);
|
||||
spriteInfoGet_dx_dy(spriteId, tmp[0], tmp[1]);
|
||||
storedFields[0] = tmp[0];
|
||||
spriteInfoSet_field_2C_30(spriteId, args[0], tmp[1]);
|
||||
spriteInfoSet_dx_dy(spriteId, args[0], tmp[1]);
|
||||
}
|
||||
break;
|
||||
case 76:
|
||||
|
@ -1852,9 +1852,9 @@ void ScummEngine_v100he::o100_setSpriteInfo() {
|
|||
spriteId++;
|
||||
|
||||
for (; spriteId <= _curMaxSpriteId; spriteId++) {
|
||||
spriteInfoGet_field_2C_30(spriteId, tmp[0], tmp[1]);
|
||||
spriteInfoGet_dx_dy(spriteId, tmp[0], tmp[1]);
|
||||
storedFields[1] = tmp[1];
|
||||
spriteInfoSet_field_2C_30(spriteId, tmp[0], args[0]);
|
||||
spriteInfoSet_dx_dy(spriteId, tmp[0], args[0]);
|
||||
}
|
||||
break;
|
||||
case 82:
|
||||
|
@ -2490,7 +2490,7 @@ void ScummEngine_v100he::o100_getSpriteInfo() {
|
|||
case 75:
|
||||
spriteId = pop();
|
||||
if (spriteId) {
|
||||
spriteInfoGet_field_2C_30(spriteId, a, b);
|
||||
spriteInfoGet_dx_dy(spriteId, a, b);
|
||||
push(a);
|
||||
} else {
|
||||
push(0);
|
||||
|
@ -2499,7 +2499,7 @@ void ScummEngine_v100he::o100_getSpriteInfo() {
|
|||
case 76:
|
||||
spriteId = pop();
|
||||
if (spriteId) {
|
||||
spriteInfoGet_field_2C_30(spriteId, a, b);
|
||||
spriteInfoGet_dx_dy(spriteId, a, b);
|
||||
push(b);
|
||||
} else {
|
||||
push(0);
|
||||
|
|
|
@ -745,7 +745,7 @@ void ScummEngine_v90he::o90_getSpriteInfo() {
|
|||
case 4:
|
||||
spriteId = pop();
|
||||
if (spriteId) {
|
||||
spriteInfoGet_field_2C_30(spriteId, a, b);
|
||||
spriteInfoGet_dx_dy(spriteId, a, b);
|
||||
push(a);
|
||||
} else {
|
||||
push(0);
|
||||
|
@ -754,7 +754,7 @@ void ScummEngine_v90he::o90_getSpriteInfo() {
|
|||
case 5:
|
||||
spriteId = pop();
|
||||
if (spriteId) {
|
||||
spriteInfoGet_field_2C_30(spriteId, a, b);
|
||||
spriteInfoGet_dx_dy(spriteId, a, b);
|
||||
push(b);
|
||||
} else {
|
||||
push(0);
|
||||
|
@ -970,9 +970,9 @@ void ScummEngine_v90he::o90_setSpriteInfo() {
|
|||
spriteId++;
|
||||
|
||||
for (; spriteId <= _curMaxSpriteId; spriteId++) {
|
||||
spriteInfoGet_field_2C_30(spriteId, tmp[0], tmp[1]);
|
||||
spriteInfoGet_dx_dy(spriteId, tmp[0], tmp[1]);
|
||||
storedFields[0] = tmp[0];
|
||||
spriteInfoSet_field_2C_30(spriteId, args[0], tmp[1]);
|
||||
spriteInfoSet_dx_dy(spriteId, args[0], tmp[1]);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
|
@ -984,9 +984,9 @@ void ScummEngine_v90he::o90_setSpriteInfo() {
|
|||
spriteId++;
|
||||
|
||||
for (; spriteId <= _curMaxSpriteId; spriteId++) {
|
||||
spriteInfoGet_field_2C_30(spriteId, tmp[0], tmp[1]);
|
||||
spriteInfoGet_dx_dy(spriteId, tmp[0], tmp[1]);
|
||||
storedFields[1] = tmp[1];
|
||||
spriteInfoSet_field_2C_30(spriteId, tmp[0], args[0]);
|
||||
spriteInfoSet_dx_dy(spriteId, tmp[0], args[0]);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
|
@ -1142,7 +1142,7 @@ void ScummEngine_v90he::o90_setSpriteInfo() {
|
|||
spriteId++;
|
||||
|
||||
for (; spriteId <= _curMaxSpriteId; spriteId++)
|
||||
spriteInfoSet_field_2C_30(spriteId, args[0], args[1]);
|
||||
spriteInfoSet_dx_dy(spriteId, args[0], args[1]);
|
||||
break;
|
||||
case 48:
|
||||
args[0] = pop();
|
||||
|
|
|
@ -209,11 +209,11 @@ void ScummEngine_v90he::spriteInfoGet_tx_ty(int spriteId, int32 &tx, int32 &ty)
|
|||
ty = _spriteTable[spriteId].ty;
|
||||
}
|
||||
|
||||
void ScummEngine_v90he::spriteInfoGet_field_2C_30(int spriteId, int32 &field_2C, int32 &field_30) {
|
||||
void ScummEngine_v90he::spriteInfoGet_dx_dy(int spriteId, int32 &dx, int32 &dy) {
|
||||
checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d");
|
||||
|
||||
field_2C = _spriteTable[spriteId].dx;
|
||||
field_30 = _spriteTable[spriteId].dy;
|
||||
dx = _spriteTable[spriteId].dx;
|
||||
dy = _spriteTable[spriteId].dy;
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -330,7 +330,7 @@ void ScummEngine_v90he::spriteInfoSet_groupNum(int spriteId, int value) {
|
|||
_spriteTable[spriteId].group_num = value;
|
||||
}
|
||||
|
||||
void ScummEngine_v90he::spriteInfoSet_field_2C_30(int spriteId, int value1, int value2) {
|
||||
void ScummEngine_v90he::spriteInfoSet_dx_dy(int spriteId, int value1, int value2) {
|
||||
checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d");
|
||||
|
||||
_spriteTable[spriteId].dx = value1;
|
||||
|
@ -642,7 +642,12 @@ void ScummEngine_v90he::spriteGroupSet_case0_3(int spriteGroupId, int value) {
|
|||
}
|
||||
|
||||
void ScummEngine_v90he::spriteGroupSet_case0_4(int spriteGroupId) {
|
||||
// TODO
|
||||
checkRange(_varNumSpriteGroups, 1, spriteGroupId, "Invalid sprite group %d");
|
||||
|
||||
for (int i = 1; i < _varNumSprites; i++) {
|
||||
if (_spriteTable[i].group_num == spriteGroupId)
|
||||
spriteInfoSet_resetSprite(i);
|
||||
}
|
||||
}
|
||||
|
||||
void ScummEngine_v90he::spriteGroupSet_case0_5(int spriteGroupId, int value) {
|
||||
|
@ -682,19 +687,91 @@ void ScummEngine_v90he::spriteGroupSet_case0_7(int spriteGroupId, int value) {
|
|||
}
|
||||
|
||||
void ScummEngine_v90he::spriteGroupSet_case5_0(int spriteGroupId, int value) {
|
||||
// TODO
|
||||
checkRange(_varNumSpriteGroups, 1, spriteGroupId, "Invalid sprite group %d");
|
||||
|
||||
if (_spriteGroups[spriteGroupId].field_30 == value)
|
||||
return;
|
||||
|
||||
_spriteGroups[spriteGroupId].field_30 = value;
|
||||
_spriteGroups[spriteGroupId].scale_x = _spriteGroups[spriteGroupId].field_30 / _spriteGroups[spriteGroupId].field_34;
|
||||
|
||||
if ((_spriteGroups[spriteGroupId].field_30 != _spriteGroups[spriteGroupId].field_34) || (_spriteGroups[spriteGroupId].field_38 != _spriteGroups[spriteGroupId].field_3C))
|
||||
_spriteGroups[spriteGroupId].scaling = 1;
|
||||
else
|
||||
_spriteGroups[spriteGroupId].scaling = 0;
|
||||
|
||||
for (int i = 0; i < _numSpritesToProcess; ++i) {
|
||||
SpriteInfo *spi = _activeSpritesTable[i];
|
||||
if (spi->group_num == spriteGroupId) {
|
||||
spi->flags |= kSF01 | kSFNeedRedraw;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ScummEngine_v90he::spriteGroupSet_case5_1(int spriteGroupId, int value) {
|
||||
// TODO
|
||||
checkRange(_varNumSpriteGroups, 1, spriteGroupId, "Invalid sprite group %d");
|
||||
|
||||
if (_spriteGroups[spriteGroupId].field_34 == value)
|
||||
return;
|
||||
|
||||
_spriteGroups[spriteGroupId].field_34 = value;
|
||||
_spriteGroups[spriteGroupId].scale_x = _spriteGroups[spriteGroupId].field_30 / _spriteGroups[spriteGroupId].field_34;
|
||||
|
||||
if ((_spriteGroups[spriteGroupId].field_30 != _spriteGroups[spriteGroupId].field_34) || (_spriteGroups[spriteGroupId].field_38 != _spriteGroups[spriteGroupId].field_3C))
|
||||
_spriteGroups[spriteGroupId].scaling = 1;
|
||||
else
|
||||
_spriteGroups[spriteGroupId].scaling = 0;
|
||||
|
||||
for (int i = 0; i < _numSpritesToProcess; ++i) {
|
||||
SpriteInfo *spi = _activeSpritesTable[i];
|
||||
if (spi->group_num == spriteGroupId) {
|
||||
spi->flags |= kSF01 | kSFNeedRedraw;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ScummEngine_v90he::spriteGroupSet_case5_2(int spriteGroupId, int value) {
|
||||
// TODO
|
||||
checkRange(_varNumSpriteGroups, 1, spriteGroupId, "Invalid sprite group %d");
|
||||
|
||||
if (_spriteGroups[spriteGroupId].field_38 == value)
|
||||
return;
|
||||
|
||||
_spriteGroups[spriteGroupId].field_38 = value;
|
||||
_spriteGroups[spriteGroupId].scale_y = _spriteGroups[spriteGroupId].field_38 / _spriteGroups[spriteGroupId].field_3C;
|
||||
|
||||
if ((_spriteGroups[spriteGroupId].field_30 != _spriteGroups[spriteGroupId].field_34) || (_spriteGroups[spriteGroupId].field_38 != _spriteGroups[spriteGroupId].field_3C))
|
||||
_spriteGroups[spriteGroupId].scaling = 1;
|
||||
else
|
||||
_spriteGroups[spriteGroupId].scaling = 0;
|
||||
|
||||
for (int i = 0; i < _numSpritesToProcess; ++i) {
|
||||
SpriteInfo *spi = _activeSpritesTable[i];
|
||||
if (spi->group_num == spriteGroupId) {
|
||||
spi->flags |= kSF01 | kSFNeedRedraw;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ScummEngine_v90he::spriteGroupSet_case5_3(int spriteGroupId, int value) {
|
||||
// TODO
|
||||
checkRange(_varNumSpriteGroups, 1, spriteGroupId, "Invalid sprite group %d");
|
||||
|
||||
if (_spriteGroups[spriteGroupId].field_3C == value)
|
||||
return;
|
||||
|
||||
_spriteGroups[spriteGroupId].field_3C = value;
|
||||
_spriteGroups[spriteGroupId].scale_y = _spriteGroups[spriteGroupId].field_38 / _spriteGroups[spriteGroupId].field_3C;
|
||||
|
||||
if ((_spriteGroups[spriteGroupId].field_30 != _spriteGroups[spriteGroupId].field_34) || (_spriteGroups[spriteGroupId].field_38 != _spriteGroups[spriteGroupId].field_3C))
|
||||
_spriteGroups[spriteGroupId].scaling = 1;
|
||||
else
|
||||
_spriteGroups[spriteGroupId].scaling = 0;
|
||||
|
||||
for (int i = 0; i < _numSpritesToProcess; ++i) {
|
||||
SpriteInfo *spi = _activeSpritesTable[i];
|
||||
if (spi->group_num == spriteGroupId) {
|
||||
spi->flags |= kSF01 | kSFNeedRedraw;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ScummEngine_v90he::spriteGroupSet_field_10(int spriteGroupId, int value) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue