bspfile.h File Reference

#include "../../../common/qfiles.h"
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_s
struct  entity_t

Typedefs

typedef struct epair_s epair_t

Functions

void LoadBSPFile (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 (void)
 Parses one key and value for an entity from the current tokens.
byteCompressRouting (byte *dataStart, byte *destStart, int l)
 Compress the routing data of a map.

Variables

int num_entities
entity_t entities [MAX_MAP_ENTITIES]

Detailed Description

Definition in file bspfile.h.


Typedef Documentation

typedef struct epair_s epair_t
See also:
entity_t

Function Documentation

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

Compress the routing data of a map.

See also:
CMod_DeCompressRouting
CMod_LoadRouting

Definition at line 36 of file bspfile.c.

References byte, and data.

Referenced by DoRouting().

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] target The targetname value that the entity should have that we are looking for

Definition at line 927 of file map.c.

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

Referenced by BuildLights().

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

Definition at line 545 of file bspfile.c.

References ValueForKey().

Referenced by BuildLights().

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 574 of file bspfile.c.

References GetVectorFromString(), and ValueForKey().

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

void GetVectorFromString ( const char *  value,
vec3_t  vec 
)

Converts a string into a vec3_t.

Definition at line 556 of file bspfile.c.

References VectorClear.

Referenced by BuildLights(), and GetVectorForKey().

void LoadBSPFile ( const char *  filename  ) 
void ParseEntities ( void   ) 

Parses the curTile->entdata string into entities.

See also:
UnparseEntities
ParseEntity

Definition at line 466 of file bspfile.c.

References config, curTile, dMapTile_t::entdata, dMapTile_t::entdatasize, num_entities, ParseEntity(), ParseFromMemory(), ValueForKey(), VERB_EXTRA, and Verb_Printf().

Referenced by PrintBSPFileSizes().

epair_t* ParseEpair ( void   ) 

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

See also:
parsedToken
GetToken
ParseEntity
ParseMapEntity

Definition at line 405 of file bspfile.c.

References GetToken(), epair_s::key, MAX_KEY, MAX_VALUE, Mem_Alloc, Mem_StrDup, parsedToken, qfalse, StripTrailingWhitespaces(), Sys_Error(), and epair_s::value.

Referenced by ParseEntity(), and ParseMapEntity().

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

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

See also:
ParseEntities

Definition at line 488 of file bspfile.c.

References Com_sprintf(), curTile, dMapTile_t::entdata, dMapTile_t::entdatasize, entity_t::epairs, i, epair_s::key, key, epair_s::next, num_entities, Q_strcat(), Q_strncpyz(), StripTrailingWhitespaces(), and epair_s::value.

Referenced by EndBSPFile(), and main().

const char* ValueForKey ( const entity_t ent,
const char *  key 
)
long WriteBSPFile ( const char *  filename  ) 

Variable Documentation

entity_t entities[MAX_MAP_ENTITIES]

Generated by  doxygen 1.6.2