- 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:
Mitchell Richters 2020-09-01 23:00:35 +10:00
parent d40e53eb53
commit 1354d52c05
104 changed files with 906 additions and 1579 deletions

View file

@ -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;