diff --git a/3zb2/q_shared.c b/3zb2/q_shared.c index 54ec08d..be5739f 100644 --- a/3zb2/q_shared.c +++ b/3zb2/q_shared.c @@ -244,7 +244,7 @@ float Q_fabs (float f) #if defined _M_IX86 && !defined C_ONLY #pragma warning (disable:4035) -__declspec( naked ) long Q_ftol( float f ) +__declspec( naked ) int Q_ftol (float f) { static int tmp; __asm fld dword ptr [esp+4] @@ -253,6 +253,11 @@ __declspec( naked ) long Q_ftol( float f ) __asm ret } #pragma warning (default:4035) +#else +int Q_ftol (float f) +{ + return (int)f; +} #endif /* diff --git a/3zb2/q_shared.h b/3zb2/q_shared.h index 59c89ba..98b753b 100644 --- a/3zb2/q_shared.h +++ b/3zb2/q_shared.h @@ -192,11 +192,14 @@ extern vec3_t vec3_origin; // microsoft's fabs seems to be ungodly slow... //float Q_fabs (float f); //#define fabs(f) Q_fabs(f) -#if !defined C_ONLY -extern long Q_ftol( float f ); -#else -#define Q_ftol( f ) ( long ) (f) -#endif + +//#if !defined C_ONLY && !defined __linux__ && !defined __sgi +// This used to be a macro, do NOT use this! +// We now use the declared function in a jump table elsewhere. +extern int Q_ftol (float f); +//#else +//#define Q_ftol( f ) ( long ) (f) +//#endif #define DotProduct(x,y) (x[0]*y[0]+x[1]*y[1]+x[2]*y[2]) #define VectorSubtract(a,b,c) (c[0]=a[0]-b[0],c[1]=a[1]-b[1],c[2]=a[2]-b[2]) diff --git a/awaken2/q_shared.c b/awaken2/q_shared.c index b95b28d..82b87a2 100644 --- a/awaken2/q_shared.c +++ b/awaken2/q_shared.c @@ -248,7 +248,7 @@ float Q_fabs(float f) #if defined _M_IX86 && !defined C_ONLY #pragma warning (disable:4035) -__declspec( naked ) long Q_ftol( float f ) +__declspec( naked ) int Q_ftol (float f) { static int tmp; __asm fld dword ptr [esp+4] @@ -257,6 +257,11 @@ __declspec( naked ) long Q_ftol( float f ) __asm ret } #pragma warning (default:4035) +#else +int Q_ftol (float f) +{ + return (int)f; +} #endif /* diff --git a/awaken2/q_shared.h b/awaken2/q_shared.h index 24bd563..935a5d2 100644 --- a/awaken2/q_shared.h +++ b/awaken2/q_shared.h @@ -226,11 +226,14 @@ extern vec3_t vec3_border; // microsoft's fabs seems to be ungodly slow... //float Q_fabs (float f); //#define fabs(f) Q_fabs(f) -#if !defined C_ONLY && !defined __linux__ && !defined __sgi -extern long Q_ftol( float f ); -#else -#define Q_ftol( f ) ( long ) (f) -#endif + +//#if !defined C_ONLY && !defined __linux__ && !defined __sgi +// This used to be a macro, do NOT use this! +// We now use the declared function in a jump table elsewhere. +extern int Q_ftol (float f); +//#else +//#define Q_ftol( f ) ( long ) (f) +//#endif #define DotProduct(x,y) (x[0]*y[0]+x[1]*y[1]+x[2]*y[2]) #define VectorSubtract(a,b,c) (c[0]=a[0]-b[0],c[1]=a[1]-b[1],c[2]=a[2]-b[2]) diff --git a/game/q_shared.c b/game/q_shared.c index 04455f5..5533b7a 100644 --- a/game/q_shared.c +++ b/game/q_shared.c @@ -306,7 +306,7 @@ float Q_fabs (float f) #if defined _M_IX86 && !defined C_ONLY #pragma warning (disable:4035) -__declspec( naked ) int Q_ftol( float f ) +__declspec( naked ) int Q_ftol (float f) { static int tmp; __asm fld dword ptr [esp+4] @@ -315,9 +315,9 @@ __declspec( naked ) int Q_ftol( float f ) __asm ret } #pragma warning (default:4035) -//#else -#elif !defined(Q_ftol) -int Q_ftol( float f ) +//#elif !defined(Q_ftol) +#else +int Q_ftol (float f) { return (int)f; } diff --git a/game/q_shared.h b/game/q_shared.h index fa40fa8..6ff2440 100644 --- a/game/q_shared.h +++ b/game/q_shared.h @@ -310,11 +310,14 @@ extern vec4_t vec4_origin; // microsoft's fabs seems to be ungodly slow... //float Q_fabs (float f); //#define fabs(f) Q_fabs(f) -#if !defined C_ONLY && !defined __linux__ && !defined __sgi -extern int Q_ftol( float f ); -#else -#define Q_ftol( f ) ( long ) (f) -#endif + +//#if !defined C_ONLY && !defined __linux__ && !defined __sgi +// This used to be a macro, do NOT use this! +// We now use the declared function in a jump table elsewhere. +extern int Q_ftol (float f); +//#else +//#define Q_ftol( f ) ( long ) (f) +//#endif #define DotProduct(x,y) (x[0]*y[0]+x[1]*y[1]+x[2]*y[2]) #define VectorSubtract(a,b,c) (c[0]=a[0]-b[0],c[1]=a[1]-b[1],c[2]=a[2]-b[2]) diff --git a/missionpack/q_shared.c b/missionpack/q_shared.c index 5ba4d9f..77563cd 100644 --- a/missionpack/q_shared.c +++ b/missionpack/q_shared.c @@ -242,7 +242,7 @@ float Q_fabs (float f) #if defined _M_IX86 && !defined C_ONLY #pragma warning (disable:4035) -__declspec( naked ) long Q_ftol( float f ) +__declspec( naked ) int Q_ftol (float f) { static int tmp; __asm fld dword ptr [esp+4] @@ -251,6 +251,11 @@ __declspec( naked ) long Q_ftol( float f ) __asm ret } #pragma warning (default:4035) +#else +int Q_ftol (float f) +{ + return (int)f; +} #endif /* diff --git a/missionpack/q_shared.h b/missionpack/q_shared.h index f7ae600..91017fa 100644 --- a/missionpack/q_shared.h +++ b/missionpack/q_shared.h @@ -229,11 +229,14 @@ extern vec3_t vec3_origin; // microsoft's fabs seems to be ungodly slow... //float Q_fabs (float f); //#define fabs(f) Q_fabs(f) -#if !defined C_ONLY && !defined __linux__ && !defined __sgi -extern long Q_ftol( float f ); -#else -#define Q_ftol( f ) ( long ) (f) -#endif + +//#if !defined C_ONLY && !defined __linux__ && !defined __sgi +// This used to be a macro, do NOT use this! +// We now use the declared function in a jump table elsewhere. +extern int Q_ftol (float f); +//#else +//#define Q_ftol( f ) ( long ) (f) +//#endif #define DotProduct(x,y) (x[0]*y[0]+x[1]*y[1]+x[2]*y[2]) #define VectorSubtract(a,b,c) (c[0]=a[0]-b[0],c[1]=a[1]-b[1],c[2]=a[2]-b[2]) diff --git a/unix/qgl_unix.c b/unix/qgl_unix.c index b793e35..0a09dd6 100644 --- a/unix/qgl_unix.c +++ b/unix/qgl_unix.c @@ -385,7 +385,7 @@ void ( APIENTRY * qglVertexPointer )(GLint size, GLenum type, GLsizei stride, co void ( APIENTRY * qglViewport )(GLint x, GLint y, GLsizei width, GLsizei height); // Knightmare added -void ( APIENTRY * qglDrawRangeElementsEXT)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); +void ( APIENTRY * qglDrawRangeElements)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); void ( APIENTRY * qglLockArraysEXT)( int, int); void ( APIENTRY * qglUnlockArraysEXT) ( void ); diff --git a/zaero/q_shared.c b/zaero/q_shared.c index 63ce11a..c81b1f8 100644 --- a/zaero/q_shared.c +++ b/zaero/q_shared.c @@ -244,7 +244,7 @@ float Q_fabs (float f) #if defined _M_IX86 && !defined C_ONLY #pragma warning (disable:4035) -__declspec( naked ) long Q_ftol( float f ) +__declspec( naked ) int Q_ftol (float f) { static int tmp; __asm fld dword ptr [esp+4] @@ -253,6 +253,11 @@ __declspec( naked ) long Q_ftol( float f ) __asm ret } #pragma warning (default:4035) +#else +int Q_ftol (float f) +{ + return (int)f; +} #endif /* diff --git a/zaero/q_shared.h b/zaero/q_shared.h index 63b0fea..ef08745 100644 --- a/zaero/q_shared.h +++ b/zaero/q_shared.h @@ -187,11 +187,14 @@ extern vec3_t vec3_origin; // microsoft's fabs seems to be ungodly slow... //float Q_fabs (float f); //#define fabs(f) Q_fabs(f) -#if !defined C_ONLY -extern long Q_ftol( float f ); -#else -#define Q_ftol( f ) ( long ) (f) -#endif + +//#if !defined C_ONLY && !defined __linux__ && !defined __sgi +// This used to be a macro, do NOT use this! +// We now use the declared function in a jump table elsewhere. +extern int Q_ftol (float f); +//#else +//#define Q_ftol( f ) ( long ) (f) +//#endif #define DotProduct(x,y) (x[0]*y[0]+x[1]*y[1]+x[2]*y[2]) #define VectorSubtract(a,b,c) (c[0]=a[0]-b[0],c[1]=a[1]-b[1],c[2]=a[2]-b[2])