mirror of
https://github.com/blendogames/thirtyflightsofloving.git
synced 2024-11-14 00:21:18 +00:00
Clean up Q_ftol() for Linux porting in DLL sources.
This commit is contained in:
parent
fa0f460482
commit
4635d4a5b8
11 changed files with 69 additions and 34 deletions
|
@ -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
|
||||
|
||||
/*
|
||||
|
|
|
@ -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])
|
||||
|
|
|
@ -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
|
||||
|
||||
/*
|
||||
|
|
|
@ -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])
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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])
|
||||
|
|
|
@ -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
|
||||
|
||||
/*
|
||||
|
|
|
@ -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])
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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
|
||||
|
||||
/*
|
||||
|
|
|
@ -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])
|
||||
|
|
Loading…
Reference in a new issue