UFO: Alien Invasion
|
Performs check on a loaded mapfile, and makes changes that can be saved back to the source map. More...
#include "../map.h"
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. More... | |
void | CheckFlagsBasedOnTextures (void) |
sets content flags based on textures More... | |
void | CheckLevelFlags (void) |
sets all levelflags, if none are set. More... | |
void | CheckFillLevelFlags (void) |
ensures set levelflags are in one contiguous block More... | |
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. More... | |
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(). More... | |
void | CheckMapMicro (void) |
report brushes from the map below 1 unit^3 More... | |
void | Check_BrushIntersection (void) |
reports intersection between optimisable map brushes More... | |
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 More... | |
void | SetImpliedFlags (side_t *side, brush_texture_t *tex, const mapbrush_t *brush) |
Sets surface flags dependent on assigned texture. More... | |
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. More... | |
void | Check_ContainedBrushes (void) |
find duplicated brushes and brushes contained inside brushes More... | |
void | CheckZFighting (void) |
check all brushes for overlapping shared faces More... | |
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 |
reports intersection between optimisable map brushes
Definition at line 589 of file check.cpp.
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, VERB_CHECK, and side_s::winding.
Referenced by main().
find duplicated brushes and brushes contained inside brushes
Definition at line 912 of file check.cpp.
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, and VERB_CHECK.
Referenced by main().
Definition at line 1708 of file check.cpp.
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, and VERB_CHECK.
Referenced by main().
ensures set levelflags are in one contiguous block
Definition at line 1364 of file check.cpp.
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, and VERB_CHECK.
Referenced by main().
sets content flags based on textures
Definition at line 1532 of file check.cpp.
References brushsides, i, index, mapbrushes, nummapbrushes, mapbrush_s::numsides, mapbrush_s::original_sides, SetImpliedFlags(), and side_brushtextures.
Referenced by main().
sets all levelflags, if none are set.
Definition at line 1385 of file check.cpp.
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, SURF_NODRAW, and VERB_CHECK.
Referenced by main().
report brushes from the map below 1 unit^3
Definition at line 1293 of file check.cpp.
References mapbrush_s::brushnum, Check_MapBrushVolume(), Check_Printf(), config, mapbrush_s::entitynum, i, mapbrushes, nummapbrushes, mapbrush_s::skipWriteBack, and VERB_CHECK.
Referenced by main().
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 1647 of file check.cpp.
References mapbrush_s::brushnum, brushsides, Check_Printf(), CheckPropagateParserContentFlags(), side_s::contentFlags, mapbrush_s::contentFlags, CONTENTS_ACTORCLIP, CONTENTS_ORIGIN, DisplayContentFlags(), mapbrush_s::entitynum, i, index, mapbrushes, brush_texture_s::name, NUM_SAME, nummapbrushes, mapbrush_s::numsides, mapbrush_s::original_sides, Q_streq, Q_strncpyz(), side_brushtextures, and VERB_CHECK.
Referenced by main().
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 984 of file check.cpp.
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(), 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, OBJZERO, mapbrush_s::original_sides, winding_s::p, PIB_INCL_SURF, side_s::planenum, 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 1619 of file check.cpp.
References mapbrush_s::brushnum, Check_Printf(), side_s::contentFlags, mapbrush_s::contentFlags, CONTENTS_DETAIL, CONTENTS_TRANSLUCENT, DisplayContentFlags(), mapbrush_s::entitynum, m, mapbrush_s::numsides, mapbrush_s::original_sides, and VERB_CHECK.
Referenced by CheckMixedFaceContents(), and ParseBrush().
check that sides have textures and that where content/surface flags are set the texture is correct.
Definition at line 1555 of file check.cpp.
References mapbrush_s::brushnum, brushsides, Check_Printf(), side_s::contentFlags, CONTENTS_ACTORCLIP, CONTENTS_LIGHTCLIP, CONTENTS_ORIGIN, CONTENTS_WEAPONCLIP, mapbrush_s::entitynum, i, index, mapbrushes, brush_texture_s::name, nummapbrushes, mapbrush_s::numsides, mapbrush_s::original_sides, Q_streq, Q_strncpyz(), side_brushtextures, SURF_HINT, SURF_NODRAW, SURF_PHONG, brush_texture_s::surfaceFlags, side_s::surfaceFlags, and VERB_CHECK.
Referenced by main().
check all brushes for overlapping shared faces
Definition at line 843 of file check.cpp.
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, SURF_NODRAW, and VERB_CHECK.
Referenced by main().
prints a list of the names of the set content flags or "no contentflags" if all bits are 0
Definition at line 1309 of file check.cpp.
References Check_Printf(), M, NUM_SAME, and VERB_CHECK.
Referenced by CheckFillLevelFlags(), CheckMixedFaceContents(), and CheckPropagateParserContentFlags().
void SetImpliedFlags | ( | side_t * | side, |
brush_texture_t * | tex, | ||
const mapbrush_t * | brush | ||
) |
Sets surface flags dependent on assigned texture.
Definition at line 1448 of file check.cpp.
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, Q_streq, SURF_HINT, SURF_NODRAW, SURF_PHONG, SURF_SKIP, SURF_SLICK, SURF_WARP, brush_texture_s::surfaceFlags, side_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 37 of file check.cpp.
Referenced by Check_Free().
int numCompositeSides |
Definition at line 38 of file check.cpp.
Referenced by Check_FindCompositeSides(), Check_Free(), and CheckNodraws().