File tree Expand file tree Collapse file tree 3 files changed +14
-7
lines changed
Expand file tree Collapse file tree 3 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -703,6 +703,8 @@ signed short ClampShort( int i );
703703
704704float q3powf ( float x , int y );
705705
706+ qboolean Q_isnan (float f );
707+
706708// this isn't a real cheap function to call!
707709int DirToByte ( vec3_t dir );
708710void ByteToDir ( int b , vec3_t dir );
Original file line number Diff line number Diff line change 22//
33// q_math.c -- stateless support routines that are included in each code module
44#include " ../game/q_shared.h"
5+ #include < float.h>
56
67
78vec3_t vec3_origin = {0 ,0 ,0 };
@@ -546,11 +547,7 @@ float Q_rsqrt( float number )
546547 y = y * ( threehalfs - ( x2 * y * y ) ); // 1st iteration
547548// y = y * ( threehalfs - ( x2 * y * y ) ); // 2nd iteration, this can be removed
548549
549- #ifndef Q3_VM
550- #ifdef __linux__
551- assert ( !isnan (y) ); // bk010122 - FPE?
552- #endif
553- #endif
550+ assert (!Q_isnan (y));
554551 return y;
555552}
556553
@@ -1036,3 +1033,11 @@ float q3powf ( float x, int y )
10361033 r = r * r;
10371034 return r;
10381035}
1036+
1037+ qboolean Q_isnan (float f) {
1038+ #ifdef _WIN32
1039+ return (qboolean)(_isnan (f) != 0 );
1040+ #else
1041+ return (qboolean)(isnan (f) != 0 );
1042+ #endif
1043+ }
Original file line number Diff line number Diff line change @@ -904,8 +904,8 @@ void RB_CalcFogTexCoords( float *st ) {
904904 }
905905 }
906906
907- st[0 ] = s;
908- st[1 ] = t;
907+ st[0 ] = Q_isnan (s) ? 0 . 0f : s;
908+ st[1 ] = Q_isnan (s) ? 0 . 0f : t;
909909 st += 2 ;
910910 }
911911}
You can’t perform that action at this time.
0 commit comments