41 byte*
data, *dend, *dest_p;
55 while (
data + 1 < dend && val == *(
data)) {
62 *dest_p++ = (
byte)(c) | 0x80;
99 for (j = 0; j < 3; j++) {
109 for (j = 0; j < 3; j++)
116 for (j = 0; j < 3; j++)
125 for (j = 0; j < 2; j++)
126 for (
int k = 0; k < 4; k++)
149 for (j = 0; j < 3; j++) {
164 for (j = 0; j < 3; j++) {
205 for (
i = 0;
i <
curTile->numbrushsides;
i++) {
216 const uint32_t ofs = lump->
fileofs;
223 memcpy(
dest, (
const byte*)header + ofs,
length);
274 for (
int i = 0;
i <
curTile->numbrushes;
i++) {
300 lump = &header->
lumps[lumpnum];
304 Sys_Error(
"Overflow in AddLump for lump %i (%s) %s", lumpnum, bspfile->
name, strerror(errno));
332 FS_Write(&outheader,
sizeof(outheader), &bspfile);
354 FS_Write(&outheader,
sizeof(outheader), &bspfile);
370 Com_Printf(
"================================\n");
406 s = str + strlen(str) - 1;
407 while (s >= str && *s <=
' ') {
433 Sys_Error(
"Invalid entity %i found with key '%s' and value '%s'", entNum,
key, value);
484 Sys_Error(
"ParseEntity: EOF without closing brace");
536 Sys_Error(
"Invalid entity %i found with key '%s' and value '%s'",
i,
key, value);
577 if (value[0] !=
'\0') {
582 if (sscanf(value,
"%lf %lf %lf", &v1, &v2, &v3) != 3)
583 Sys_Error(
"invalid vector statement given: '%s'", value);
void GetVectorFromString(const char *value, vec3_t vec)
Converts a string into a vec3_t.
const char * UnparseEntities(void)
Generates the curTile->entdata string from all the entities.
void ParseEntities(void)
Parses the curTile->entdata string into entities.
void GetVectorForKey(const entity_t *ent, const char *key, vec3_t vec)
Converts the value of a entity parameter into a vec3_t.
vec_t FloatForKey(const entity_t *ent, const char *key)
void SetKeyValue(entity_t *ent, const char *key, const char *value)
static uint32_t CopyLump(const dBspHeader_t *header, int lumpIdx, void *dest, size_t size)
entity_t entities[MAX_MAP_ENTITIES]
static entity_t * ParseEntity(void)
void PrintBSPFileSizes(void)
Dumps info about current file.
static bool IsInvalidEntityToken(const char *token)
long WriteBSPFile(const char *filename)
Swaps the bsp file in place, so it should not be referenced again.
bool EpairCheckForDuplicate(const entity_t *ent, const epair_t *e)
epair_t * AddEpair(const char *key, const char *value, int entNum)
static void AddLump(qFILE *bspfile, dBspHeader_t *header, int lumpnum, void *data, int len)
dMapTile_t * LoadBSPFile(const char *filename)
static void SwapBSPFile(void)
Byte swaps all data in a bsp file.
static void StripTrailingWhitespaces(char *str)
Removes trailing whitespaces from the given string.
epair_t * ParseEpair(int entNum)
Parses one key and value for an entity from the current tokens.
const char * ValueForKey(const entity_t *ent, const char *key)
byte * CompressRouting(byte *dataStart, byte *destStart, int l)
Compress the routing data of a map.
void Com_Printf(const char *const fmt,...)
#define LUMP_LIGHTING_NIGHT
#define LUMP_LIGHTING_DAY
int FS_Write(const void *buffer, int len, qFILE *f)
Properly handles partial writes.
int FS_LoadFile(const char *path, byte **buffer)
Filenames are relative to the quake search path.
void FS_FreeFile(void *buffer)
int FS_OpenFile(const char *filename, qFILE *file, filemode_t mode)
Finds and opens the file in the search path.
void Sys_Error(const char *error,...)
#define Mem_AllocType(type)
#define BSP_SwapHeader(header, name)
QGL_EXTERN GLuint GLchar GLuint * len
QGL_EXTERN GLenum GLuint * dest
QGL_EXTERN GLsizei const GLvoid * data
QGL_EXTERN GLuint GLsizei GLsizei * length
void ParseFromMemory(char *buffer, int size)
Parses e.g. the entity string that is already stored in memory.
char parsedToken[MAX_TOKEN_CHARS]
const char * GetToken()
Parses the next token from the current script on the stack and store the result in parsedToken.
bool Q_strnull(const char *string)
void Q_strncpyz(char *dest, const char *src, size_t destsize)
Safe strncpy that ensures a trailing zero.
void Q_strcat(char *dest, size_t destsize, const char *format,...)
Safely (without overflowing the destination buffer) concatenates two strings.
uint32_t brushContentFlags
uint32_t brushContentFlags
convex region of space in the BSP tree
int lightofs[LIGHTMAP_MAX]
Directory of the different data blocks.
static mapTiles_t mapTiles
#define VectorSet(v, x, y, z)