check.h File Reference

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

This graph shows which files directly or indirectly include this file:

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

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.


Typedef Documentation


Function Documentation

void Check_BrushIntersection ( void   ) 
void Check_ContainedBrushes ( void   ) 
void CheckBrushes ( void   ) 
void CheckFillLevelFlags ( void   ) 
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   ) 
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().

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

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

See also:
ParseBrush

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   ) 
void CheckZFighting ( 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

See also:
defines.h

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.

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


Variable Documentation

compositeSide_t compositeSides[MAX_MAP_SIDES/2]

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


Generated by  doxygen 1.6.2