mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-13 03:20:44 +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) {
|
bool shrinkPlayerSize(PLAYER* pPlayer, int divider) {
|
||||||
pPlayer->pXSprite->scale = -divider;
|
pPlayer->pXSprite->scale = 256/divider;
|
||||||
playerSetRace(pPlayer, kModeHumanShrink);
|
playerSetRace(pPlayer, kModeHumanShrink);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool growPlayerSize(PLAYER* pPlayer, int multiplier) {
|
bool growPlayerSize(PLAYER* pPlayer, int multiplier) {
|
||||||
pPlayer->pXSprite->scale = multiplier;
|
pPlayer->pXSprite->scale = 256*multiplier;
|
||||||
playerSetRace(pPlayer, kModeHumanGrown);
|
playerSetRace(pPlayer, kModeHumanGrown);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -108,14 +108,12 @@ void UpdateSprite(int nXSprite, SEQFRAME *pFrame)
|
||||||
|
|
||||||
int scale = xsprite[nXSprite].scale; // SEQ size scaling
|
int scale = xsprite[nXSprite].scale; // SEQ size scaling
|
||||||
if (pFrame->at2_0) {
|
if (pFrame->at2_0) {
|
||||||
if (scale < 0) pSprite->xrepeat = pFrame->at2_0 / abs(scale);
|
if (scale) pSprite->xrepeat = mulscale8(pFrame->at2_0, scale);
|
||||||
else if (scale > 0) pSprite->xrepeat = pFrame->at2_0 * scale;
|
|
||||||
else pSprite->xrepeat = pFrame->at2_0;
|
else pSprite->xrepeat = pFrame->at2_0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pFrame->at3_0) {
|
if (pFrame->at3_0) {
|
||||||
if (scale < 0) pSprite->yrepeat = pFrame->at3_0 / abs(scale);
|
if (scale) pSprite->yrepeat = mulscale8(pFrame->at3_0, scale);
|
||||||
else if (scale > 0) pSprite->yrepeat = pFrame->at3_0 * scale;
|
|
||||||
else pSprite->yrepeat = pFrame->at3_0;
|
else pSprite->yrepeat = pFrame->at3_0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue