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:
1 parent
9c4c363ccc
commit
30fdd88c9f
8 files changed
+63
-47
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user