qf now links with NO optimisation (not even -O). R_CullBox has been moved from

glquake.h to mathlib.h (along with the declaration for frustum) and the
extern inline keyworws protected by an ifndef so that mathlib.c can cause
R_CullBox to be compiled publicly. The definition of frustrum has been moved
from its verious locations into mathlib.c.
This commit is contained in:
Bill Currie 2001-05-07 04:08:34 +00:00
parent 380a40073e
commit cc68e1a12e
7 changed files with 20 additions and 21 deletions

View file

@ -36,8 +36,6 @@
# define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h
#endif
struct mplane_s;
extern vec3_t vec3_origin;
extern int nanmask;
@ -115,4 +113,20 @@ void RotatePointAroundVector( vec3_t dst, const vec3_t dir, const vec3_t point,
: \
BoxOnPlaneSide( (emins), (emaxs), (p)))
extern mplane_t frustum[4];
#ifndef IMPLEMENT_R_CullBox
extern inline
#endif
qboolean
R_CullBox (vec3_t mins, vec3_t maxs)
{
int i;
for (i=0 ; i<4 ; i++)
if (BoxOnPlaneSide (mins, maxs, &frustum[i]) == 2)
return true;
return false;
}
#endif // __mathlib_h

View file

@ -44,6 +44,7 @@
#include "QF/qfgl_ext.h"
#include "QF/wad.h"
void GL_BeginRendering (int *x, int *y, int *width, int *height);
void GL_EndRendering (void);
@ -233,17 +234,5 @@ extern float v_blend[4];
void AddLightBlend (float, float, float, float);
extern int c_brush_polys, c_alias_polys;
extern float r_world_matrix[16];
extern mplane_t frustum[4];
extern inline qboolean R_CullBox (vec3_t mins, vec3_t maxs)
{
int i;
for (i=0 ; i<4 ; i++)
if (BoxOnPlaneSide (mins, maxs, &frustum[i]) == 2)
return true;
return false;
}
#endif // __glquake_h

View file

@ -38,12 +38,15 @@
#include <math.h>
#define IMPLEMENT_R_CullBox
#include "QF/mathlib.h"
#include "QF/qtypes.h"
#include "QF/sys.h"
vec3_t vec3_origin = { 0, 0, 0 };
int nanmask = 255 << 23;
mplane_t frustum[4];
/*-----------------------------------------------------------------*/

View file

@ -62,8 +62,6 @@ int cnttextures[2] = { -1, -1 }; // cached
int r_visframecount; // bumped when going to a new PVS
int r_framecount; // used for dlight push checking
mplane_t frustum[4];
int c_brush_polys, c_alias_polys;
qboolean envmap; // true during envmap command capture

View file

@ -68,8 +68,6 @@ entity_t *currententity;
int r_visframecount; // bumped when going to a new PVS
int r_framecount; // used for dlight push checking
mplane_t frustum[4];
int c_brush_polys, c_alias_polys;
qboolean envmap; // true during envmap command capture

View file

@ -35,7 +35,6 @@
#include "QF/model.h"
const int mod_lightmap_bytes = 1;
mplane_t frustum[4];
cvar_t *gl_sky_divide; // not used but needed for linking
void Mod_LoadBrushModel (model_t *mod, void *buffer);

View file

@ -86,8 +86,6 @@ qboolean r_fov_greater_than_90;
entity_t r_worldentity;
mplane_t frustum[4];
//
// view origin
//