2002-09-19 18:51:19 +00:00
|
|
|
/*
|
|
|
|
Copyright (C) 1996-1997 Id Software, Inc.
|
2002-09-19 16:58:48 +00:00
|
|
|
|
2002-09-19 18:51:19 +00:00
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
2002-09-19 16:58:48 +00:00
|
|
|
|
2002-09-19 18:51:19 +00:00
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
2002-09-19 16:58:48 +00:00
|
|
|
|
2002-09-19 18:51:19 +00:00
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
2002-09-19 16:58:48 +00:00
|
|
|
|
2002-09-19 18:51:19 +00:00
|
|
|
See file, 'COPYING', for details.
|
2002-09-19 16:58:48 +00:00
|
|
|
*/
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
2003-01-15 15:31:36 +00:00
|
|
|
|
2002-09-19 19:12:16 +00:00
|
|
|
#ifdef HAVE_STRING_H
|
2010-08-29 03:43:07 +00:00
|
|
|
# include <string.h>
|
2002-09-19 19:12:16 +00:00
|
|
|
#endif
|
2002-09-19 16:58:48 +00:00
|
|
|
|
|
|
|
#include "QF/sys.h"
|
|
|
|
|
2020-06-21 14:15:17 +00:00
|
|
|
#include "tools/qfbsp/include/brush.h"
|
|
|
|
#include "tools/qfbsp/include/bsp5.h"
|
|
|
|
#include "tools/qfbsp/include/csg4.h"
|
|
|
|
#include "tools/qfbsp/include/draw.h"
|
|
|
|
#include "tools/qfbsp/include/merge.h"
|
|
|
|
#include "tools/qfbsp/include/solidbsp.h"
|
|
|
|
#include "tools/qfbsp/include/surfaces.h"
|
2002-09-19 16:58:48 +00:00
|
|
|
|
2010-09-01 01:06:54 +00:00
|
|
|
/** \addtogroup qfbsp_csg4
|
|
|
|
*/
|
|
|
|
//@{
|
|
|
|
|
2002-09-19 16:58:48 +00:00
|
|
|
/*
|
2002-09-23 16:27:17 +00:00
|
|
|
NOTES
|
2002-09-19 16:58:48 +00:00
|
|
|
|
2002-09-23 16:27:17 +00:00
|
|
|
Brushes that touch still need to be split at the cut point to make a
|
|
|
|
tjunction
|
2002-09-19 16:58:48 +00:00
|
|
|
*/
|
|
|
|
|
2021-07-26 04:10:06 +00:00
|
|
|
visfacetset_t validfaces = DARRAY_STATIC_INIT (1024);
|
2002-09-19 17:14:23 +00:00
|
|
|
face_t *inside, *outside;
|
|
|
|
int brushfaces;
|
|
|
|
int csgfaces;
|
|
|
|
int csgmergefaces;
|
2002-09-19 16:58:48 +00:00
|
|
|
|
2010-08-29 09:31:04 +00:00
|
|
|
face_t *
|
2010-08-29 11:34:59 +00:00
|
|
|
NewFaceFromFace (const face_t *in)
|
2002-09-19 16:58:48 +00:00
|
|
|
{
|
2002-09-19 17:14:23 +00:00
|
|
|
face_t *newf;
|
|
|
|
|
2002-09-19 16:58:48 +00:00
|
|
|
newf = AllocFace ();
|
|
|
|
|
|
|
|
newf->planenum = in->planenum;
|
2002-09-19 17:14:23 +00:00
|
|
|
newf->texturenum = in->texturenum;
|
2002-09-19 16:58:48 +00:00
|
|
|
newf->planeside = in->planeside;
|
|
|
|
newf->original = in->original;
|
|
|
|
newf->contents[0] = in->contents[0];
|
|
|
|
newf->contents[1] = in->contents[1];
|
2003-02-04 23:26:26 +00:00
|
|
|
newf->detail = in->detail;
|
2002-09-19 17:14:23 +00:00
|
|
|
|
2002-09-19 16:58:48 +00:00
|
|
|
return newf;
|
|
|
|
}
|
|
|
|
|
2002-09-19 17:14:23 +00:00
|
|
|
void
|
2002-09-19 18:51:19 +00:00
|
|
|
SplitFace (face_t *in, plane_t *split, face_t **front, face_t **back)
|
2002-09-19 16:58:48 +00:00
|
|
|
{
|
2003-09-08 03:00:53 +00:00
|
|
|
int i;
|
2002-09-19 17:14:23 +00:00
|
|
|
int counts[3];
|
2003-09-08 03:00:53 +00:00
|
|
|
plane_t plane;
|
2002-09-19 17:14:23 +00:00
|
|
|
vec_t dot;
|
2003-09-08 03:00:53 +00:00
|
|
|
winding_t *tmp;
|
2002-09-19 17:14:23 +00:00
|
|
|
|
2003-09-08 03:00:53 +00:00
|
|
|
if (in->points->numpoints < 0)
|
2002-09-19 16:58:48 +00:00
|
|
|
Sys_Error ("SplitFace: freed face");
|
|
|
|
counts[0] = counts[1] = counts[2] = 0;
|
|
|
|
|
2002-09-23 16:27:17 +00:00
|
|
|
// determine sides for each point
|
2003-09-08 03:00:53 +00:00
|
|
|
for (i = 0; i < in->points->numpoints; i++) {
|
|
|
|
dot = DotProduct (in->points->points[i], split->normal) - split->dist;
|
2002-09-19 16:58:48 +00:00
|
|
|
if (dot > ON_EPSILON)
|
2003-09-08 03:00:53 +00:00
|
|
|
counts[SIDE_FRONT]++;
|
2002-09-19 16:58:48 +00:00
|
|
|
else if (dot < -ON_EPSILON)
|
2003-09-08 03:00:53 +00:00
|
|
|
counts[SIDE_BACK]++;
|
2002-09-19 16:58:48 +00:00
|
|
|
}
|
2002-09-19 17:14:23 +00:00
|
|
|
|
2003-09-08 03:00:53 +00:00
|
|
|
if (!counts[SIDE_FRONT]) {
|
2002-09-19 16:58:48 +00:00
|
|
|
*front = NULL;
|
|
|
|
*back = in;
|
|
|
|
return;
|
|
|
|
}
|
2003-09-08 03:00:53 +00:00
|
|
|
if (!counts[SIDE_BACK]) {
|
2002-09-19 16:58:48 +00:00
|
|
|
*front = in;
|
|
|
|
*back = NULL;
|
|
|
|
return;
|
|
|
|
}
|
2002-09-19 17:14:23 +00:00
|
|
|
|
2003-09-08 03:00:53 +00:00
|
|
|
*back = NewFaceFromFace (in);
|
|
|
|
*front = NewFaceFromFace (in);
|
2002-09-19 17:14:23 +00:00
|
|
|
|
2003-09-08 03:00:53 +00:00
|
|
|
tmp = CopyWinding (in->points);
|
|
|
|
(*front)->points = ClipWinding (tmp, split, 0);
|
2002-09-19 16:58:48 +00:00
|
|
|
|
2003-09-08 03:00:53 +00:00
|
|
|
plane.dist = -split->dist;
|
|
|
|
VectorNegate (split->normal, plane.normal);
|
|
|
|
(*back)->points = ClipWinding (in->points, &plane, 0);
|
2002-09-19 16:58:48 +00:00
|
|
|
|
2003-09-08 03:00:53 +00:00
|
|
|
in->points = 0; // freed by ClipWinding
|
2002-09-19 16:58:48 +00:00
|
|
|
FreeFace (in);
|
|
|
|
}
|
|
|
|
|
2010-08-29 09:31:04 +00:00
|
|
|
/** Clips all of the faces in the ::inside list.
|
2002-09-19 16:58:48 +00:00
|
|
|
|
2010-08-29 09:31:04 +00:00
|
|
|
Faces will be moved to the ::outside list or split into a piece in each
|
|
|
|
list. Faces exactly on the plane will stay inside unless overdrawn by
|
|
|
|
a later brush
|
2002-09-19 16:58:48 +00:00
|
|
|
|
2010-08-29 09:31:04 +00:00
|
|
|
\param splitplane Index of the plane by which faces will be clipped.
|
|
|
|
\param frontside The side of the plane that holds the outside list.
|
|
|
|
\param precedence XXX
|
2002-09-19 16:58:48 +00:00
|
|
|
*/
|
2003-01-06 18:28:13 +00:00
|
|
|
static void
|
2023-06-13 09:06:11 +00:00
|
|
|
ClipInside (int splitplane, int frontside, bool precedence)
|
2002-09-19 16:58:48 +00:00
|
|
|
{
|
2002-09-19 18:51:19 +00:00
|
|
|
face_t *insidelist, *next, *f;
|
2002-09-19 17:14:23 +00:00
|
|
|
face_t *frags[2];
|
|
|
|
plane_t *split;
|
|
|
|
|
2021-07-26 04:10:06 +00:00
|
|
|
split = &planes.a[splitplane];
|
2002-09-19 17:14:23 +00:00
|
|
|
|
2002-09-19 16:58:48 +00:00
|
|
|
insidelist = NULL;
|
2002-09-19 17:14:23 +00:00
|
|
|
for (f = inside; f; f = next) {
|
2010-08-29 09:31:04 +00:00
|
|
|
next = f->next; // f->next will get mashed by SplitFace
|
|
|
|
|
|
|
|
if (f->planenum == splitplane) {
|
|
|
|
// exactly on, handle special
|
2002-09-19 17:14:23 +00:00
|
|
|
|
2010-08-29 09:31:04 +00:00
|
|
|
// always clip off opposite facing
|
|
|
|
if (frontside != f->planeside || precedence) {
|
2002-09-19 16:58:48 +00:00
|
|
|
frags[frontside] = NULL;
|
|
|
|
frags[!frontside] = f;
|
2010-08-29 09:31:04 +00:00
|
|
|
} else {
|
|
|
|
// leave it on the outside
|
2002-09-19 16:58:48 +00:00
|
|
|
frags[frontside] = f;
|
|
|
|
frags[!frontside] = NULL;
|
|
|
|
}
|
2010-08-29 09:31:04 +00:00
|
|
|
} else {
|
|
|
|
// proper split
|
2002-09-19 16:58:48 +00:00
|
|
|
SplitFace (f, split, &frags[0], &frags[1]);
|
|
|
|
}
|
2002-09-19 17:14:23 +00:00
|
|
|
|
|
|
|
if (frags[frontside]) {
|
2002-09-19 16:58:48 +00:00
|
|
|
frags[frontside]->next = outside;
|
|
|
|
outside = frags[frontside];
|
|
|
|
}
|
2002-09-19 17:14:23 +00:00
|
|
|
if (frags[!frontside]) {
|
2002-09-19 16:58:48 +00:00
|
|
|
frags[!frontside]->next = insidelist;
|
|
|
|
insidelist = frags[!frontside];
|
|
|
|
}
|
|
|
|
}
|
2002-09-19 17:14:23 +00:00
|
|
|
|
2002-09-19 16:58:48 +00:00
|
|
|
inside = insidelist;
|
|
|
|
}
|
|
|
|
|
2010-08-29 09:31:04 +00:00
|
|
|
/** Saves all of the faces in the ::outside list to the bsp plane list
|
|
|
|
(::validfaces).
|
2002-09-19 16:58:48 +00:00
|
|
|
|
2010-08-29 09:31:04 +00:00
|
|
|
\param mirror If true, add extra faces that face the opposite direction.
|
2002-09-19 16:58:48 +00:00
|
|
|
*/
|
2003-01-06 18:28:13 +00:00
|
|
|
static void
|
2023-06-13 09:06:11 +00:00
|
|
|
SaveOutside (bool mirror)
|
2002-09-19 16:58:48 +00:00
|
|
|
{
|
2002-09-19 17:14:23 +00:00
|
|
|
face_t *f, *next, *newf;
|
2003-09-08 03:00:53 +00:00
|
|
|
int planenum;
|
2002-09-19 17:14:23 +00:00
|
|
|
|
|
|
|
for (f = outside; f; f = next) {
|
2002-09-19 16:58:48 +00:00
|
|
|
next = f->next;
|
|
|
|
csgfaces++;
|
|
|
|
Draw_DrawFace (f);
|
|
|
|
planenum = f->planenum;
|
2002-09-19 17:14:23 +00:00
|
|
|
|
|
|
|
if (mirror) {
|
2002-09-19 16:58:48 +00:00
|
|
|
newf = NewFaceFromFace (f);
|
2002-09-19 17:14:23 +00:00
|
|
|
|
2003-09-08 03:00:53 +00:00
|
|
|
newf->points = CopyWindingReverse (f->points);
|
2002-09-19 16:58:48 +00:00
|
|
|
newf->planeside = f->planeside ^ 1; // reverse side
|
|
|
|
newf->contents[0] = f->contents[1];
|
|
|
|
newf->contents[1] = f->contents[0];
|
2002-09-19 17:14:23 +00:00
|
|
|
|
2021-07-26 04:10:06 +00:00
|
|
|
validfaces.a[planenum] = MergeFaceToList (newf,
|
|
|
|
validfaces.a[planenum]);
|
2003-09-03 22:00:08 +00:00
|
|
|
}
|
2002-09-19 16:58:48 +00:00
|
|
|
|
2021-07-26 04:10:06 +00:00
|
|
|
validfaces.a[planenum] = MergeFaceToList (f, validfaces.a[planenum]);
|
|
|
|
validfaces.a[planenum] = FreeMergeListScraps (validfaces.a[planenum]);
|
2002-09-19 16:58:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-08-29 09:31:04 +00:00
|
|
|
/** Free the faces that are inside the clipping brush.
|
|
|
|
|
|
|
|
If the clipping brush is non-solid, then the faces will be moved to
|
|
|
|
::outside rather than being freed, thus allowing the faces to continue
|
|
|
|
to exist.
|
2002-09-19 16:58:48 +00:00
|
|
|
|
2010-08-29 09:31:04 +00:00
|
|
|
\param contents The contents of the clipping brush.
|
2002-09-19 16:58:48 +00:00
|
|
|
*/
|
2003-01-06 18:28:13 +00:00
|
|
|
static void
|
2002-09-19 17:14:23 +00:00
|
|
|
FreeInside (int contents)
|
2002-09-19 16:58:48 +00:00
|
|
|
{
|
2002-09-19 18:51:19 +00:00
|
|
|
face_t *next, *f;
|
2002-09-19 17:14:23 +00:00
|
|
|
|
|
|
|
for (f = inside; f; f = next) {
|
2002-09-19 16:58:48 +00:00
|
|
|
next = f->next;
|
2002-09-19 17:14:23 +00:00
|
|
|
|
|
|
|
if (contents != CONTENTS_SOLID) {
|
2002-09-19 16:58:48 +00:00
|
|
|
f->contents[0] = contents;
|
|
|
|
f->next = outside;
|
|
|
|
outside = f;
|
2002-09-19 17:14:23 +00:00
|
|
|
} else
|
2002-09-19 16:58:48 +00:00
|
|
|
FreeFace (f);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-08-29 09:31:04 +00:00
|
|
|
surface_t *
|
2002-09-19 17:14:23 +00:00
|
|
|
BuildSurfaces (void)
|
2002-09-19 16:58:48 +00:00
|
|
|
{
|
2002-09-19 17:14:23 +00:00
|
|
|
face_t *count;
|
2002-09-19 18:51:19 +00:00
|
|
|
face_t **f;
|
|
|
|
surface_t *surfhead, *s;
|
2002-09-19 17:14:23 +00:00
|
|
|
|
2002-09-19 16:58:48 +00:00
|
|
|
surfhead = NULL;
|
2002-09-19 17:14:23 +00:00
|
|
|
|
2021-07-26 04:10:06 +00:00
|
|
|
f = validfaces.a;
|
|
|
|
for (size_t i = 0; i < planes.size; i++, f++) {
|
2002-09-19 16:58:48 +00:00
|
|
|
if (!*f)
|
2002-09-19 17:14:23 +00:00
|
|
|
continue; // nothing left on this plane
|
2002-09-19 16:58:48 +00:00
|
|
|
|
2002-09-23 16:27:17 +00:00
|
|
|
// create a new surface to hold the faces on this plane
|
2002-09-19 16:58:48 +00:00
|
|
|
s = AllocSurface ();
|
|
|
|
s->planenum = i;
|
|
|
|
s->next = surfhead;
|
|
|
|
surfhead = s;
|
|
|
|
s->faces = *f;
|
2003-02-04 23:26:26 +00:00
|
|
|
for (count = s->faces; count; count = count->next) {
|
2002-09-19 16:58:48 +00:00
|
|
|
csgmergefaces++;
|
2003-02-04 23:26:26 +00:00
|
|
|
if (count->detail)
|
|
|
|
s->has_detail = 1;
|
|
|
|
else
|
|
|
|
s->has_struct = 1;
|
|
|
|
}
|
2002-09-19 17:14:23 +00:00
|
|
|
CalcSurfaceInfo (s); // bounding box and flags
|
|
|
|
}
|
|
|
|
|
2002-09-19 16:58:48 +00:00
|
|
|
return surfhead;
|
|
|
|
}
|
|
|
|
|
2010-08-29 09:31:04 +00:00
|
|
|
/** Create faces using the faces of the provided brush.
|
|
|
|
|
|
|
|
The ::outside list will be set to the list of created faces. The faces
|
|
|
|
will be such that their front is empty and their back is the contents of
|
|
|
|
the brush.
|
|
|
|
|
|
|
|
\param b The brush from which to create the faces.
|
|
|
|
*/
|
2003-01-06 18:28:13 +00:00
|
|
|
static void
|
2002-09-19 18:51:19 +00:00
|
|
|
CopyFacesToOutside (brush_t *b)
|
2002-09-19 16:58:48 +00:00
|
|
|
{
|
2002-09-19 18:51:19 +00:00
|
|
|
face_t *newf, *f;
|
2002-09-19 17:14:23 +00:00
|
|
|
|
2002-09-19 16:58:48 +00:00
|
|
|
outside = NULL;
|
2002-09-19 17:14:23 +00:00
|
|
|
|
|
|
|
for (f = b->faces; f; f = f->next) {
|
2003-02-04 23:26:26 +00:00
|
|
|
if (f->texturenum == TEX_SKIP)
|
|
|
|
continue;
|
|
|
|
|
2002-09-19 16:58:48 +00:00
|
|
|
brushfaces++;
|
|
|
|
newf = AllocFace ();
|
|
|
|
*newf = *f;
|
2003-09-08 03:00:53 +00:00
|
|
|
newf->points = CopyWinding (f->points);
|
2002-09-19 16:58:48 +00:00
|
|
|
newf->next = outside;
|
|
|
|
newf->contents[0] = CONTENTS_EMPTY;
|
|
|
|
newf->contents[1] = b->contents;
|
|
|
|
outside = newf;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-08-29 09:31:04 +00:00
|
|
|
surface_t *
|
2002-09-19 18:51:19 +00:00
|
|
|
CSGFaces (brushset_t *bs)
|
2002-09-19 16:58:48 +00:00
|
|
|
{
|
2002-09-19 17:14:23 +00:00
|
|
|
brush_t *b1, *b2;
|
2002-09-19 18:51:19 +00:00
|
|
|
face_t *f;
|
2002-09-19 17:14:23 +00:00
|
|
|
int i;
|
2023-06-13 09:06:11 +00:00
|
|
|
bool overwrite;
|
2002-09-19 17:14:23 +00:00
|
|
|
surface_t *surfhead;
|
2002-09-19 16:58:48 +00:00
|
|
|
|
|
|
|
qprintf ("---- CSGFaces ----\n");
|
|
|
|
|
2021-07-26 04:10:06 +00:00
|
|
|
DARRAY_RESIZE (&validfaces, planes.size);
|
|
|
|
memset (validfaces.a, 0, validfaces.size * sizeof (validfaces.a[0]));
|
2002-09-19 17:14:23 +00:00
|
|
|
|
2002-09-19 16:58:48 +00:00
|
|
|
csgfaces = brushfaces = csgmergefaces = 0;
|
2002-09-19 17:14:23 +00:00
|
|
|
|
2002-09-19 16:58:48 +00:00
|
|
|
Draw_ClearWindow ();
|
2002-09-19 17:14:23 +00:00
|
|
|
|
2002-09-23 16:27:17 +00:00
|
|
|
// do the solid faces
|
2002-09-19 17:14:23 +00:00
|
|
|
for (b1 = bs->brushes; b1; b1 = b1->next) {
|
|
|
|
// set outside to a copy of the brush's faces
|
2002-09-19 16:58:48 +00:00
|
|
|
CopyFacesToOutside (b1);
|
2002-09-19 17:14:23 +00:00
|
|
|
|
2003-02-04 23:26:26 +00:00
|
|
|
if (b1->faces->texturenum < 0) {
|
|
|
|
// Don't split HINT and SKIP brushes.
|
|
|
|
SaveOutside (false);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2010-08-29 09:31:04 +00:00
|
|
|
// earlier brushes do NOT overwrite
|
2002-09-19 16:58:48 +00:00
|
|
|
overwrite = false;
|
2002-09-19 17:14:23 +00:00
|
|
|
|
|
|
|
for (b2 = bs->brushes; b2; b2 = b2->next) {
|
2010-08-29 09:31:04 +00:00
|
|
|
// see if b2 needs to clip a chunk out of b1
|
2003-02-04 23:26:26 +00:00
|
|
|
if (b2->faces->texturenum < 0)
|
|
|
|
continue;
|
2002-09-19 17:14:23 +00:00
|
|
|
|
|
|
|
if (b1 == b2) {
|
2010-08-29 09:31:04 +00:00
|
|
|
// later brushes DO overwrite
|
|
|
|
overwrite = true;
|
2002-09-19 16:58:48 +00:00
|
|
|
continue;
|
|
|
|
}
|
2002-09-19 17:14:23 +00:00
|
|
|
// check bounding box first
|
|
|
|
for (i = 0; i < 3; i++)
|
2002-09-19 16:58:48 +00:00
|
|
|
if (b1->mins[i] > b2->maxs[i] || b1->maxs[i] < b2->mins[i])
|
|
|
|
break;
|
2002-09-19 17:14:23 +00:00
|
|
|
if (i < 3)
|
2002-09-19 16:58:48 +00:00
|
|
|
continue;
|
|
|
|
|
2002-09-19 17:14:23 +00:00
|
|
|
// divide faces by the planes of the new brush
|
|
|
|
|
2002-09-19 16:58:48 +00:00
|
|
|
inside = outside;
|
|
|
|
outside = NULL;
|
2002-09-19 17:14:23 +00:00
|
|
|
|
|
|
|
for (f = b2->faces; f; f = f->next)
|
2002-09-19 16:58:48 +00:00
|
|
|
ClipInside (f->planenum, f->planeside, overwrite);
|
|
|
|
|
2010-08-29 09:31:04 +00:00
|
|
|
// these faces are contained in another brush, so get rid of them
|
2002-09-19 17:14:23 +00:00
|
|
|
if (b1->contents == CONTENTS_SOLID
|
2010-08-29 09:31:04 +00:00
|
|
|
&& b2->contents <= CONTENTS_WATER) {
|
|
|
|
// Faces from a solid brush are allowed to exist inside a
|
|
|
|
// non-solid brush. This forms an intrusion into the clipping
|
|
|
|
// brush.
|
2002-09-25 21:35:49 +00:00
|
|
|
FreeInside (b2->contents);
|
2010-08-29 09:31:04 +00:00
|
|
|
} else {
|
|
|
|
// Unconditionally treat the clipping brush as solid to force
|
|
|
|
// contents merging, or to make an empty clipping brush clip
|
|
|
|
// away parts of other brushes.
|
2002-09-19 16:58:48 +00:00
|
|
|
FreeInside (CONTENTS_SOLID);
|
2010-08-29 09:31:04 +00:00
|
|
|
}
|
2002-09-19 16:58:48 +00:00
|
|
|
}
|
2002-09-19 17:14:23 +00:00
|
|
|
|
|
|
|
// all of the faces left in outside are real surface faces
|
2010-08-29 09:29:08 +00:00
|
|
|
// if the brush is not solid, mirror the faces for the inside view
|
|
|
|
SaveOutside (b1->contents != CONTENTS_SOLID);
|
2002-09-19 16:58:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
if (!csgfaces)
|
|
|
|
Sys_Error ("No faces");
|
|
|
|
#endif
|
|
|
|
|
|
|
|
surfhead = BuildSurfaces ();
|
2002-09-19 17:14:23 +00:00
|
|
|
|
2002-09-19 16:58:48 +00:00
|
|
|
qprintf ("%5i brushfaces\n", brushfaces);
|
|
|
|
qprintf ("%5i csgfaces\n", csgfaces);
|
|
|
|
qprintf ("%5i mergedfaces\n", csgmergefaces);
|
2002-09-19 17:14:23 +00:00
|
|
|
|
2002-09-19 16:58:48 +00:00
|
|
|
return surfhead;
|
|
|
|
}
|
2010-09-01 01:06:54 +00:00
|
|
|
|
|
|
|
//@}
|