mirror of
https://github.com/ZDoom/Raze.git
synced 2025-06-04 19:20:43 +00:00
- Major cleanup of Q16.16 utilisation within games and engine.
* Remove fix16.h/cpp and utilise library from m_fixed.h. * Extend m_fixed.h with two inline functions for int to/from float operations. * Replace fix16_floor operations with those from xs_Float.h * Replace multiple Q16.16 conversions from 0 to just be 0. * Replaced all found in-game bit-shifts and multiplications/divisions with inline functions from m_fixed.h * Replaced many casts of FRACUNIT as double in SW's panel.cpp as it is converted to double by way of type promotion. * Fixed missed precision fixes in SW's panel.cpp where some types weren't declared correctly. * Replaced 100+ `Cos()/Sin() >> 16` operations for Blood with inline functions `CosScale16()/SinScale16()`.
This commit is contained in:
parent
d40e53eb53
commit
1354d52c05
104 changed files with 906 additions and 1579 deletions
|
@ -601,7 +601,7 @@ static void updateanimation(md2model_t *m, tspriteptr_t tspr, uint8_t lpal)
|
|||
|
||||
i = (mdtims - sprext->mdanimtims) * ((fps * 120) / 120);
|
||||
|
||||
j = (smooth->mdsmooth || !anim) ? 65536 : ((anim->endframe + 1 - anim->startframe) << 16);
|
||||
j = (smooth->mdsmooth || !anim) ? 65536 : IntToFixed(anim->endframe + 1 - anim->startframe);
|
||||
|
||||
// XXX: Just in case you play the game for a VERY long time...
|
||||
if (i < 0) { i = 0; sprext->mdanimtims = mdtims; }
|
||||
|
@ -636,7 +636,7 @@ static void updateanimation(md2model_t *m, tspriteptr_t tspr, uint8_t lpal)
|
|||
else
|
||||
{
|
||||
if (anim)
|
||||
m->cframe = (i>>16)+anim->startframe;
|
||||
m->cframe = FixedToInt(i)+anim->startframe;
|
||||
|
||||
|
||||
m->nframe = m->cframe+1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue