Some checks during compile, warning on -check and changes .map on -fix. More...
#include "../common/shared.h"
#include "../common/bspfile.h"
#include "../common/scriplib.h"
#include "../../../shared/entitiesdef.h"
#include "../map.h"
#include "check.h"
#include "checklib.h"
#include "../bsp.h"
#include "../ufo2map.h"
Go to the source code of this file.
Defines | |
#define | CH_DIST_EPSILON 0.001f |
#define | CH_DIST_EPSILON_SQR 0.000001 |
#define | CH_DIST_EPSILON_COLLINEAR_POINTS 0.02f |
#define | COS_EPSILON 0.9999f |
#define | SIN_EPSILON 0.0001f |
#define | NEARDOWN_COS 0.985 |
#define | VERT_BUF_SIZE_DISJOINT_SIDES 21 |
#define | OVERLAP_AREA_TOL 0.2f |
#define | OVERLAP_WIDTH_TOL 0.1f |
#define | CH_COMP_NDR_EDGE_INTSCT_BUF 21 |
#define | M(x) if (flags & CONTENTS_##x) Check_Printf(VERB_CHECK, qfalse, NUM_SAME, NUM_SAME, " " #x) |
Enumerations | |
enum | pointInBrush_t { PIB_EXCL_SURF, PIB_INCL_SURF_EXCL_EDGE, PIB_INCL_SURF, PIB_ON_SURFACE_ONLY } |
wether the surface of a brush is included when testing if a point is in a brush determines how epsilon is applied. More... | |
Functions | |
static qboolean | Check_SidePointsDown (const side_t *s) |
faces that are near pointing down may be set nodraw, as views are always slightly down | |
static float | Check_PointPlaneDistance (const vec3_t point, const plane_t *plane) |
distance from a point to a plane. | |
static qboolean | FacingAndCoincidentTo (const side_t *side1, const side_t *side2) |
calculates whether side1 faces side2 and touches. | |
static qboolean | ParallelAndCoincidentTo (const side_t *side1, const side_t *side2) |
calculates whether side1 and side2 are on a common plane | |
static qboolean | Check_IsPointInsideBrush (const vec3_t point, const mapbrush_t *brush, const pointInBrush_t mode) |
tests if a point is in a map brush. | |
static qboolean | Check_SurfProp (const int flag, const side_t *s) |
textures take priority over flags. checks if a tex marks a side as having a special property. | |
static qboolean | Check_SurfProps (const int flags, const side_t *s) |
textures take priority over flags. checks if a tex marks a side as having a special property. | |
static qboolean | Check_IsOptimisable (const mapbrush_t *b) |
static qboolean | Check_BoundingBoxIntersects (const mapbrush_t *a, const mapbrush_t *b) |
static void | Check_NearList (void) |
add a list of near brushes to each mapbrush. near meaning that the bounding boxes are intersecting or within CH_DIST_EPSILON of touching. | |
static qboolean | Check_SideIsInBrush (const side_t *side, const mapbrush_t *brush, pointInBrush_t mode) |
tests the vertices in the winding of side s. | |
static qboolean | Check_SidesTouch (side_t *a, side_t *b) |
test if sides abut or intersect | |
static void | Check_FindCompositeSides (void) |
a composite side is a side made of sides from neighbouring brushes. the sides abut. these sides can cooperate to hide a face, this is used for nodraw setting. composite sides may be used for other things in the future. | |
static int | Check_EdgePlaneIntersection (const vec3_t vert1, const vec3_t vert2, const plane_t *plane, vec3_t intersection) |
calculate where an edge (defined by the vertices) intersects a plane. http://local.wasp.uwa.edu.au/~pbourke/geometry/planeline/ | |
static qboolean | Check_WindingIntersects (const winding_t *winding, const mapbrush_t *brush) |
tests the lines joining the vertices in the winding | |
void | Check_BrushIntersection (void) |
reports intersection between optimisable map brushes | |
static qboolean | Check_EdgeEdgeIntersection (const vec3_t e1p1, const vec3_t e1p2, const vec3_t e2p1, const vec3_t e2p2, vec3_t intersection) |
finds point of intersection of two finite lines, if one exists | |
static float | Check_LongestEdge (const winding_t *w) |
static float | Check_SidesOverlap (const side_t *s1, const side_t *s2) |
tests if sides overlap, for z-fighting check | |
void | CheckZFighting (void) |
check all brushes for overlapping shared faces | |
void | Check_ContainedBrushes (void) |
find duplicated brushes and brushes contained inside brushes | |
static int | Check_LevelForNodraws (const side_t *coverer, const side_t *coveree) |
static void | Check_SetNodraw (side_t *s) |
void | CheckNodraws (void) |
check for faces which can safely be set to SURF_NODRAW because they are pressed against the faces of other brushes. Also set faces pointing near straight down nodraw. | |
static qboolean | Check_DuplicateBrushPlanes (const mapbrush_t *b) |
static vec_t | Check_MapBrushVolume (const mapbrush_t *brush) |
void | CheckMapMicro (void) |
report brushes from the map below 1 unit^3 | |
void | DisplayContentFlags (const int flags) |
prints a list of the names of the set content flags or "no contentflags" if all bits are 0 | |
static int | Check_CalculateLevelFlagFill (int contentFlags) |
calculate the bits that have to be set to fill levelflags such that they are contiguous | |
void | CheckFillLevelFlags (void) |
ensures set levelflags are in one contiguous block | |
void | CheckLevelFlags (void) |
sets all levelflags, if none are set. | |
void | SetImpliedFlags (side_t *side, brush_texture_t *tex, const mapbrush_t *brush) |
Sets surface flags dependent on assigned texture. | |
void | CheckFlagsBasedOnTextures (void) |
sets content flags based on textures | |
void | CheckTexturesBasedOnFlags (void) |
check that sides have textures and that where content/surface flags are set the texture is correct. | |
void | CheckPropagateParserContentFlags (mapbrush_t *b) |
some contentlflags are set as a result of some surface flag. For example, if one face is TRANS* then the brush is TRANSLUCENT. this is required by the .map parser as well as th check/fix code. | |
void | CheckMixedFaceContents (void) |
contentflags should be the same on each face of a brush. print warnings if they are not. remove contentflags that are set on less than half of the faces. some content flags are transferred to all faces on parsing, ParseBrush(). | |
void | CheckBrushes (void) |
Some checks during compile, warning on -check and changes .map on -fix.
Definition in file check.c.
#define CH_COMP_NDR_EDGE_INTSCT_BUF 21 |
Definition at line 990 of file check.c.
Referenced by CheckNodraws().
#define CH_DIST_EPSILON 0.001f |
how close faces have to be in order for one to be hidden and set to SURF_NODRAW. Also the margin for abutting brushes to be considered not intersecting
Definition at line 40 of file check.c.
Referenced by Check_BoundingBoxIntersects(), Check_EdgeEdgeIntersection(), Check_EdgePlaneIntersection(), Check_IsPointInsideBrush(), Check_PointPlaneDistance(), Check_SidesOverlap(), FacingAndCoincidentTo(), and ParallelAndCoincidentTo().
#define CH_DIST_EPSILON_COLLINEAR_POINTS 0.02f |
#define CH_DIST_EPSILON_SQR 0.000001 |
Definition at line 41 of file check.c.
Referenced by CheckNodraws().
#define COS_EPSILON 0.9999f |
if the cosine of an angle is greater than this, then the angle is negligibly different from zero
Definition at line 46 of file check.c.
Referenced by Check_EdgeEdgeIntersection(), FacingAndCoincidentTo(), and ParallelAndCoincidentTo().
#define M | ( | x | ) | if (flags & CONTENTS_##x) Check_Printf(VERB_CHECK, qfalse, NUM_SAME, NUM_SAME, " " #x) |
#define NEARDOWN_COS 0.985 |
faces close to pointing down may be set to nodraw. this is the cosine of the angle of how close it has to be. around 10 degrees
Definition at line 65 of file check.c.
Referenced by Check_SidePointsDown().
#define OVERLAP_AREA_TOL 0.2f |
Definition at line 743 of file check.c.
Referenced by Check_SidesOverlap().
#define OVERLAP_WIDTH_TOL 0.1f |
Definition at line 744 of file check.c.
Referenced by Check_SidesOverlap().
#define SIN_EPSILON 0.0001f |
if the sine of an angle is less than this, then the angle is negligibly different from zero
Definition at line 49 of file check.c.
Referenced by Check_EdgePlaneIntersection().
#define VERT_BUF_SIZE_DISJOINT_SIDES 21 |
Definition at line 742 of file check.c.
Referenced by Check_SidesOverlap().
enum pointInBrush_t |
wether the surface of a brush is included when testing if a point is in a brush determines how epsilon is applied.
static qboolean Check_BoundingBoxIntersects | ( | const mapbrush_t * | a, | |
const mapbrush_t * | b | |||
) | [static] |
Definition at line 278 of file check.c.
References CH_DIST_EPSILON, i, mapbrush_s::maxs, mapbrush_s::mins, qfalse, and qtrue.
Referenced by Check_NearList().
void Check_BrushIntersection | ( | void | ) |
reports intersection between optimisable map brushes
Definition at line 598 of file check.c.
References mapbrush_s::brushnum, Check_IsOptimisable(), Check_NearList(), Check_Printf(), Check_WindingIntersects(), mapbrush_s::entitynum, i, mapbrushes, mapbrush_s::nearBrushes, nummapbrushes, mapbrush_s::numNear, mapbrush_s::numsides, mapbrush_s::original_sides, qfalse, VERB_CHECK, and side_s::winding.
Referenced by main().
static int Check_CalculateLevelFlagFill | ( | int | contentFlags | ) | [static] |
calculate the bits that have to be set to fill levelflags such that they are contiguous
Definition at line 1366 of file check.c.
References CONTENTS_LEVEL_1, and CONTENTS_LEVEL_8.
Referenced by CheckFillLevelFlags().
void Check_ContainedBrushes | ( | void | ) |
find duplicated brushes and brushes contained inside brushes
Definition at line 925 of file check.c.
References mapbrush_s::brushnum, Check_IsOptimisable(), Check_NearList(), Check_Printf(), Check_SideIsInBrush(), mapbrush_s::contentFlags, CONTENTS_ORIGIN, mapbrush_s::entitynum, i, mapbrushes, mapbrush_s::nearBrushes, nummapbrushes, mapbrush_s::numNear, mapbrush_s::numsides, mapbrush_s::original_sides, PIB_INCL_SURF, qfalse, and VERB_CHECK.
Referenced by main().
static qboolean Check_DuplicateBrushPlanes | ( | const mapbrush_t * | b | ) | [static] |
Definition at line 1243 of file check.c.
References mapbrush_s::brushnum, Check_Printf(), mapbrush_s::entitynum, i, mapbrush_s::numsides, mapbrush_s::original_sides, qfalse, qtrue, and VERB_CHECK.
Referenced by CheckBrushes().
static qboolean Check_EdgeEdgeIntersection | ( | const vec3_t | e1p1, | |
const vec3_t | e1p2, | |||
const vec3_t | e2p1, | |||
const vec3_t | e2p2, | |||
vec3_t | intersection | |||
) | [static] |
finds point of intersection of two finite lines, if one exists
[in] | e1p1 | first point defining line 1 |
[in] | e1p2 | second point defining line 1 |
[out] | intersection | will be set to the point of intersection, if one exists |
Definition at line 637 of file check.c.
References CH_DIST_EPSILON, COS_EPSILON, CrossProduct(), DotProduct, f, qfalse, qtrue, VectorAdd, VectorLength(), VectorNormalize(), VectorScale, and VectorSubtract.
Referenced by Check_SidesOverlap(), and CheckNodraws().
static int Check_EdgePlaneIntersection | ( | const vec3_t | vert1, | |
const vec3_t | vert2, | |||
const plane_t * | plane, | |||
vec3_t | intersection | |||
) | [static] |
calculate where an edge (defined by the vertices) intersects a plane. http://local.wasp.uwa.edu.au/~pbourke/geometry/planeline/
[out] | intersection | the position of the intersection, if the edge is not too close to parallel. |
Definition at line 551 of file check.c.
References CH_DIST_EPSILON, DIST_EPSILON, DotProduct, plane_s::normal, plane_s::planeVector, qfalse, SIN_EPSILON, VectorAdd, VectorLength(), VectorMul, and VectorSubtract.
Referenced by Check_WindingIntersects().
static void Check_FindCompositeSides | ( | void | ) | [static] |
a composite side is a side made of sides from neighbouring brushes. the sides abut. these sides can cooperate to hide a face, this is used for nodraw setting. composite sides may be used for other things in the future.
Definition at line 420 of file check.c.
References side_s::brush, Check_IsOptimisable(), Check_NearList(), Check_Printf(), Check_SidesTouch(), Check_SurfProp(), compositeSides, i, side_s::isCompositeMember, m, mapbrushes, MAX_MAP_SIDES, Mem_Alloc, compositeSide_s::memberSides, mapbrush_s::nearBrushes, numCompositeSides, nummapbrushes, compositeSide_s::numMembers, mapbrush_s::numNear, mapbrush_s::numsides, mapbrush_s::original_sides, ParallelAndCoincidentTo(), qfalse, qtrue, SURF_NODRAW, Sys_Error(), VERB_EXTRA, and side_s::winding.
Referenced by CheckNodraws().
static qboolean Check_IsOptimisable | ( | const mapbrush_t * | b | ) | [static] |
Definition at line 252 of file check.c.
References Check_SurfProp(), Check_SurfProps(), side_s::contentFlags, CONTENTS_ORIGIN, CONTENTS_TRANSLUCENT, entities, mapbrush_s::entitynum, i, MASK_CLIP, name, mapbrush_s::numsides, mapbrush_s::original_sides, qfalse, qtrue, SURF_NODRAW, and ValueForKey().
Referenced by Check_BrushIntersection(), Check_ContainedBrushes(), Check_FindCompositeSides(), CheckNodraws(), and CheckZFighting().
static qboolean Check_IsPointInsideBrush | ( | const vec3_t | point, | |
const mapbrush_t * | brush, | |||
const pointInBrush_t | mode | |||
) | [inline, static] |
tests if a point is in a map brush.
[in] | point | The point to check whether it's inside the brush boundaries or not |
[in] | brush | The brush to check against |
[in] | mode | determines how epsilons are applied |
Definition at line 150 of file check.c.
References CH_DIST_EPSILON, Check_PointPlaneDistance(), i, mapplanes, mapbrush_s::numsides, mapbrush_s::original_sides, PIB_EXCL_SURF, PIB_INCL_SURF_EXCL_EDGE, PIB_ON_SURFACE_ONLY, side_s::planenum, qfalse, and qtrue.
Referenced by Check_SideIsInBrush(), Check_SidesOverlap(), Check_SidesTouch(), Check_WindingIntersects(), and CheckNodraws().
Definition at line 965 of file check.c.
References side_s::contentFlags, and CONTENTS_LEVEL_ALL.
Referenced by CheckNodraws().
static float Check_LongestEdge | ( | const winding_t * | w | ) | [static] |
Definition at line 730 of file check.c.
References i, winding_s::numpoints, winding_s::p, and VectorDistSqr.
Referenced by Check_SidesOverlap().
static vec_t Check_MapBrushVolume | ( | const mapbrush_t * | brush | ) | [static] |
Definition at line 1275 of file check.c.
References plane_s::dist, DotProduct, i, mapplanes, plane_s::normal, mapbrush_s::numsides, mapbrush_s::original_sides, winding_s::p, side_s::planenum, VectorCopy, side_s::winding, and WindingArea().
Referenced by CheckMapMicro().
static void Check_NearList | ( | void | ) | [static] |
add a list of near brushes to each mapbrush. near meaning that the bounding boxes are intersecting or within CH_DIST_EPSILON of touching.
Definition at line 295 of file check.c.
References Check_BoundingBoxIntersects(), i, mapbrushes, MAX_MAP_BRUSHES, Mem_Alloc, mapbrush_s::nearBrushes, nummapbrushes, mapbrush_s::numNear, qfalse, qtrue, and Sys_Error().
Referenced by Check_BrushIntersection(), Check_ContainedBrushes(), Check_FindCompositeSides(), and CheckZFighting().
static float Check_PointPlaneDistance | ( | const vec3_t | point, | |
const plane_t * | plane | |||
) | [inline, static] |
distance from a point to a plane.
Definition at line 84 of file check.c.
References CH_DIST_EPSILON, plane_s::dist, DotProduct, plane_s::normal, and VectorLengthSqr.
Referenced by Check_IsPointInsideBrush(), FacingAndCoincidentTo(), and ParallelAndCoincidentTo().
static void Check_SetNodraw | ( | side_t * | s | ) | [static] |
Definition at line 970 of file check.c.
References brushsides, config, brush_texture_s::name, Q_strncpyz(), side_brushtextures, SURF_NODRAW, SURF_PHONG, side_s::surfaceFlags, and brush_texture_s::surfaceFlags.
Referenced by CheckNodraws().
static qboolean Check_SideIsInBrush | ( | const side_t * | side, | |
const mapbrush_t * | brush, | |||
pointInBrush_t | mode | |||
) | [static] |
tests the vertices in the winding of side s.
[in] | side | The side |
[in] | brush | The brush |
[in] | mode | determines how epsilon is applied |
Definition at line 349 of file check.c.
References Check_IsPointInsideBrush(), i, winding_s::numpoints, winding_s::p, qfalse, qtrue, and side_s::winding.
Referenced by Check_ContainedBrushes(), and CheckNodraws().
faces that are near pointing down may be set nodraw, as views are always slightly down
Definition at line 71 of file check.c.
References DotProduct, down, mapplanes, NEARDOWN_COS, plane_s::normal, and side_s::planenum.
Referenced by CheckNodraws(), and CheckZFighting().
tests if sides overlap, for z-fighting check
Definition at line 755 of file check.c.
References AllocWinding(), side_s::brush, CH_DIST_EPSILON, Check_EdgeEdgeIntersection(), Check_IsPointInsideBrush(), Check_LongestEdge(), Check_Printf(), i, Mem_Free, winding_s::numpoints, OVERLAP_AREA_TOL, OVERLAP_WIDTH_TOL, winding_s::p, PIB_INCL_SURF, Print3Vector(), qfalse, qtrue, VectorCopy, VectorLength(), VectorSubtract, VERB_CHECK, VERT_BUF_SIZE_DISJOINT_SIDES, side_s::winding, and WindingArea().
Referenced by CheckZFighting().
test if sides abut or intersect
Definition at line 384 of file check.c.
References side_s::brush, Check_IsPointInsideBrush(), i, winding_s::numpoints, winding_s::p, PIB_INCL_SURF, qfalse, qtrue, and side_s::winding.
Referenced by Check_FindCompositeSides().
textures take priority over flags. checks if a tex marks a side as having a special property.
flag | The (surface or content) flag the property to check for. should only have one bit set. | |
s | the side to check the texture of |
Definition at line 189 of file check.c.
References brushsides, CONTENTS_ACTORCLIP, CONTENTS_LADDER, CONTENTS_LIGHTCLIP, CONTENTS_ORIGIN, CONTENTS_WEAPONCLIP, brush_texture_s::name, qfalse, side_brushtextures, and SURF_NODRAW.
Referenced by Check_FindCompositeSides(), Check_IsOptimisable(), CheckLevelFlags(), CheckNodraws(), CheckZFighting(), and SetImpliedFlags().
textures take priority over flags. checks if a tex marks a side as having a special property.
flags | the properties to check for. may have several bits set | |
s | the side to check the texture of |
Definition at line 221 of file check.c.
References brushsides, CONTENTS_ACTORCLIP, CONTENTS_LADDER, CONTENTS_LIGHTCLIP, CONTENTS_ORIGIN, CONTENTS_WEAPONCLIP, MASK_CLIP, brush_texture_s::name, qfalse, qtrue, side_brushtextures, and SURF_NODRAW.
Referenced by Check_IsOptimisable().
static qboolean Check_WindingIntersects | ( | const winding_t * | winding, | |
const mapbrush_t * | brush | |||
) | [static] |
tests the lines joining the vertices in the winding
Definition at line 578 of file check.c.
References Check_EdgePlaneIntersection(), Check_IsPointInsideBrush(), mapplanes, winding_s::numpoints, mapbrush_s::numsides, mapbrush_s::original_sides, winding_s::p, PIB_INCL_SURF_EXCL_EDGE, side_s::planenum, qfalse, and qtrue.
Referenced by Check_BrushIntersection().
void CheckBrushes | ( | void | ) |
Definition at line 1739 of file check.c.
References mapbrush_s::brushnum, Check_DuplicateBrushPlanes(), Check_Printf(), side_s::contentFlags, CONTENTS_ORIGIN, mapbrush_s::entitynum, i, mapbrushes, nummapbrushes, mapbrush_s::numsides, mapbrush_s::original_sides, qtrue, and VERB_CHECK.
Referenced by main().
void CheckFillLevelFlags | ( | void | ) |
ensures set levelflags are in one contiguous block
Definition at line 1388 of file check.c.
References mapbrush_s::brushnum, Check_CalculateLevelFlagFill(), Check_Printf(), side_s::contentFlags, DisplayContentFlags(), mapbrush_s::entitynum, i, mapbrushes, nummapbrushes, mapbrush_s::numsides, mapbrush_s::original_sides, qtrue, and VERB_CHECK.
Referenced by main().
void CheckFlagsBasedOnTextures | ( | void | ) |
sets content flags based on textures
Definition at line 1558 of file check.c.
References brushsides, i, mapbrushes, nummapbrushes, mapbrush_s::numsides, mapbrush_s::original_sides, SetImpliedFlags(), and side_brushtextures.
Referenced by main().
void CheckLevelFlags | ( | void | ) |
sets all levelflags, if none are set.
Definition at line 1411 of file check.c.
References mapbrush_s::brushnum, Check_Printf(), Check_SurfProp(), side_s::contentFlags, CONTENTS_LEVEL_ALL, CONTENTS_ORIGIN, mapbrush_s::entitynum, i, mapbrushes, MASK_CLIP, nummapbrushes, mapbrush_s::numsides, mapbrush_s::original_sides, qfalse, qtrue, SURF_NODRAW, and VERB_CHECK.
Referenced by main().
void CheckMapMicro | ( | void | ) |
report brushes from the map below 1 unit^3
Definition at line 1315 of file check.c.
References mapbrush_s::brushnum, Check_MapBrushVolume(), Check_Printf(), config, mapbrush_s::entitynum, i, mapbrushes, nummapbrushes, qtrue, mapbrush_s::skipWriteBack, and VERB_CHECK.
Referenced by main().
void CheckMixedFaceContents | ( | void | ) |
contentflags should be the same on each face of a brush. print warnings if they are not. remove contentflags that are set on less than half of the faces. some content flags are transferred to all faces on parsing, ParseBrush().
Definition at line 1678 of file check.c.
References mapbrush_s::brushnum, brushsides, Check_Printf(), CheckPropagateParserContentFlags(), side_s::contentFlags, mapbrush_s::contentFlags, CONTENTS_ACTORCLIP, CONTENTS_ORIGIN, DisplayContentFlags(), mapbrush_s::entitynum, i, mapbrushes, brush_texture_s::name, NUM_SAME, nummapbrushes, mapbrush_s::numsides, mapbrush_s::original_sides, Q_strncpyz(), qfalse, qtrue, side_brushtextures, and VERB_CHECK.
Referenced by main().
void CheckNodraws | ( | void | ) |
check for faces which can safely be set to SURF_NODRAW because they are pressed against the faces of other brushes. Also set faces pointing near straight down nodraw.
Definition at line 999 of file check.c.
References side_s::brush, mapbrush_s::brushnum, CH_COMP_NDR_EDGE_INTSCT_BUF, CH_DIST_EPSILON_SQR, Check_EdgeEdgeIntersection(), Check_FindCompositeSides(), Check_IsOptimisable(), Check_IsPointInsideBrush(), Check_LevelForNodraws(), Check_Printf(), Check_SetNodraw(), Check_SideIsInBrush(), Check_SidePointsDown(), Check_SurfProp(), Com_Printf(), compositeSides, mapbrush_s::entitynum, FacingAndCoincidentTo(), i, m, mapbrushes, compositeSide_s::memberSides, mapbrush_s::nearBrushes, numCompositeSides, nummapbrushes, compositeSide_s::numMembers, mapbrush_s::numNear, winding_s::numpoints, mapbrush_s::numsides, mapbrush_s::original_sides, winding_s::p, PIB_INCL_SURF, side_s::planenum, qfalse, qtrue, SURF_LIGHT, SURF_NODRAW, side_s::surfaceFlags, VectorCopy, VectorDistSqr, VERB_CHECK, VERB_EXTRA, VERB_LESS, and side_s::winding.
Referenced by main().
void CheckPropagateParserContentFlags | ( | mapbrush_t * | b | ) |
some contentlflags are set as a result of some surface flag. For example, if one face is TRANS* then the brush is TRANSLUCENT. this is required by the .map parser as well as th check/fix code.
Definition at line 1649 of file check.c.
References mapbrush_s::brushnum, Check_Printf(), mapbrush_s::contentFlags, side_s::contentFlags, CONTENTS_DETAIL, CONTENTS_TRANSLUCENT, DisplayContentFlags(), mapbrush_s::entitynum, m, mapbrush_s::numsides, mapbrush_s::original_sides, qtrue, and VERB_CHECK.
Referenced by CheckMixedFaceContents(), and ParseBrush().
void CheckTexturesBasedOnFlags | ( | void | ) |
check that sides have textures and that where content/surface flags are set the texture is correct.
Definition at line 1583 of file check.c.
References mapbrush_s::brushnum, brushsides, Check_Printf(), side_s::contentFlags, CONTENTS_ACTORCLIP, CONTENTS_LIGHTCLIP, CONTENTS_ORIGIN, CONTENTS_WEAPONCLIP, mapbrush_s::entitynum, i, mapbrushes, brush_texture_s::name, nummapbrushes, mapbrush_s::numsides, mapbrush_s::original_sides, Q_strncpyz(), qfalse, qtrue, side_brushtextures, SURF_HINT, SURF_NODRAW, SURF_PHONG, side_s::surfaceFlags, brush_texture_s::surfaceFlags, and VERB_CHECK.
Referenced by main().
void CheckZFighting | ( | void | ) |
check all brushes for overlapping shared faces
Definition at line 854 of file check.c.
References mapbrush_s::brushnum, Check_IsOptimisable(), Check_NearList(), Check_Printf(), Check_SidePointsDown(), Check_SidesOverlap(), Check_SurfProp(), Com_Printf(), mapbrush_s::contentFlags, CONTENTS_LEVEL_ALL, mapbrush_s::entitynum, f, i, mapbrushes, mapbrush_s::nearBrushes, nummapbrushes, mapbrush_s::numNear, mapbrush_s::numsides, mapbrush_s::original_sides, ParallelAndCoincidentTo(), side_s::planenum, qfalse, SURF_NODRAW, and VERB_CHECK.
Referenced by main().
void DisplayContentFlags | ( | const int | flags | ) |
prints a list of the names of the set content flags or "no contentflags" if all bits are 0
Definition at line 1333 of file check.c.
References Check_Printf(), M, NUM_SAME, qfalse, and VERB_CHECK.
Referenced by CheckFillLevelFlags(), CheckMixedFaceContents(), and CheckPropagateParserContentFlags().
calculates whether side1 faces side2 and touches.
The surface unit normals must be antiparallel (i.e. they face each other), and the distance to the origin must be such that they occupy the same region of space, to within a distance of epsilon. These are based on consideration of the planes of the faces only - they could be offset by a long way.
Definition at line 104 of file check.c.
References CH_DIST_EPSILON, Check_PointPlaneDistance(), COS_EPSILON, DotProduct, mapplanes, plane_s::normal, side_s::planenum, plane_s::planeVector, and qfalse.
Referenced by CheckNodraws().
calculates whether side1 and side2 are on a common plane
normals must be parallel, planes must touch
Definition at line 129 of file check.c.
References CH_DIST_EPSILON, Check_PointPlaneDistance(), COS_EPSILON, DotProduct, mapplanes, plane_s::normal, side_s::planenum, plane_s::planeVector, and qfalse.
Referenced by Check_FindCompositeSides(), and CheckZFighting().
void SetImpliedFlags | ( | side_t * | side, | |
brush_texture_t * | tex, | |||
const mapbrush_t * | brush | |||
) |
Sets surface flags dependent on assigned texture.
Definition at line 1474 of file check.c.
References mapbrush_s::brushnum, Check_Printf(), Check_SurfProp(), config, side_s::contentFlags, CONTENTS_ACTORCLIP, CONTENTS_LADDER, CONTENTS_LIGHTCLIP, CONTENTS_ORIGIN, CONTENTS_PASSABLE, CONTENTS_WATER, CONTENTS_WEAPONCLIP, mapbrush_s::entitynum, brush_texture_s::name, qtrue, SURF_HINT, SURF_NODRAW, SURF_PHONG, SURF_SKIP, SURF_SLICK, SURF_WARP, side_s::surfaceFlags, brush_texture_s::surfaceFlags, and VERB_CHECK.
Referenced by CheckFlagsBasedOnTextures(), and ParseBrush().