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
|
@ -218,7 +218,8 @@ R_BindAnimatedImage
|
|||
=================
|
||||
*/
|
||||
static void R_BindAnimatedImage( textureBundle_t *bundle ) {
|
||||
int index;
|
||||
int64_t index;
|
||||
double v;
|
||||
|
||||
if ( bundle->isVideoMap ) {
|
||||
ri.CIN_RunCinematic(bundle->videoMapHandle);
|
||||
|
@ -233,8 +234,10 @@ static void R_BindAnimatedImage( textureBundle_t *bundle ) {
|
|||
|
||||
// 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