From 83c0fd541aa76a2b2719f1220d4fbaa7c1c19d22 Mon Sep 17 00:00:00 2001 From: Kevin Shanahan Date: Thu, 7 Mar 2013 13:48:23 +1030 Subject: [PATCH] qbsp: Rename KeepInsideFaces as SaveInside Faces The list onto which to save the faces is now passed in instead of implicitly using the global outside list. Signed-off-by: Kevin Shanahan --- qbsp/csg4.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/qbsp/csg4.c b/qbsp/csg4.c index b6b74873..e31175e6 100644 --- a/qbsp/csg4.c +++ b/qbsp/csg4.c @@ -334,13 +334,15 @@ FreeFaces(face_t *face) /* ================== -KeepInsideFaces +SaveInsideFaces -Keep the solid faces clipped inside a non-solid brush +Save the list of faces onto the output list, modifying the outside contents to +match given brush. If the inside contents are empty, the given brush's +contents override the face inside contents. ================== */ static void -KeepInsideFaces(face_t *face, const brush_t *brush) +SaveInsideFaces(face_t *face, const brush_t *brush, face_t **savelist) { face_t *next; @@ -354,8 +356,8 @@ KeepInsideFaces(face_t *face, const brush_t *brush) */ if (face->contents[1] == CONTENTS_EMPTY) face->contents[1] = brush->contents; - face->next = outside; - outside = face; + face->next = *savelist; + *savelist = face; face = next; } } @@ -503,7 +505,7 @@ CSGFaces(const mapentity_t *entity) else if (clipbrush->contents == CONTENTS_SOLID) FreeFaces(inside); else - KeepInsideFaces(inside, clipbrush); + SaveInsideFaces(inside, clipbrush, &outside); } /*