mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 08:52:00 +00:00
Use fixed point number for XSPRITE scaling
This commit is contained in:
parent
0dcca3583f
commit
38f2fd209f
2 changed files with 4 additions and 6 deletions
|
@ -431,13 +431,13 @@ bool isShrinked(spritetype* pSprite) {
|
|||
}
|
||||
|
||||
bool shrinkPlayerSize(PLAYER* pPlayer, int divider) {
|
||||
pPlayer->pXSprite->scale = -divider;
|
||||
pPlayer->pXSprite->scale = 256/divider;
|
||||
playerSetRace(pPlayer, kModeHumanShrink);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool growPlayerSize(PLAYER* pPlayer, int multiplier) {
|
||||
pPlayer->pXSprite->scale = multiplier;
|
||||
pPlayer->pXSprite->scale = 256*multiplier;
|
||||
playerSetRace(pPlayer, kModeHumanGrown);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -108,14 +108,12 @@ void UpdateSprite(int nXSprite, SEQFRAME *pFrame)
|
|||
|
||||
int scale = xsprite[nXSprite].scale; // SEQ size scaling
|
||||
if (pFrame->at2_0) {
|
||||
if (scale < 0) pSprite->xrepeat = pFrame->at2_0 / abs(scale);
|
||||
else if (scale > 0) pSprite->xrepeat = pFrame->at2_0 * scale;
|
||||
if (scale) pSprite->xrepeat = mulscale8(pFrame->at2_0, scale);
|
||||
else pSprite->xrepeat = pFrame->at2_0;
|
||||
}
|
||||
|
||||
if (pFrame->at3_0) {
|
||||
if (scale < 0) pSprite->yrepeat = pFrame->at3_0 / abs(scale);
|
||||
else if (scale > 0) pSprite->yrepeat = pFrame->at3_0 * scale;
|
||||
if (scale) pSprite->yrepeat = mulscale8(pFrame->at3_0, scale);
|
||||
else pSprite->yrepeat = pFrame->at3_0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue