From fcd1897421a1e43604d5a1040385011e60466377 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 1 Sep 2010 10:06:54 +0900 Subject: [PATCH] Create the qfbsp doxygen modules. Also, make doxygen extract static functions as well, so qfbsp's docs can be more complete. --- doc/quakeforge.dox.in | 2 +- tools/qfbsp/include/brush.h | 7 +++++++ tools/qfbsp/include/bsp5.h | 10 ++++++++++ tools/qfbsp/include/csg4.h | 7 +++++++ tools/qfbsp/include/draw.h | 7 +++++++ tools/qfbsp/include/map.h | 7 +++++++ tools/qfbsp/include/merge.h | 7 +++++++ tools/qfbsp/include/options.h | 8 ++++++++ tools/qfbsp/include/outside.h | 7 +++++++ tools/qfbsp/include/portals.h | 7 +++++++ tools/qfbsp/include/readbsp.h | 7 +++++++ tools/qfbsp/include/region.h | 7 +++++++ tools/qfbsp/include/solidbsp.h | 7 +++++++ tools/qfbsp/include/surfaces.h | 7 +++++++ tools/qfbsp/include/tjunc.h | 7 +++++++ tools/qfbsp/include/winding.h | 7 +++++++ tools/qfbsp/include/writebsp.h | 7 +++++++ tools/qfbsp/source/brush.c | 6 ++++++ tools/qfbsp/source/csg4.c | 6 ++++++ tools/qfbsp/source/map.c | 6 ++++++ tools/qfbsp/source/merge.c | 6 ++++++ tools/qfbsp/source/nodraw.c | 6 ++++++ tools/qfbsp/source/options.c | 6 ++++++ tools/qfbsp/source/outside.c | 6 ++++++ tools/qfbsp/source/portals.c | 8 +++++++- tools/qfbsp/source/qfbsp.c | 6 ++++++ tools/qfbsp/source/readbsp.c | 6 ++++++ tools/qfbsp/source/region.c | 6 ++++++ tools/qfbsp/source/solidbsp.c | 6 ++++++ tools/qfbsp/source/surfaces.c | 6 ++++++ tools/qfbsp/source/tjunc.c | 6 ++++++ tools/qfbsp/source/winding.c | 6 ++++++ tools/qfbsp/source/writebsp.c | 6 ++++++ 33 files changed, 214 insertions(+), 2 deletions(-) diff --git a/doc/quakeforge.dox.in b/doc/quakeforge.dox.in index f222db91c..f337f0bda 100644 --- a/doc/quakeforge.dox.in +++ b/doc/quakeforge.dox.in @@ -308,7 +308,7 @@ EXTRACT_PRIVATE = NO # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. -EXTRACT_STATIC = NO +EXTRACT_STATIC = YES # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) # defined locally in source files will be included in the documentation. diff --git a/tools/qfbsp/include/brush.h b/tools/qfbsp/include/brush.h index 7d0e2e88b..7c60f4a67 100644 --- a/tools/qfbsp/include/brush.h +++ b/tools/qfbsp/include/brush.h @@ -28,6 +28,11 @@ #include "bsp5.h" #include "map.h" +/** \defgroup qfbsp_brush Brush Functions + \ingroup qfbsp +*/ +//@{ + #define NUM_HULLS 2 // normal and +16 #define NUM_CONTENTS 2 // solid and water @@ -74,4 +79,6 @@ int PlaneTypeForNormal (const vec3_t normal); */ int FindPlane (plane_t *dplane, int *side); +//@} + #endif//qfbsp_brush_h diff --git a/tools/qfbsp/include/bsp5.h b/tools/qfbsp/include/bsp5.h index cf04e9074..78d73398a 100644 --- a/tools/qfbsp/include/bsp5.h +++ b/tools/qfbsp/include/bsp5.h @@ -23,9 +23,17 @@ #ifndef qfbsp_bsp5_h #define qfbsp_bsp5_h +/** \defgroup qfbsp QuakeForge BSP Compiler +*/ + #include "QF/mathlib.h" #include "QF/bspfile.h" +/** \defgroup qfbsp_general General functions + \ingroup qfbsp +*/ +//@{ + typedef struct plane_s { vec3_t normal; vec_t dist; @@ -128,4 +136,6 @@ node_t *AllocNode (void); extern bsp_t *bsp; +//@} + #endif//qfbsp_bsp5_h diff --git a/tools/qfbsp/include/csg4.h b/tools/qfbsp/include/csg4.h index 24b5cc710..12391b19c 100644 --- a/tools/qfbsp/include/csg4.h +++ b/tools/qfbsp/include/csg4.h @@ -25,6 +25,11 @@ #include "QF/bspfile.h" +/** \defgroup qfbsp_csg4 CSG Functions + \ingroup qfbsp +*/ +//@{ + struct plane_s; struct visfacet_s; struct brushset_s; @@ -80,4 +85,6 @@ struct surface_s *CSGFaces (struct brushset_s *bs); void SplitFace (struct visfacet_s *in, struct plane_s *split, struct visfacet_s **front, struct visfacet_s **back); +//@} + #endif//qfbsp_csg4_h diff --git a/tools/qfbsp/include/draw.h b/tools/qfbsp/include/draw.h index a31832939..9f9e6941d 100644 --- a/tools/qfbsp/include/draw.h +++ b/tools/qfbsp/include/draw.h @@ -25,6 +25,11 @@ #include "QF/mathlib.h" +/** \defgroup qfbsp_draw Debug Drawing Functions + \ingroup qfbsp +*/ +//@{ + struct visfacet_s; struct portal_s; struct node_s; @@ -49,4 +54,6 @@ void DrawBrush (struct brush_s *b); void DrawWinding (struct winding_s *w); void DrawTri (vec3_t p1, vec3_t p2, vec3_t p3); +//@} + #endif//qfbsp_draw_h diff --git a/tools/qfbsp/include/map.h b/tools/qfbsp/include/map.h index 32ed2441f..0b1f0ddc8 100644 --- a/tools/qfbsp/include/map.h +++ b/tools/qfbsp/include/map.h @@ -25,6 +25,11 @@ #include "bsp5.h" +/** \defgroup qfbsp_map Map Parser + \ingroup qfbsp +*/ +//@{ + #define MAX_FACES 256 typedef struct mface_s { struct mface_s *next; @@ -118,4 +123,6 @@ void GetVectorForKey (entity_t *ent, const char *key, vec3_t vec); */ void WriteEntitiesToString (void); +//@} + #endif//qfbsp_map_h diff --git a/tools/qfbsp/include/merge.h b/tools/qfbsp/include/merge.h index b6dfe8f52..c2d0601b8 100644 --- a/tools/qfbsp/include/merge.h +++ b/tools/qfbsp/include/merge.h @@ -23,6 +23,11 @@ #ifndef qfbsp_merge_h #define qfbsp_merge_h +/** \defgroup qfbsp_merge Merge Functions + \ingroup qfbsp +*/ +//@{ + /** Add a face to the list of faces, doing any possible merging. \param face The face to add to the list. @@ -59,4 +64,6 @@ void MergePlaneFaces (surface_t *plane); */ void MergeAll (surface_t *surfhead); +//@} + #endif//qfbsp_merge_h diff --git a/tools/qfbsp/include/options.h b/tools/qfbsp/include/options.h index 73c7892b9..d99ccf20e 100644 --- a/tools/qfbsp/include/options.h +++ b/tools/qfbsp/include/options.h @@ -31,6 +31,11 @@ #include "QF/qtypes.h" +/** \defgroup qfbsp_options Command-line Options Parsing + \ingroup qfbsp +*/ +//@{ + typedef struct { int verbosity; // 0=silent qboolean drawflag; @@ -60,4 +65,7 @@ typedef struct { extern options_t options; int DecodeArgs (int argc, char **argv); extern const char *this_program; + +//@} + #endif//qfbsp_options_h diff --git a/tools/qfbsp/include/outside.h b/tools/qfbsp/include/outside.h index 55f4589c2..c90fc04ed 100644 --- a/tools/qfbsp/include/outside.h +++ b/tools/qfbsp/include/outside.h @@ -23,6 +23,11 @@ #ifndef qfbsp_outside_h #define qfbsp_outside_h +/** \defgroup qfbsp_outside Outside Functions + \ingroup qfbsp +*/ +//@{ + struct node_s; /** Make the outside of the map solid. @@ -37,4 +42,6 @@ struct node_s; */ qboolean FillOutside (struct node_s *node); +//@} + #endif//qfbsp_outside_h diff --git a/tools/qfbsp/include/portals.h b/tools/qfbsp/include/portals.h index 26223cff9..68f130fc8 100644 --- a/tools/qfbsp/include/portals.h +++ b/tools/qfbsp/include/portals.h @@ -23,6 +23,11 @@ #ifndef qfbsp_portals_h #define qfbsp_portals_h +/** \defgroup qfbsp_portals Portal Functions + \ingroup qfbsp +*/ +//@{ + struct node_s; typedef struct portal_s { @@ -79,4 +84,6 @@ void FreeAllPortals (struct node_s *node); */ void WritePortalfile (struct node_s *headnode); +//@} + #endif//qfbsp_portals_h diff --git a/tools/qfbsp/include/readbsp.h b/tools/qfbsp/include/readbsp.h index 3f624310a..24c5c9df0 100644 --- a/tools/qfbsp/include/readbsp.h +++ b/tools/qfbsp/include/readbsp.h @@ -23,6 +23,11 @@ #ifndef qfbsp_readbsp_h #define qfbsp_readbsp_h +/** \defgroup qfbsp_readbsp BSP Reading Functions + \ingroup qfbsp +*/ +//@{ + /** Load the bspfile into memory. */ void LoadBSP (void); @@ -43,4 +48,6 @@ void extract_entities (void); */ void extract_hull (void); +//@} + #endif//qfbsp_readbsp_h diff --git a/tools/qfbsp/include/region.h b/tools/qfbsp/include/region.h index b461d56f3..8b2619d4d 100644 --- a/tools/qfbsp/include/region.h +++ b/tools/qfbsp/include/region.h @@ -23,6 +23,11 @@ #ifndef qfbsp_region_h #define qfbsp_region_h +/** \defgroup qfbsp_region Region Functions + \ingroup qfbsp +*/ +//@{ + struct node_s; /** Write the faces and edges to the bsp file. @@ -31,4 +36,6 @@ struct node_s; */ void GrowNodeRegions (struct node_s *headnode); +//@} + #endif//qfbsp_region_h diff --git a/tools/qfbsp/include/solidbsp.h b/tools/qfbsp/include/solidbsp.h index af924bfb7..f0c28a96d 100644 --- a/tools/qfbsp/include/solidbsp.h +++ b/tools/qfbsp/include/solidbsp.h @@ -25,6 +25,11 @@ #include "QF/qtypes.h" +/** \defgroup qfbsp_solidbsp BSP Creation Functions + \ingroup qfbsp +*/ +//@{ + struct visfacet_s; struct plane_s; struct surface_s; @@ -44,4 +49,6 @@ void CalcSurfaceInfo (struct surface_s *surf); */ struct node_s *SolidBSP (struct surface_s *surfhead, qboolean midsplit); +//@} + #endif//qfbsp_solidbsp_h diff --git a/tools/qfbsp/include/surfaces.h b/tools/qfbsp/include/surfaces.h index f591d7d40..4e377f8ae 100644 --- a/tools/qfbsp/include/surfaces.h +++ b/tools/qfbsp/include/surfaces.h @@ -25,6 +25,11 @@ #include "QF/bspfile.h" +/** \defgroup qfbsp_surface Surface Functions + \ingroup qfbsp +*/ +//@{ + struct visfacet_s; struct node_s; struct surface_s; @@ -96,4 +101,6 @@ struct surface_s *GatherNodeFaces (struct node_s *headnode); */ void MakeFaceEdges (struct node_s *headnode); +//@} + #endif//surfaces_h diff --git a/tools/qfbsp/include/tjunc.h b/tools/qfbsp/include/tjunc.h index ac0ee3f61..db70394aa 100644 --- a/tools/qfbsp/include/tjunc.h +++ b/tools/qfbsp/include/tjunc.h @@ -23,6 +23,11 @@ #ifndef qfbsp_tjunc_h #define qfbsp_tjunc_h +/** \defgroup qfbsp_tjunc T-Junction Repair + \ingroup qfbsp +*/ +//@{ + struct node_s; /** Add the edges from the faces in the bsp tree. @@ -31,4 +36,6 @@ struct node_s; */ void tjunc (struct node_s *headnode); +//@} + #endif//qfbsp_tjunc_h diff --git a/tools/qfbsp/include/winding.h b/tools/qfbsp/include/winding.h index ae1b38cc7..cbfab732b 100644 --- a/tools/qfbsp/include/winding.h +++ b/tools/qfbsp/include/winding.h @@ -25,6 +25,11 @@ #include "QF/mathlib.h" +/** \defgroup qfbsp_winding Winding Manipulation + \ingroup qfbsp +*/ +//@{ + struct plane_s; typedef struct winding_s { @@ -113,4 +118,6 @@ winding_t *ClipWinding (winding_t *in, struct plane_s *split, qboolean keepon); void DivideWinding (winding_t *in, struct plane_s *split, winding_t **front, winding_t **back); +//@} + #endif//qfbsp_winding_h diff --git a/tools/qfbsp/include/writebsp.h b/tools/qfbsp/include/writebsp.h index 0de07b16a..58ac5fc77 100644 --- a/tools/qfbsp/include/writebsp.h +++ b/tools/qfbsp/include/writebsp.h @@ -25,6 +25,11 @@ #include "QF/bspfile.h" +/** \defgroup qfbsp_writebsp BSP Writing Functions + \ingroup qfbsp +*/ +//@{ + struct node_s; void WriteNodePlanes (struct node_s *headnode); @@ -37,4 +42,6 @@ int FindFinalPlane (dplane_t *p); void BeginBSPFile (void); void FinishBSPFile (void); +//@} + #endif//qfbsp_writebsp_h diff --git a/tools/qfbsp/source/brush.c b/tools/qfbsp/source/brush.c index e340c1b53..ad43effb1 100644 --- a/tools/qfbsp/source/brush.c +++ b/tools/qfbsp/source/brush.c @@ -38,6 +38,10 @@ #include "surfaces.h" #include "winding.h" +/** \addtogroup qfbsp_brush +*/ +//@{ + int numbrushplanes; plane_t planes[MAX_MAP_PLANES]; @@ -798,3 +802,5 @@ Brush_LoadEntity (entity_t *ent, int hullnum) return bset; } + +//@} diff --git a/tools/qfbsp/source/csg4.c b/tools/qfbsp/source/csg4.c index 284b61b97..0de15cd58 100644 --- a/tools/qfbsp/source/csg4.c +++ b/tools/qfbsp/source/csg4.c @@ -39,6 +39,10 @@ static __attribute__ ((used)) const char rcsid[] = #include "surfaces.h" #include "winding.h" +/** \addtogroup qfbsp_csg4 +*/ +//@{ + /* NOTES @@ -382,3 +386,5 @@ CSGFaces (brushset_t *bs) return surfhead; } + +//@} diff --git a/tools/qfbsp/source/map.c b/tools/qfbsp/source/map.c index 9dd1ce3b3..84083f157 100644 --- a/tools/qfbsp/source/map.c +++ b/tools/qfbsp/source/map.c @@ -44,6 +44,10 @@ static __attribute__ ((used)) const char rcsid[] = #include "map.h" +/** \addtogroup qfbsp_map +*/ +//@{ + int nummapbrushfaces; int nummapbrushes; mbrush_t mapbrushes[MAX_MAP_BRUSHES]; @@ -589,3 +593,5 @@ WriteEntitiesToString (void) } BSP_AddEntities (bsp, buf->str, buf->size); } + +//@} diff --git a/tools/qfbsp/source/merge.c b/tools/qfbsp/source/merge.c index afba61ac2..0a6d42833 100644 --- a/tools/qfbsp/source/merge.c +++ b/tools/qfbsp/source/merge.c @@ -34,6 +34,10 @@ static __attribute__ ((used)) const char rcsid[] = #include "surfaces.h" #include "winding.h" +/** \addtogroup qfbsp_merge +*/ +//@{ + #define CONTINUOUS_EPSILON 0.001 @@ -236,3 +240,5 @@ MergeAll (surface_t * surfhead) printf ("%i mergefaces\n", mergefaces); } + +//@} diff --git a/tools/qfbsp/source/nodraw.c b/tools/qfbsp/source/nodraw.c index 7c4374119..f202df80d 100644 --- a/tools/qfbsp/source/nodraw.c +++ b/tools/qfbsp/source/nodraw.c @@ -26,6 +26,10 @@ static __attribute__ ((used)) const char rcsid[] = #include "draw.h" +/** \addtogroup qfbsp_draw +*/ +//@{ + void Draw_ClearBounds (void) @@ -91,3 +95,5 @@ void DrawPortal (struct portal_s *portal) { } + +//@} diff --git a/tools/qfbsp/source/options.c b/tools/qfbsp/source/options.c index 1f8c5c0ef..cbc040a63 100644 --- a/tools/qfbsp/source/options.c +++ b/tools/qfbsp/source/options.c @@ -45,6 +45,10 @@ static __attribute__ ((used)) const char rcsid[] = #include "options.h" +/** \addtogroup qfbsp_options +*/ +//@{ + const char *this_program; static struct option const long_options[] = { @@ -242,3 +246,5 @@ DecodeArgs (int argc, char **argv) return optind; } + +//@} diff --git a/tools/qfbsp/source/outside.c b/tools/qfbsp/source/outside.c index 48b82c06b..c2479303b 100644 --- a/tools/qfbsp/source/outside.c +++ b/tools/qfbsp/source/outside.c @@ -33,6 +33,10 @@ static __attribute__ ((used)) const char rcsid[] = #include "outside.h" #include "winding.h" +/** \addtogroup qfbsp_outside +*/ +//@{ + int outleafs; /** Find the leaf node in which the point is. @@ -365,3 +369,5 @@ FillOutside (node_t *node) qprintf ("%4i outleafs\n", outleafs); return true; } + +//@} diff --git a/tools/qfbsp/source/portals.c b/tools/qfbsp/source/portals.c index f84f29a56..6f173d077 100644 --- a/tools/qfbsp/source/portals.c +++ b/tools/qfbsp/source/portals.c @@ -38,6 +38,10 @@ static __attribute__ ((used)) const char rcsid[] = #include "portals.h" #include "winding.h" +/** \addtogroup qfbsp_portals +*/ +//@{ + int c_activeportals, c_peakportals; node_t outside_node; // portals outside the world face this @@ -448,7 +452,7 @@ ShareContents (node_t *n1, node_t *n2) /** Check if two nodes have the same non-solid, non-sky contents. - \node Affected by watervis. + \note Affected by watervis. \param n1 The first node to check. \param n2 The second node to check. @@ -636,3 +640,5 @@ WritePortalfile (node_t *headnode) fclose (pf); } + +//@} diff --git a/tools/qfbsp/source/qfbsp.c b/tools/qfbsp/source/qfbsp.c index dd055d231..2c4c26880 100644 --- a/tools/qfbsp/source/qfbsp.c +++ b/tools/qfbsp/source/qfbsp.c @@ -59,6 +59,10 @@ static __attribute__ ((used)) const char rcsid[] = #include "writebsp.h" #include "tjunc.h" +/** \addtogroup qfbsp +*/ +//@{ + options_t options; bsp_t *bsp; @@ -486,3 +490,5 @@ qprintf (const char *fmt, ...) vprintf (fmt, argptr); va_end (argptr); } + +//@} diff --git a/tools/qfbsp/source/readbsp.c b/tools/qfbsp/source/readbsp.c index a5f6265c2..b37b73b97 100644 --- a/tools/qfbsp/source/readbsp.c +++ b/tools/qfbsp/source/readbsp.c @@ -58,6 +58,10 @@ static __attribute__ ((used)) const char rcsid[] = #include "readbsp.h" #include "winding.h" +/** \addtogroup qfbsp_readbsp +*/ +//@{ + dmodel_t *models; face_t *mfaces; node_t *nodes; @@ -474,3 +478,5 @@ extract_hull (void) } Qprintf (hf, "};\n"); } + +//@} diff --git a/tools/qfbsp/source/region.c b/tools/qfbsp/source/region.c index 64dfe4af0..24b95da39 100644 --- a/tools/qfbsp/source/region.c +++ b/tools/qfbsp/source/region.c @@ -37,6 +37,10 @@ static __attribute__ ((used)) const char rcsid[] = #include "surfaces.h" #include "winding.h" +/** \addtogroup qfbsp_region +*/ +//@{ + /* input ----- @@ -273,3 +277,5 @@ GrowNodeRegions (node_t *headnode) if overlap split */ + +//@} diff --git a/tools/qfbsp/source/solidbsp.c b/tools/qfbsp/source/solidbsp.c index fed8072af..eba71795f 100644 --- a/tools/qfbsp/source/solidbsp.c +++ b/tools/qfbsp/source/solidbsp.c @@ -39,6 +39,10 @@ static __attribute__ ((used)) const char rcsid[] = #include "surfaces.h" #include "winding.h" +/** \addtogroup qfbsp_solidbsp +*/ +//@{ + int leaffaces; int nodefaces; int splitnodes; @@ -707,3 +711,5 @@ SolidBSP (surface_t *surfhead, qboolean midsplit) return headnode; } + +//@} diff --git a/tools/qfbsp/source/surfaces.c b/tools/qfbsp/source/surfaces.c index 98ae2961e..cef2f4049 100644 --- a/tools/qfbsp/source/surfaces.c +++ b/tools/qfbsp/source/surfaces.c @@ -38,6 +38,10 @@ static __attribute__ ((used)) const char rcsid[] = #include "surfaces.h" #include "winding.h" +/** \addtogroup qfbsp_surface +*/ +//@{ + /* a surface has all of the faces that could be drawn on a given plane @@ -431,3 +435,5 @@ MakeFaceEdges (node_t *headnode) firstmodeledge = bsp->numedges; firstmodelface = bsp->numfaces; } + +//@} diff --git a/tools/qfbsp/source/tjunc.c b/tools/qfbsp/source/tjunc.c index 3c052cbca..ba7e34b6d 100644 --- a/tools/qfbsp/source/tjunc.c +++ b/tools/qfbsp/source/tjunc.c @@ -38,6 +38,10 @@ static __attribute__ ((used)) const char rcsid[] = #include "winding.h" #include "tjunc.h" +/** \addtogroup qfbsp_tjunc +*/ +//@{ + typedef struct wvert_s { vec_t t; struct wvert_s *prev, *next; @@ -427,3 +431,5 @@ tjunc (node_t *headnode) qprintf ("%i edges added by tjunctions\n", tjuncs); qprintf ("%i faces added by tjunctions\n", tjuncfaces); } + +//@} diff --git a/tools/qfbsp/source/winding.c b/tools/qfbsp/source/winding.c index 3ba838114..bb6dc156f 100644 --- a/tools/qfbsp/source/winding.c +++ b/tools/qfbsp/source/winding.c @@ -40,6 +40,10 @@ static __attribute__ ((used)) const char rcsid[] = #include "bsp5.h" #include "winding.h" +/** \addtogroup qfbsp_winding +*/ +//@{ + int c_activewindings, c_peakwindings; winding_t * @@ -301,3 +305,5 @@ FreeWinding (winding_t *w) c_activewindings--; free (w); } + +//@} diff --git a/tools/qfbsp/source/writebsp.c b/tools/qfbsp/source/writebsp.c index fb57e62fb..beee386bb 100644 --- a/tools/qfbsp/source/writebsp.c +++ b/tools/qfbsp/source/writebsp.c @@ -45,6 +45,10 @@ static __attribute__ ((used)) const char rcsid[] = #include "options.h" #include "writebsp.h" +/** \addtogroup qfbsp_writebsp +*/ +//@{ + int headclipnode; int firstface; @@ -497,3 +501,5 @@ FinishBSPFile (void) WriteBSPFile (bsp, f); Qclose (f); } + +//@}