UFO: Alien Invasion
Loading...
Searching...
No Matches
check.h File Reference

Performs check on a loaded mapfile, and makes changes that can be saved back to the source map. More...

#include "../map.h"
Include dependency graph for check.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  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

Detailed Description

Performs check on a loaded mapfile, and makes changes that can be saved back to the source map.

Definition in file check.h.

Function Documentation

◆ Check_BrushIntersection()

◆ Check_ContainedBrushes()

◆ CheckBrushes()

◆ CheckFillLevelFlags()

void CheckFillLevelFlags ( void )

◆ CheckFlagsBasedOnTextures()

void CheckFlagsBasedOnTextures ( void )

sets content flags based on textures

Definition at line 1532 of file check.cpp.

References brushsides, i, index, mapbrushes, nummapbrushes, mapbrush_t::numsides, mapbrush_t::original_sides, SetImpliedFlags(), and side_brushtextures.

Referenced by main().

◆ CheckLevelFlags()

◆ CheckMapMicro()

void CheckMapMicro ( void )

report brushes from the map below 1 unit^3

Definition at line 1293 of file check.cpp.

References mapbrush_t::brushnum, Check_MapBrushVolume(), Check_Printf(), config, mapbrush_t::entitynum, i, mapbrushes, nummapbrushes, mapbrush_t::skipWriteBack, and VERB_CHECK.

Referenced by main().

◆ CheckMixedFaceContents()

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().

Todo
at the moment only actorclip is removed if only set on less than half of the faces. there may be other contentflags that would benefit from this treatment
See also
ParseBrush

Definition at line 1647 of file check.cpp.

References mapbrush_t::brushnum, brushsides, Check_Printf(), CheckPropagateParserContentFlags(), mapbrush_t::contentFlags, side_t::contentFlags, CONTENTS_ACTORCLIP, CONTENTS_ORIGIN, DisplayContentFlags(), mapbrush_t::entitynum, i, index, mapbrushes, brush_texture_t::name, NUM_SAME, nummapbrushes, mapbrush_t::numsides, mapbrush_t::original_sides, Q_streq, Q_strncpyz(), side_brushtextures, and VERB_CHECK.

Referenced by main().

◆ CheckNodraws()

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.

Note
probably cannot warn about faces which are nodraw, but might be visible, as there will always be planty of optimisations beyond faces being hidden by one brush, or composite faces.

Definition at line 984 of file check.cpp.

References mapbrush_t::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_t::entitynum, FacingAndCoincidentTo(), i, m, mapbrushes, compositeSide_t::memberSides, mapbrush_t::nearBrushes, numCompositeSides, nummapbrushes, compositeSide_t::numMembers, mapbrush_t::numNear, winding_t::numpoints, mapbrush_t::numsides, OBJZERO, mapbrush_t::original_sides, winding_t::p, PIB_INCL_SURF, side_t::planenum, SURF_LIGHT, SURF_NODRAW, side_t::surfaceFlags, VectorCopy, VectorDistSqr, VERB_CHECK, VERB_EXTRA, VERB_LESS, and side_t::winding.

Referenced by main().

◆ CheckPropagateParserContentFlags()

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.

See also
ParseBrush

Definition at line 1619 of file check.cpp.

References mapbrush_t::brushnum, Check_Printf(), mapbrush_t::contentFlags, CONTENTS_DETAIL, CONTENTS_TRANSLUCENT, DisplayContentFlags(), mapbrush_t::entitynum, m, mapbrush_t::numsides, mapbrush_t::original_sides, and VERB_CHECK.

Referenced by CheckMixedFaceContents(), and ParseBrush().

◆ CheckTexturesBasedOnFlags()

◆ CheckZFighting()

◆ DisplayContentFlags()

void DisplayContentFlags ( const int flags)

prints a list of the names of the set content flags or "no contentflags" if all bits are 0

See also
defines.h

Definition at line 1309 of file check.cpp.

References Check_Printf(), M, NUM_SAME, and VERB_CHECK.

Referenced by CheckFillLevelFlags(), CheckMixedFaceContents(), and CheckPropagateParserContentFlags().

◆ FixErrors()

void FixErrors ( void )

◆ SetImpliedFlags()

void SetImpliedFlags ( side_t * side,
brush_texture_t * tex,
const mapbrush_t * brush )

Sets surface flags dependent on assigned texture.

See also
ParseBrush
CheckFlags
Note
surfaceFlags are set in side_t for map compiling and in brush_texture_t because this is saved back on -fix.
also removes phongs from nodraws. also removes legacy flags.

Definition at line 1448 of file check.cpp.

References mapbrush_t::brushnum, Check_Printf(), Check_SurfProp(), config, side_t::contentFlags, CONTENTS_ACTORCLIP, CONTENTS_LADDER, CONTENTS_LIGHTCLIP, CONTENTS_ORIGIN, CONTENTS_PASSABLE, CONTENTS_WATER, CONTENTS_WEAPONCLIP, mapbrush_t::entitynum, brush_texture_t::name, Q_streq, SURF_HINT, SURF_NODRAW, SURF_PHONG, SURF_SKIP, SURF_SLICK, SURF_WARP, brush_texture_t::surfaceFlags, side_t::surfaceFlags, and VERB_CHECK.

Referenced by CheckFlagsBasedOnTextures(), and ParseBrush().

Variable Documentation

◆ compositeSides

compositeSide_t compositeSides[MAX_MAP_SIDES/2]
extern

an array of composite mapbrush sides.

See also
Check_FindCompositeSides ensures the array is populated
Note
a composite must have at least 2 members. composites should not be duplicated, hence the largest possible number is the number of sides divided by two.

Definition at line 37 of file check.cpp.

Referenced by Check_FindCompositeSides(), Check_Free(), and CheckNodraws().

◆ numCompositeSides

int numCompositeSides
extern

Definition at line 38 of file check.cpp.

Referenced by Check_FindCompositeSides(), Check_Free(), and CheckNodraws().