UFO: Alien Invasion
Loading...
Searching...
No Matches
bspfile.h
Go to the documentation of this file.
1
4
5/*
6Copyright (C) 1997-2001 Id Software, Inc.
7
8This program is free software; you can redistribute it and/or
9modify it under the terms of the GNU General Public License
10as published by the Free Software Foundation; either version 2
11of the License, or (at your option) any later version.
12
13This program is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16
17See the GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License
20along with this program; if not, write to the Free Software
21Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22
23*/
24
25#pragma once
26
28
29dMapTile_t* LoadBSPFile(const char* filename);
30long WriteBSPFile(const char* filename);
31void PrintBSPFileSizes(void);
32
36typedef struct epair_s {
37 struct epair_s* next;
38 const char* key;
39 const char* value;
40 bool ump;
41} epair_t;
42
46typedef struct {
51 bool skip;
53} entity_t;
54
55extern int num_entities;
57
58entity_t* FindTargetEntity(const char* target);
59void ParseEntities(void);
60const char* UnparseEntities(void);
61
62void SetKeyValue(entity_t* ent, const char* key, const char* value);
63/* will return "" if not present */
64const char* ValueForKey(const entity_t* ent, const char* key);
65
66vec_t FloatForKey(const entity_t* ent, const char* key);
67void GetVectorFromString(const char* value, vec3_t vec);
68void GetVectorForKey(const entity_t* ent, const char* key, vec3_t vec);
69epair_t* ParseEpair(int entNum);
70bool EpairCheckForDuplicate(const entity_t* ent, const epair_t *e);
71epair_t* AddEpair(const char* key, const char* value, int entNum);
72byte* CompressRouting(byte* dataStart, byte* destStart, int l);
int num_entities
Definition bspfile.cpp:394
entity_t entities[MAX_MAP_ENTITIES]
Definition bspfile.cpp:395
void GetVectorFromString(const char *value, vec3_t vec)
Converts a string into a vec3_t.
Definition bspfile.cpp:575
const char * UnparseEntities(void)
Generates the curTile->entdata string from all the entities.
Definition bspfile.cpp:515
void ParseEntities(void)
Parses the curTile->entdata string into entities.
Definition bspfile.cpp:502
entity_t * FindTargetEntity(const char *target)
Searches the entities array for an entity with the parameter targetname that matches the searched tar...
Definition map.cpp:911
void GetVectorForKey(const entity_t *ent, const char *key, vec3_t vec)
Converts the value of a entity parameter into a vec3_t.
Definition bspfile.cpp:592
vec_t FloatForKey(const entity_t *ent, const char *key)
Definition bspfile.cpp:566
void SetKeyValue(entity_t *ent, const char *key, const char *value)
Definition bspfile.cpp:546
void PrintBSPFileSizes(void)
Dumps info about current file.
Definition bspfile.cpp:364
long WriteBSPFile(const char *filename)
Swaps the bsp file in place, so it should not be referenced again.
Definition bspfile.cpp:316
bool EpairCheckForDuplicate(const entity_t *ent, const epair_t *e)
Definition bspfile.cpp:418
epair_t * AddEpair(const char *key, const char *value, int entNum)
Definition bspfile.cpp:428
dMapTile_t * LoadBSPFile(const char *filename)
Definition bspfile.cpp:231
epair_t * ParseEpair(int entNum)
Parses one key and value for an entity from the current tokens.
Definition bspfile.cpp:453
const char * ValueForKey(const entity_t *ent, const char *key)
Definition bspfile.cpp:558
byte * CompressRouting(byte *dataStart, byte *destStart, int l)
Compress the routing data of a map.
Definition bspfile.cpp:37
unsigned int key
Definition cl_input.cpp:64
#define MAX_MAP_ENTITIES
Definition defines.h:136
voidpf uLong int origin
Definition ioapi.h:45
const char * filename
Definition ioapi.h:41
Header for various formats like pak, and model formats as well as bsp format.
epair_t * epairs
Definition bspfile.h:50
int numbrushes
Definition bspfile.h:49
int firstbrush
Definition bspfile.h:48
bool skip
Definition bspfile.h:51
const char * key
Definition bspfile.h:38
struct epair_s * next
Definition bspfile.h:37
bool ump
Definition bspfile.h:40
const char * value
Definition bspfile.h:39
float vec_t
Definition ufotypes.h:37
vec_t vec3_t[3]
Definition ufotypes.h:39