-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbsp.h
126 lines (90 loc) · 3.01 KB
/
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
/*- BSP.H ------------------------------------------------------------------*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <ctype.h>
#include <math.h>
#include <limits.h>
#include <assert.h>
#if defined(MSDOS) || defined(__MSDOS__)
#include <dos.h>
#endif
#ifdef __TURBOC__
#include <alloc.h>
#endif
/* cph - from FreeBSD math.h: */
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
/*- boolean constants ------------------------------------------------------*/
#define TRUE 1
#define FALSE 0
/*- The function prototypes ------------------------------------------------*/
#undef max
#define max(a,b) (((a)>(b))?(a):(b))
/*- print a resource name by printing first 8 characters --*/
#define Printname(dir) printf("%-8.8s",(dir)->name)
/*- Global functions & variables ------------------------------------------*/
/* blockmap.c */
void CreateBlockmap_old(const bbox_t bbox);
void CreateBlockmap_compressed(const bbox_t bbox);
extern void (*CreateBlockmap)(const bbox_t bbox);
/* bsp.c */
void progress(void);
void FindLimits(struct Seg *, bbox_t box);
int SplitDist(struct Seg *ts);
extern const char *unlinkwad;
struct lumplist *FindDir(const char *);
void* ReadLump(struct lumplist *l);
void add_lump(const char *name, void *data, size_t length);
/* endian.c */
void ConvertAll(void);
void ConvertVertex(void);
void ConvertLinedef(void);
void ConvertSidedef(void);
void ConvertSector(void);
void swapshort(uint16_t *i);
void swaplong(uint32_t *l);
void swapint(unsigned int *l);
/* funcs.c */
extern int verbosity;
void Verbose(const char*, ...) __attribute__((format(printf,1,2)));
void ProgError(const char *, ...) __attribute__((format(printf,1,2), noreturn));
void* GetMemory(size_t) __attribute__((warn_unused_result, malloc));
void* ResizeMemory(void *, size_t) __attribute__((warn_unused_result));
/* level.c */
void DoLevel(const char *current_level_name, struct lumplist * current_level);
extern struct Vertex *vertices;
extern long num_verts;
extern struct LineDef *linedefs;
extern long num_lines;
extern struct SideDef *sidedefs;
extern long num_sides;
extern struct Sector *sectors;
extern long num_sects;
extern struct SSector *ssectors;
extern long num_ssectors;
extern struct Pseg *psegs;
extern long num_psegs;
extern long num_nodes;
extern unsigned char *SectorHits;
extern long psx,psy,pex,pey,pdx,pdy;
extern long lsx,lsy,lex,ley;
/* makenode.c */
struct Node *CreateNode(struct Seg *, const bbox_t bbox);
unsigned ComputeAngle(int,int);
/* picknode.c */
extern int factor;
struct Seg *PickNode_traditional(struct Seg *, const bbox_t bbox);
struct Seg *PickNode_visplane(struct Seg *, const bbox_t bbox);
extern struct Seg *(*PickNode)(struct Seg *, const bbox_t bbox);
int DoLinesIntersect(void);
void ComputeIntersection(short int *outx,short int *outy);
/* malloc edbugging with dmalloc */
#ifdef WITH_DMALLOC
#include <dmalloc.h>
#define GetMemory malloc
#define ResizeMemory realloc
#endif
/*------------------------------- end of file ------------------------------*/