Performs check on a loaded mapfile, and makes changes that can be saved back to the source map. More...
Go to the source code of this file.
Data Structures | |
struct | compositeSide_s |
Typedefs | |
typedef struct compositeSide_s | compositeSide_t |
Functions | |
void | CheckTexturesBasedOnFlags (void) |
check that sides have textures and that where content/surface flags are set the texture is correct. | |
void | CheckFlagsBasedOnTextures (void) |
sets content flags based on textures | |
void | CheckLevelFlags (void) |
sets all levelflags, if none are set. | |
void | CheckFillLevelFlags (void) |
ensures set levelflags are in one contiguous block | |
void | CheckBrushes (void) |
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. | |
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 | CheckMapMicro (void) |
report brushes from the map below 1 unit^3 | |
void | Check_BrushIntersection (void) |
reports intersection between optimisable map brushes | |
void | FixErrors (void) |
void | DisplayContentFlags (const int flags) |
prints a list of the names of the set content flags or "no contentflags" if all bits are 0 | |
void | SetImpliedFlags (side_t *side, brush_texture_t *tex, const mapbrush_t *brush) |
Sets surface flags dependent on assigned texture. | |
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 | Check_ContainedBrushes (void) |
find duplicated brushes and brushes contained inside brushes | |
void | CheckZFighting (void) |
check all brushes for overlapping shared faces | |
Variables | |
compositeSide_t | compositeSides [MAX_MAP_SIDES/2] |
int | numCompositeSides |
Performs check on a loaded mapfile, and makes changes that can be saved back to the source map.
Definition in file check.h.
typedef struct compositeSide_s compositeSide_t |
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().
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().
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().
void FixErrors | ( | void | ) |
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().
compositeSide_t compositeSides[MAX_MAP_SIDES/2] |
an array of composite mapbrush sides.
Definition at line 41 of file check.h.
Referenced by Check_FindCompositeSides(), Check_Free(), and CheckNodraws().
Definition at line 42 of file check.h.
Referenced by Check_FindCompositeSides(), Check_Free(), and CheckNodraws().