[ioquake3] 28/34: Fix loading renderer DLLs on Windows x86

Simon McVittie smcv at debian.org
Fri Sep 8 10:33:25 UTC 2017


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to annotated tag debian/1.36+u20170908+dfsg1-1
in repository ioquake3.

commit 6f0736ce9a29ab402b5b0e884055eb81e47e4a4b
Author: Zack Middleton <zturtleman at gmail.com>
Date:   Thu Sep 7 20:38:10 2017 -0500

    Fix loading renderer DLLs on Windows x86
    
    After 'Fix floating point precision loss in renderer', Windows x86
    client won't load the renderer DLLs. The problem is a 64 bit modulus.
    I couldn't find any reports of this online. However, client with
    built-in renderer worked with the 64 bit modulus.
    
    Only tested with mingw-w64.
---
 code/renderergl1/tr_shade.c | 7 ++++++-
 code/renderergl2/tr_shade.c | 7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/code/renderergl1/tr_shade.c b/code/renderergl1/tr_shade.c
index 61a6e0b..57a43c5 100644
--- a/code/renderergl1/tr_shade.c
+++ b/code/renderergl1/tr_shade.c
@@ -239,7 +239,12 @@ static void R_BindAnimatedImage( textureBundle_t *bundle ) {
 	if ( index < 0 ) {
 		index = 0;	// may happen with shader time offsets
 	}
-	index %= bundle->numImageAnimations;
+
+	// Windows x86 doesn't load renderer DLL with 64 bit modulus
+	//index %= bundle->numImageAnimations;
+	while ( index >= bundle->numImageAnimations ) {
+		index -= bundle->numImageAnimations;
+	}
 
 	GL_Bind( bundle->image[ index ] );
 }
diff --git a/code/renderergl2/tr_shade.c b/code/renderergl2/tr_shade.c
index b0ca862..0366247 100644
--- a/code/renderergl2/tr_shade.c
+++ b/code/renderergl2/tr_shade.c
@@ -87,7 +87,12 @@ static void R_BindAnimatedImageToTMU( textureBundle_t *bundle, int tmu ) {
 	if ( index < 0 ) {
 		index = 0;	// may happen with shader time offsets
 	}
-	index %= bundle->numImageAnimations;
+
+	// Windows x86 doesn't load renderer DLL with 64 bit modulus
+	//index %= bundle->numImageAnimations;
+	while ( index >= bundle->numImageAnimations ) {
+		index -= bundle->numImageAnimations;
+	}
 
 	GL_BindToTMU( bundle->image[ index ], tmu );
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/ioquake3.git



More information about the Pkg-games-commits mailing list