UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
checkentities.cpp File Reference
#include "checkentities.h"
#include "../../../shared/mathlib.h"
#include "../../../shared/entitiesdef.h"
#include "../common/shared.h"
#include "../bsp.h"
#include "checklib.h"

Go to the source code of this file.

Macros

#define MIN_TILE_SIZE   256
 

Functions

static void Check_MapSize (vec3_t mapSize)
 
mapbrush_t ** Check_ExtraBrushesForWorldspawn (int *numBrushes)
 single brushes in func_groups are moved to worldspawn. this function allocates space for pointers to those brushes. called when the .map is written back in map.c More...
 
static bool Check_IsInfoStart (const char *classname)
 see if the entity is am actor start point More...
 
static bool Check_InfoStartAligned (const entityDef_t *ed, const entity_t *e)
 check alignment using abstract size and mandatory origin More...
 
static bool Check_TargetExists (const epair_t *kvp)
 check targets exist (targetname), and check targetnames are targetted (target) More...
 
static void Check_EntityWithBrushes (entity_t *e, const char *classname, int entnum)
 
void CheckEntities (void)
 Perform an entity check. More...
 
void Check_Stats (void)
 print map stats on -stats More...
 

Variables

static int numToMoveToWorldspawn = 0
 

Macro Definition Documentation

#define MIN_TILE_SIZE   256
Todo:
take this datum from the correct place

Definition at line 34 of file checkentities.cpp.

Referenced by Check_Stats().

Function Documentation

static void Check_EntityWithBrushes ( entity_t e,
const char *  classname,
int  entnum 
)
static
mapbrush_t ** Check_ExtraBrushesForWorldspawn ( int numBrushes)

single brushes in func_groups are moved to worldspawn. this function allocates space for pointers to those brushes. called when the .map is written back in map.c

Returns
a pointer to the array of pointers to brushes to be included in worldspawn.
Parameters
[out]numBrushesthe number of brushes

Definition at line 251 of file checkentities.cpp.

References entities, entity_t::firstbrush, i, mapbrushes, Mem_AllocTypeN, name, num_entities, entity_t::numbrushes, numToMoveToWorldspawn, Q_streq, Sys_Error(), and ValueForKey().

Referenced by WriteMapFile().

static bool Check_InfoStartAligned ( const entityDef_t ed,
const entity_t e 
)
static

check alignment using abstract size and mandatory origin

Returns
true if OK
Todo:
check for brush intersection as well as alignment, and move to a good position if bad.

Definition at line 58 of file checkentities.cpp.

References ED_ERROR, ED_GetIntVector(), ED_GetKeyDefEntity(), ED_GetLastError(), int(), entity_t::origin, Sys_Error(), and UNIT_SIZE.

Referenced by CheckEntities().

static bool Check_IsInfoStart ( const char *  classname)
static

see if the entity is am actor start point

Note
starts with "info_" and contains "_start"
Returns
true if this is a start point

Definition at line 47 of file checkentities.cpp.

References Q_strstart().

Referenced by CheckEntities().

static void Check_MapSize ( vec3_t  mapSize)
static

needs to be done here, on map brushes as worldMins and worldMaxs from levels.c are only calculated on BSPing

Parameters
[out]mapSizethe returned size in map units

Definition at line 226 of file checkentities.cpp.

References AABB::add(), side_s::brush, AABB::getDiagonal(), i, mapbrushes, nummapbrushes, winding_s::numpoints, mapbrush_s::numsides, mapbrush_s::original_sides, winding_s::p, AABB::setNegativeVolume(), and side_s::winding.

Referenced by Check_Stats().

static bool Check_TargetExists ( const epair_t kvp)
static

check targets exist (targetname), and check targetnames are targetted (target)

Returns
false if there is a problem.

Definition at line 73 of file checkentities.cpp.

References entities, i, epair_s::key, num_entities, Q_streq, epair_s::value, and ValueForKey().

Referenced by CheckEntities().

Variable Documentation

int numToMoveToWorldspawn = 0
static

Definition at line 36 of file checkentities.cpp.

Referenced by Check_EntityWithBrushes(), and Check_ExtraBrushesForWorldspawn().