mirror of
https://github.com/ioquake/ioq3.git
synced 2025-05-29 16:11:31 +00:00
Fix floating point precision loss in renderer [part 1]
Patch for https://bugzilla.icculus.org/show_bug.cgi?id=5931 by Eugene C. from 2013 plus recent fix for tcMod rotate. I merged the changes into the OpenGL2 renderer though the fix for tcMod turb doesn't translate.
This commit is contained in:
parent
9c4c363ccc
commit
30fdd88c9f
8 changed files with 63 additions and 47 deletions
|
@ -65,7 +65,8 @@ R_BindAnimatedImageToTMU
|
|||
=================
|
||||
*/
|
||||
static void R_BindAnimatedImageToTMU( textureBundle_t *bundle, int tmu ) {
|
||||
int index;
|
||||
int64_t index;
|
||||
double v;
|
||||
|
||||
if ( bundle->isVideoMap ) {
|
||||
ri.CIN_RunCinematic(bundle->videoMapHandle);
|
||||
|
@ -81,8 +82,10 @@ static void R_BindAnimatedImageToTMU( textureBundle_t *bundle, int tmu ) {
|
|||
|
||||
// it is necessary to do this messy calc to make sure animations line up
|
||||
// exactly with waveforms of the same frequency
|
||||
index = ri.ftol(tess.shaderTime * bundle->imageAnimationSpeed * FUNCTABLE_SIZE);
|
||||
index >>= FUNCTABLE_SIZE2;
|
||||
//index = ri.ftol(tess.shaderTime * bundle->imageAnimationSpeed * FUNCTABLE_SIZE);
|
||||
//index >>= FUNCTABLE_SIZE2;
|
||||
v = tess.shaderTime * bundle->imageAnimationSpeed;
|
||||
index = v;
|
||||
|
||||
if ( index < 0 ) {
|
||||
index = 0; // may happen with shader time offsets
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue