UFO: Alien Invasion
Loading...
Searching...
No Matches
bspfile.h File Reference
Include dependency graph for bspfile.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  epair_t
struct  entity_t

Functions

dMapTile_tLoadBSPFile (const char *filename)
long WriteBSPFile (const char *filename)
 Swaps the bsp file in place, so it should not be referenced again.
void PrintBSPFileSizes (void)
 Dumps info about current file.
entity_tFindTargetEntity (const char *target)
 Searches the entities array for an entity with the parameter targetname that matches the searched target parameter.
void ParseEntities (void)
 Parses the curTile->entdata string into entities.
const char * UnparseEntities (void)
 Generates the curTile->entdata string from all the entities.
void SetKeyValue (entity_t *ent, const char *key, const char *value)
const char * ValueForKey (const entity_t *ent, const char *key)
vec_t FloatForKey (const entity_t *ent, const char *key)
void GetVectorFromString (const char *value, vec3_t vec)
 Converts a string into a vec3_t.
void GetVectorForKey (const entity_t *ent, const char *key, vec3_t vec)
 Converts the value of a entity parameter into a vec3_t.
epair_tParseEpair (int entNum)
 Parses one key and value for an entity from the current tokens.
bool EpairCheckForDuplicate (const entity_t *ent, const epair_t *e)
epair_tAddEpair (const char *key, const char *value, int entNum)
byteCompressRouting (byte *dataStart, byte *destStart, int l)
 Compress the routing data of a map.

Variables

int num_entities
entity_t entities [MAX_MAP_ENTITIES]

Function Documentation

◆ AddEpair()

epair_t * AddEpair ( const char * key,
const char * value,
int entNum )

◆ CompressRouting()

byte * CompressRouting ( byte * dataStart,
byte * destStart,
int l )

Compress the routing data of a map.

See also
CMod_DeCompressRouting
CMod_LoadRouting

Definition at line 37 of file bspfile.cpp.

References data.

Referenced by DoRouting().

◆ EpairCheckForDuplicate()

bool EpairCheckForDuplicate ( const entity_t * ent,
const epair_t * e )

Definition at line 418 of file bspfile.cpp.

References entity_t::epairs, epair_t::key, epair_t::next, and Q_streq.

Referenced by ParseMapEntity().

◆ FindTargetEntity()

entity_t * FindTargetEntity ( const char * target)

Searches the entities array for an entity with the parameter targetname that matches the searched target parameter.

Parameters
[in]targetThe targetname value that the entity should have that we are looking for

Definition at line 911 of file map.cpp.

References entities, i, num_entities, Q_streq, and ValueForKey().

Referenced by BuildLights().

◆ FloatForKey()

vec_t FloatForKey ( const entity_t * ent,
const char * key )

Definition at line 566 of file bspfile.cpp.

References key, and ValueForKey().

Referenced by BuildLights().

◆ GetVectorForKey()

void GetVectorForKey ( const entity_t * ent,
const char * key,
vec3_t vec )

Converts the value of a entity parameter into a vec3_t.

Definition at line 592 of file bspfile.cpp.

References GetVectorFromString(), key, and ValueForKey().

Referenced by BuildLights(), BuildPatches(), and ParseMapEntity().

◆ GetVectorFromString()

void GetVectorFromString ( const char * value,
vec3_t vec )

Converts a string into a vec3_t.

Definition at line 575 of file bspfile.cpp.

References Sys_Error(), VectorClear, and VectorSet.

Referenced by BuildLights(), and GetVectorForKey().

◆ LoadBSPFile()

◆ ParseEntities()

void ParseEntities ( void )

Parses the curTile->entdata string into entities.

See also
UnparseEntities
ParseEntity

Definition at line 502 of file bspfile.cpp.

References curTile, num_entities, ParseEntity(), and ParseFromMemory().

Referenced by PrintBSPFileSizes().

◆ ParseEpair()

epair_t * ParseEpair ( int entNum)

Parses one key and value for an entity from the current tokens.

See also
parsedToken
GetToken
ParseEntity
ParseMapEntity

Definition at line 453 of file bspfile.cpp.

References AddEpair(), GetToken(), key, Mem_StrDup, parsedToken, and StripTrailingWhitespaces().

Referenced by ParseEntity(), and ParseMapEntity().

◆ PrintBSPFileSizes()

void PrintBSPFileSizes ( void )

Dumps info about current file.

Definition at line 364 of file bspfile.cpp.

References Com_Printf(), curTile, num_entities, and ParseEntities().

Referenced by main().

◆ SetKeyValue()

void SetKeyValue ( entity_t * ent,
const char * key,
const char * value )

Definition at line 546 of file bspfile.cpp.

References AddEpair(), entity_t::epairs, key, Mem_StrDup, epair_t::next, and Q_streq.

Referenced by CheckEntities(), ParseBrush(), and SetModelNumbers().

◆ UnparseEntities()

const char * UnparseEntities ( void )

Generates the curTile->entdata string from all the entities.

See also
ParseEntities

Definition at line 515 of file bspfile.cpp.

References curTile, entities, i, IsInvalidEntityToken(), epair_t::key, key, epair_t::next, num_entities, Q_strcat(), Q_strncpyz(), StripTrailingWhitespaces(), Sys_Error(), and epair_t::value.

Referenced by EndBSPFile(), and main().

◆ ValueForKey()

◆ WriteBSPFile()

Variable Documentation

◆ entities

◆ num_entities