UFO: Alien Invasion
Loading...
Searching...
No Matches
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"
Include dependency graph for checkentities.cpp:

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
static bool Check_IsInfoStart (const char *classname)
 see if the entity is am actor start point
static bool Check_InfoStartAligned (const entityDef_t *ed, const entity_t *e)
 check alignment using abstract size and mandatory origin
static bool Check_TargetExists (const epair_t *kvp)
 check targets exist (targetname), and check targetnames are targetted (target)
static void Check_EntityWithBrushes (entity_t *e, const char *classname, int entnum)
void CheckEntities (void)
 Perform an entity check.
void Check_Stats (void)
 print map stats on -stats

Variables

static int numToMoveToWorldspawn = 0

Macro Definition Documentation

◆ MIN_TILE_SIZE

#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

◆ Check_EntityWithBrushes()

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

◆ Check_ExtraBrushesForWorldspawn()

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

◆ Check_InfoStartAligned()

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

◆ Check_IsInfoStart()

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

◆ Check_MapSize()

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(), AABB::getDiagonal(), i, mapbrushes, nummapbrushes, winding_t::numpoints, mapbrush_t::numsides, mapbrush_t::original_sides, winding_t::p, and AABB::setNegativeVolume().

Referenced by Check_Stats().

◆ Check_Stats()

◆ Check_TargetExists()

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_t::key, num_entities, Q_streq, epair_t::value, and ValueForKey().

Referenced by CheckEntities().

◆ CheckEntities()

Variable Documentation

◆ numToMoveToWorldspawn

int numToMoveToWorldspawn = 0
static

Definition at line 36 of file checkentities.cpp.

Referenced by Check_EntityWithBrushes(), and Check_ExtraBrushesForWorldspawn().