checkentities.c File Reference

#include "../map.h"
#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.c:

Go to the source code of this file.

Defines

#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 qboolean Check_IsInfoStart (const char *classname)
 see if the entity is am actor start point
static qboolean Check_InfoStartAligned (const entityDef_t *ed, const entity_t *e)
 check alignment using abstract size and mandatory origin
static qboolean 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

Detailed Description

Definition in file checkentities.c.


Define Documentation

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

Definition at line 35 of file checkentities.c.

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] numBrushes the number of brushes

Definition at line 259 of file checkentities.c.

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

Referenced by WriteMapFile().

static qboolean Check_InfoStartAligned ( const entityDef_t ed,
const entity_t e 
) [static]

check alignment using abstract size and mandatory origin

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

Definition at line 59 of file checkentities.c.

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

Referenced by CheckEntities().

static qboolean Check_IsInfoStart ( const char *  classname  )  [static]

see if the entity is am actor start point

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

Definition at line 48 of file checkentities.c.

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] mapSize the returned size in map units

Definition at line 231 of file checkentities.c.

References AddPointToBounds(), side_s::brush, i, mapbrushes, nummapbrushes, winding_s::numpoints, mapbrush_s::numsides, mapbrush_s::original_sides, winding_s::p, VectorSet, VectorSubtract, and side_s::winding.

Referenced by Check_Stats().

void Check_Stats ( void   ) 
static qboolean Check_TargetExists ( const epair_t kvp  )  [static]

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

Returns:
qfalse if there is a problem.

Definition at line 74 of file checkentities.c.

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

Referenced by CheckEntities().

void CheckEntities ( void   ) 

Variable Documentation

int numToMoveToWorldspawn = 0 [static]

Definition at line 37 of file checkentities.c.

Referenced by Check_EntityWithBrushes(), and Check_ExtraBrushesForWorldspawn().


Generated by  doxygen 1.6.2