-
Notifications
You must be signed in to change notification settings - Fork 1
/
bsp.h
32 lines (24 loc) · 752 Bytes
/
bsp.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef BSP_H_
#define BSP_H_
// This is only a partial decoding of a BSP file.
// Since we only care about the ENTITY and TEXTURE lumps,
// all others are just stored as blocks of data.
#include <stddef.h>
struct s_bsp
{
// entity lump is a large multi-line ASCII string,
// zero-terminated
size_t entity_lump_size;
char *entity_lump;
// texture lump is a series of texture structs
unsigned int texture_count;
struct s_texture **textures;
// other lumps are copied wholesale
size_t raw_lump_size[15];
unsigned char * raw_lump[15];
// order of lumps - helps minimize change when writing
unsigned int lump_order[15];
};
struct s_bsp * read_bsp(const char * path);
void write_bsp(const struct s_bsp* bsp, const char* path);
#endif