mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-18 15:01:41 +00:00
Move the winding code into libQFmodels.
This commit is contained in:
parent
91e65b6c80
commit
853bf13d9e
19 changed files with 27 additions and 36 deletions
|
@ -527,7 +527,7 @@ QF_DEPS(BSP2IMG,
|
|||
)
|
||||
QF_DEPS(QFBSP,
|
||||
[-I$(top_srcdir)/tools/qfbsp/include],
|
||||
[$(top_builddir)/libs/util/libQFutil.la],
|
||||
[$(top_builddir)/libs/util/libQFutil.la $(top_builddir)/libs/models/libQFmodels.la],
|
||||
[$(WIN32_LIBS)],
|
||||
)
|
||||
QF_DEPS(QFCC,
|
||||
|
|
|
@ -9,7 +9,7 @@ nobase_pkginclude_HEADERS = \
|
|||
qargs.h qdefs.h qendian.h qfplist.h qtypes.h quakefs.h quakeio.h render.h \
|
||||
riff.h ruamoko.h screen.h script.h sizebuf.h skin.h sound.h spritegn.h \
|
||||
sys.h teamplay.h tga.h uint32.h va.h ver_check.h vid.h view.h wad.h \
|
||||
wadfile.h zone.h \
|
||||
wadfile.h winding.h zone.h \
|
||||
\
|
||||
GL/ati.h GL/defines.h GL/extensions.h GL/funcs.h GL/qf_explosions.h \
|
||||
GL/qf_funcs_list.h GL/qf_lightmap.h GL/qf_noisetextures.h \
|
||||
|
|
|
@ -20,18 +20,19 @@
|
|||
$Id$
|
||||
*/
|
||||
|
||||
#ifndef qfbsp_winding_h
|
||||
#define qfbsp_winding_h
|
||||
#ifndef __QF_winding_h
|
||||
#define __QF_winding_h
|
||||
|
||||
#include "QF/mathlib.h"
|
||||
|
||||
/** \defgroup qfbsp_winding Winding Manipulation
|
||||
\ingroup qfbsp
|
||||
/** \defgroup winding Winding Manipulation
|
||||
*/
|
||||
//@{
|
||||
|
||||
struct plane_s;
|
||||
|
||||
#define ON_EPSILON 0.05
|
||||
|
||||
typedef struct winding_s {
|
||||
int numpoints; ///< The number of points in the winding
|
||||
vec3_t points[3]; ///< variable sized, never less than 3
|
||||
|
@ -130,4 +131,4 @@ void DivideWinding (winding_t *in, struct plane_s *split,
|
|||
|
||||
//@}
|
||||
|
||||
#endif//qfbsp_winding_h
|
||||
#endif//__QF_winding_h
|
|
@ -7,7 +7,7 @@ INCLUDES= -I$(top_srcdir)/include
|
|||
lib_LTLIBRARIES= libQFmodels.la @VID_MODEL_TARGETS@
|
||||
EXTRA_LTLIBRARIES= libQFmodels_gl.la libQFmodels_sw.la
|
||||
|
||||
models_sources = clip_hull.c model.c trace.c
|
||||
models_sources = clip_hull.c model.c trace.c winding.c
|
||||
|
||||
libQFmodels_la_LDFLAGS= -version-info $(QUAKE_LIBRARY_VERSION_INFO) -no-undefined
|
||||
libQFmodels_la_LIBADD= brush/libbrush.la $(top_builddir)/libs/util/libQFutil.la
|
||||
|
|
|
@ -26,7 +26,7 @@ mclipnode_t clipnodes_simple_wedge[] = {
|
|||
{ 1, {CONTENTS_EMPTY, CONTENTS_SOLID}},
|
||||
};
|
||||
|
||||
mplane_t planes_simple_wedge[] = {
|
||||
plane_t planes_simple_wedge[] = {
|
||||
{{1, 0, 0}, 0, 0, 0}, // 0
|
||||
{{0.8, 0, 0.6}, 0, 4, 0}, // 1
|
||||
};
|
||||
|
@ -51,7 +51,7 @@ mclipnode_t clipnodes_tpp1[] = {
|
|||
{ 2, {CONTENTS_SOLID, CONTENTS_EMPTY}},
|
||||
};
|
||||
|
||||
mplane_t planes_tpp1[] = {
|
||||
plane_t planes_tpp1[] = {
|
||||
{{1, 0, 0}, -32, 0, 0},
|
||||
{{1, 0, 0}, 32, 0, 0},
|
||||
{{1, 0, 0}, 48, 0, 0},
|
||||
|
@ -77,7 +77,7 @@ mclipnode_t clipnodes_tpp2[] = {
|
|||
{ 2, {CONTENTS_SOLID, CONTENTS_EMPTY}},
|
||||
};
|
||||
|
||||
mplane_t planes_tpp2[] = {
|
||||
plane_t planes_tpp2[] = {
|
||||
{{1, 0, 0}, 32, 0, 0},
|
||||
{{1, 0, 0}, -32, 0, 0},
|
||||
{{1, 0, 0}, 48, 0, 0},
|
||||
|
@ -103,7 +103,7 @@ mclipnode_t clipnodes_tppw[] = {
|
|||
{ 2, {CONTENTS_SOLID, CONTENTS_WATER}},
|
||||
};
|
||||
|
||||
mplane_t planes_tppw[] = {
|
||||
plane_t planes_tppw[] = {
|
||||
{{1, 0, 0}, 32, 0, 0},
|
||||
{{1, 0, 0}, -32, 0, 0},
|
||||
{{1, 0, 0}, 48, 0, 0},
|
||||
|
@ -130,7 +130,7 @@ mclipnode_t clipnodes_step1[] = {
|
|||
{ 2, {CONTENTS_SOLID, CONTENTS_EMPTY}},
|
||||
};
|
||||
|
||||
mplane_t planes_step1[] = {
|
||||
plane_t planes_step1[] = {
|
||||
{{0, 0, 1}, 0, 2, 0},
|
||||
{{0, 0, 1}, 32, 2, 0},
|
||||
{{1, 0, 0}, 0, 0, 0},
|
||||
|
@ -157,7 +157,7 @@ mclipnode_t clipnodes_step2[] = {
|
|||
{ 2, {CONTENTS_EMPTY, CONTENTS_SOLID}},
|
||||
};
|
||||
|
||||
mplane_t planes_step2[] = {
|
||||
plane_t planes_step2[] = {
|
||||
{{1, 0, 0}, 0, 0, 0},
|
||||
{{0, 0, 1}, 32, 2, 0},
|
||||
{{0, 0, 1}, 0, 2, 0},
|
||||
|
@ -184,7 +184,7 @@ mclipnode_t clipnodes_step3[] = {
|
|||
{ 2, {CONTENTS_EMPTY, CONTENTS_SOLID}},
|
||||
};
|
||||
|
||||
mplane_t planes_step3[] = {
|
||||
plane_t planes_step3[] = {
|
||||
{{1, 0, 0}, 0, 0, 0},
|
||||
{{0, 0, 1}, 0, 2, 0},
|
||||
{{0, 0, 1}, 32, 2, 0},
|
||||
|
@ -215,7 +215,7 @@ mclipnode_t clipnodes_covered_step[] = {
|
|||
{ 4, {CONTENTS_SOLID, CONTENTS_EMPTY}},
|
||||
};
|
||||
|
||||
mplane_t planes_covered_step[] = {
|
||||
plane_t planes_covered_step[] = {
|
||||
{{0, 0, 1}, 0, 2, 0},
|
||||
{{0, 0, 1}, 32, 2, 0},
|
||||
{{1, 0, 0}, 0, 0, 0},
|
||||
|
@ -243,7 +243,7 @@ mclipnode_t clipnodes_ramp[] = {
|
|||
{ 2, {CONTENTS_EMPTY, CONTENTS_SOLID}},
|
||||
};
|
||||
|
||||
mplane_t planes_ramp[] = {
|
||||
plane_t planes_ramp[] = {
|
||||
{{ 1, 0, 0}, 0, 0, 0},
|
||||
{{ 0, 0, 1}, 0, 2, 0},
|
||||
{{-0.6, 0, 0.8}, 0, 4, 0},
|
||||
|
|
|
@ -37,8 +37,9 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
|
||||
#include "QF/sys.h"
|
||||
|
||||
#include "bsp5.h"
|
||||
#include "winding.h"
|
||||
#include "QF/winding.h"
|
||||
|
||||
#define BOGUS (8e6)
|
||||
|
||||
/** \addtogroup qfbsp_winding
|
||||
*/
|
||||
|
@ -56,7 +57,7 @@ BaseWindingForPlane (const plane_t *p)
|
|||
|
||||
// find the major axis
|
||||
|
||||
max = -BOGUS_RANGE;
|
||||
max = -BOGUS;
|
||||
x = -1;
|
||||
for (i = 0; i < 3; i++) {
|
||||
v = fabs (p->normal[i]);
|
||||
|
@ -87,8 +88,8 @@ BaseWindingForPlane (const plane_t *p)
|
|||
|
||||
CrossProduct (vup, p->normal, vright);
|
||||
|
||||
VectorScale (vup, BOGUS_RANGE, vup);
|
||||
VectorScale (vright, BOGUS_RANGE, vright);
|
||||
VectorScale (vup, BOGUS, vup);
|
||||
VectorScale (vright, BOGUS, vright);
|
||||
|
||||
// project a really big axis aligned box onto the plane
|
||||
w = NewWinding (4);
|
|
@ -2,4 +2,4 @@ AUTOMAKE_OPTIONS= foreign
|
|||
|
||||
EXTRA_DIST= brush.h bsp5.h csg4.h draw.h map.h merge.h options.h outside.h \
|
||||
portals.h readbsp.h region.h solidbsp.h surfaces.h tjunc.h \
|
||||
winding.h writebsp.h
|
||||
writebsp.h
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
#include "QF/mathlib.h"
|
||||
#include "QF/bspfile.h"
|
||||
#include "QF/winding.h"
|
||||
|
||||
/** \defgroup qfbsp_general General functions
|
||||
\ingroup qfbsp
|
||||
|
@ -36,7 +37,6 @@
|
|||
|
||||
#define MAX_THREADS 4
|
||||
|
||||
#define ON_EPSILON 0.05
|
||||
#define BOGUS_RANGE 18000
|
||||
|
||||
// the exact bounding box of the brushes is expanded some for the headnode
|
||||
|
|
|
@ -17,8 +17,7 @@ EXTRA_PROGRAMS= qfbsp
|
|||
|
||||
qfbsp_SOURCES= \
|
||||
brush.c csg4.c map.c merge.c nodraw.c options.c outside.c portals.c \
|
||||
qfbsp.c readbsp.c region.c solidbsp.c surfaces.c tjunc.c winding.c \
|
||||
writebsp.c
|
||||
qfbsp.c readbsp.c region.c solidbsp.c surfaces.c tjunc.c writebsp.c
|
||||
|
||||
qfbsp_LDADD= $(QFBSP_LIBS)
|
||||
qfbsp_DEPENDENCIES= $(QFBSP_DEPS)
|
||||
|
|
|
@ -37,7 +37,6 @@
|
|||
#include "draw.h"
|
||||
#include "options.h"
|
||||
#include "surfaces.h"
|
||||
#include "winding.h"
|
||||
|
||||
/** \addtogroup qfbsp_brush
|
||||
*/
|
||||
|
|
|
@ -37,7 +37,6 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "merge.h"
|
||||
#include "solidbsp.h"
|
||||
#include "surfaces.h"
|
||||
#include "winding.h"
|
||||
|
||||
/** \addtogroup qfbsp_csg4
|
||||
*/
|
||||
|
|
|
@ -32,7 +32,6 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "draw.h"
|
||||
#include "merge.h"
|
||||
#include "surfaces.h"
|
||||
#include "winding.h"
|
||||
|
||||
/** \addtogroup qfbsp_merge
|
||||
*/
|
||||
|
|
|
@ -31,7 +31,6 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "options.h"
|
||||
#include "portals.h"
|
||||
#include "outside.h"
|
||||
#include "winding.h"
|
||||
|
||||
/** \addtogroup qfbsp_outside
|
||||
*/
|
||||
|
|
|
@ -36,7 +36,6 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "draw.h"
|
||||
#include "options.h"
|
||||
#include "portals.h"
|
||||
#include "winding.h"
|
||||
|
||||
/** \addtogroup qfbsp_portals
|
||||
*/
|
||||
|
|
|
@ -56,7 +56,6 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "options.h"
|
||||
#include "portals.h"
|
||||
#include "readbsp.h"
|
||||
#include "winding.h"
|
||||
|
||||
/** \addtogroup qfbsp_readbsp
|
||||
*/
|
||||
|
|
|
@ -35,7 +35,6 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "bsp5.h"
|
||||
#include "region.h"
|
||||
#include "surfaces.h"
|
||||
#include "winding.h"
|
||||
|
||||
/** \addtogroup qfbsp_region
|
||||
*/
|
||||
|
|
|
@ -37,7 +37,6 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "draw.h"
|
||||
#include "solidbsp.h"
|
||||
#include "surfaces.h"
|
||||
#include "winding.h"
|
||||
|
||||
/** \addtogroup qfbsp_solidbsp
|
||||
*/
|
||||
|
|
|
@ -36,7 +36,6 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "options.h"
|
||||
#include "region.h"
|
||||
#include "surfaces.h"
|
||||
#include "winding.h"
|
||||
|
||||
/** \addtogroup qfbsp_surface
|
||||
*/
|
||||
|
|
|
@ -35,7 +35,6 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "brush.h"
|
||||
#include "bsp5.h"
|
||||
#include "options.h"
|
||||
#include "winding.h"
|
||||
#include "tjunc.h"
|
||||
|
||||
/** \addtogroup qfbsp_tjunc
|
||||
|
|
Loading…
Reference in a new issue