24#define MAX_MAP_HULLSDQ1 4
25#define MAX_MAP_HULLSDH2 8
26#define MAX_MAP_HULLSM 8
27#define RBSP_STYLESPERSURF 4
28#define Q1Q2BSP_STYLESPERSURF 4
30#define MAXCPULIGHTMAPS 16
32#define MAXCPULIGHTMAPS Q1Q2BSP_STYLESPERSURF
34#define MAXCPULIGHTMAPS MAXRLIGHTMAPS
44#define SANITY_LIMIT(t) ((unsigned int)(0x7fffffffu/sizeof(t)))
60#define SANITY_MAX_MAP_BRUSHSIDES ((~0u)/sizeof(q2cbrushside_t))
70#define BSPVERSIONQTEST "\x17\0\0\0",4
71#define BSPVERSIONPREREL "\x1C\0\0\0",4
72#define BSPVERSION "\x1D\0\0\0",4
73#define BSPVERSIONHL "\x1E\0\0\0",4
74#define BSPVERSION_LONG1 "2PSB",4
75#define BSPVERSION_LONG2 "BSP2",4
76#define BSPVERSIONQ64 " 46Q",4
83#define LUMP_ENTITIES 0
85#define LUMP_TEXTURES 2
86#define LUMP_VERTEXES 3
87#define LUMP_VISIBILITY 4
91#define LUMP_LIGHTING 8
92#define LUMP_CLIPNODES 9
94#define LUMP_MARKSURFACES 11
96#define LUMP_SURFEDGES 13
99#define HEADER_LUMPS 15
105 int headnode[MAX_MAP_HULLSDQ1];
114 int headnode[MAX_MAP_HULLSDH2];
261#define MAXRLIGHTMAPS 4
263#define MAXRLIGHTMAPS 1
275 qbyte styles[Q1Q2BSP_STYLESPERSURF];
288 qbyte styles[Q1Q2BSP_STYLESPERSURF];
294#define AMBIENT_WATER 0
296#define AMBIENT_SLIME 2
297#define AMBIENT_LAVA 3
299#define NUM_AMBIENTS 4
381#define IDBSPHEADER "IBSP",4
384#define BSPVERSION_Q2 38
385#define BSPVERSION_Q2W 69
386#define BSPVERSION_Q3 46
387#define BSPVERSION_RTCW 47
388#define BSPVERSION_RBSP 1
395#define SANITY_MAX_Q2MAP_MODELS MAX_PRECACHE_MODELS
397#define SANITY_MAX_MAP_BRUSHES (~0u/sizeof(*out))
398#define SANITY_MAX_MAP_LEAFFACES 262144
400#define MAX_Q2MAP_AREAS 256
401#define MAX_Q2MAP_AREAPORTALS 1024
404#define SANITY_MAX_MAP_LEAFBRUSHES (65536*64)
414#define MAX_VALUE 1024
419#define Q2LUMP_ENTITIES 0
420#define Q2LUMP_PLANES 1
421#define Q2LUMP_VERTEXES 2
422#define Q2LUMP_VISIBILITY 3
423#define Q2LUMP_NODES 4
424#define Q2LUMP_TEXINFO 5
425#define Q2LUMP_FACES 6
426#define Q2LUMP_LIGHTING 7
427#define Q2LUMP_LEAFS 8
428#define Q2LUMP_LEAFFACES 9
429#define Q2LUMP_LEAFBRUSHES 10
430#define Q2LUMP_EDGES 11
431#define Q2LUMP_SURFEDGES 12
432#define Q2LUMP_MODELS 13
433#define Q2LUMP_BRUSHES 14
434#define Q2LUMP_BRUSHSIDES 15
436#define Q2LUMP_AREAS 17
437#define Q2LUMP_AREAPORTALS 18
438#define Q2HEADER_LUMPS 19
510#define FTECONTENTS_EMPTY 0x00000000
511#define FTECONTENTS_SOLID 0x00000001
512#define FTECONTENTS_WINDOW 0x00000002
514#define FTECONTENTS_LAVA 0x00000008
515#define FTECONTENTS_SLIME 0x00000010
516#define FTECONTENTS_WATER 0x00000020
517#define FTECONTENTS_FLUID (FTECONTENTS_WATER|FTECONTENTS_SLIME|FTECONTENTS_LAVA|FTECONTENTS_SKY)
526#define FTECONTENTS_LADDER 0x00004000
528#define FTECONTENTS_PLAYERCLIP 0x00010000
529#define FTECONTENTS_MONSTERCLIP 0x00020000
537#define FTECONTENTS_BODY 0x02000000
538#define FTECONTENTS_CORPSE 0x04000000
539#define FTECONTENTS_DETAIL 0x08000000
543#define FTECONTENTS_SKY 0x80000000
546#define Q2CONTENTS_SOLID FTECONTENTS_SOLID
547#define Q2CONTENTS_WINDOW 0x00000002
548#define Q2CONTENTS_AUX 0x00000004
549#define Q2CONTENTS_LAVA FTECONTENTS_LAVA
550#define Q2CONTENTS_SLIME FTECONTENTS_SLIME
551#define Q2CONTENTS_WATER FTECONTENTS_WATER
552#define Q2CONTENTS_MIST 0x00000040
562#define Q2CONTENTS_AREAPORTAL 0x00008000
563#define Q2CONTENTS_PLAYERCLIP FTECONTENTS_PLAYERCLIP
564#define Q2CONTENTS_MONSTERCLIP FTECONTENTS_MONSTERCLIP
566#define Q2CONTENTS_CURRENT_0 0x00040000
567#define Q2CONTENTS_CURRENT_90 0x00080000
568#define Q2CONTENTS_CURRENT_180 0x00100000
569#define Q2CONTENTS_CURRENT_270 0x00200000
570#define Q2CONTENTS_CURRENT_UP 0x00400000
571#define Q2CONTENTS_CURRENT_DOWN 0x00800000
572#define Q2CONTENTS_ORIGIN 0x01000000
573#define Q2CONTENTS_MONSTER FTECONTENTS_BODY
574#define Q2CONTENTS_DEADMONSTER FTECONTENTS_CORPSE
575#define Q2CONTENTS_DETAIL 0x08000000
576#define Q2CONTENTS_TRANSLUCENT 0x10000000
577#define Q2CONTENTS_LADDER 0x20000000
582#define Q3CONTENTS_SOLID FTECONTENTS_SOLID
585#define Q3CONTENTS_LAVA FTECONTENTS_LAVA
586#define Q3CONTENTS_SLIME FTECONTENTS_SLIME
587#define Q3CONTENTS_WATER FTECONTENTS_WATER
589#define Q3CONTENTS_NOTTEAM1 0x00000080
590#define Q3CONTENTS_NOTTEAM2 0x00000100
591#define Q3CONTENTS_NOBOTCLIP 0x00000200
597#define Q3CONTENTS_AREAPORTAL 0x00008000
598#define Q3CONTENTS_PLAYERCLIP FTECONTENTS_PLAYERCLIP
599#define Q3CONTENTS_MONSTERCLIP FTECONTENTS_MONSTERCLIP
600#define Q3CONTENTS_TELEPORTER 0x00040000
601#define Q3CONTENTS_JUMPPAD 0x00080000
602#define Q3CONTENTS_CLUSTERPORTAL 0x00100000
603#define Q3CONTENTS_DONOTENTER 0x00200000
604#define Q3CONTENTS_BOTCLIP 0x00400000
605#define Q3CONTENTS_MOVER 0x00800000
606#define Q3CONTENTS_ORIGIN Q2CONTENTS_ORIGIN
607#define Q3CONTENTS_BODY FTECONTENTS_BODY
608#define Q3CONTENTS_CORPSE FTECONTENTS_CORPSE
609#define Q3CONTENTS_DETAIL Q2CONTENTS_DETAIL
610#define Q3CONTENTS_STRUCTURAL 0x10000000
611#define Q3CONTENTS_TRANSLUCENT 0x20000000
612#define Q3CONTENTS_TRIGGER 0x40000000
613#define Q3CONTENTS_NODROP FTECONTENTS_SKY
616#define DPCONTENTS_SOLID 1
617#define DPCONTENTS_WATER 2
618#define DPCONTENTS_SLIME 4
619#define DPCONTENTS_LAVA 8
620#define DPCONTENTS_SKY 16
621#define DPCONTENTS_BODY 32
622#define DPCONTENTS_CORPSE 64
623#define DPCONTENTS_NODROP 128
624#define DPCONTENTS_PLAYERCLIP 256
625#define DPCONTENTS_MONSTERCLIP 512
626#define DPCONTENTS_DONOTENTER 1024
627#define DPCONTENTS_BOTCLIP 2048
628#define DPCONTENTS_OPAQUE 4096
638#define TI_TRANS33 0x10
639#define TI_TRANS66 0x20
640#define TI_FLOWING 0x40
641#define TI_NODRAW 0x80
647#define TI_KINGPIN_ALPHATEST 0x1000
656#define Q3SURFACEFLAG_LADDER 0x8
675#define MASK_WORLDSOLID (FTECONTENTS_SOLID|FTECONTENTS_WINDOW)
676#define MASK_POINTSOLID (FTECONTENTS_SOLID|FTECONTENTS_WINDOW|FTECONTENTS_BODY)
677#define MASK_BOXSOLID (FTECONTENTS_SOLID|FTECONTENTS_PLAYERCLIP|Q2CONTENTS_WINDOW|FTECONTENTS_BODY)
678#define MASK_PLAYERSOLID MASK_BOXSOLID
681#define MASK_WATER (FTECONTENTS_WATER|FTECONTENTS_LAVA|FTECONTENTS_SLIME)
684#define Q2MASK_CURRENT (Q2CONTENTS_CURRENT_0|Q2CONTENTS_CURRENT_90|Q2CONTENTS_CURRENT_180|Q2CONTENTS_CURRENT_270|Q2CONTENTS_CURRENT_UP|Q2CONTENTS_CURRENT_DOWN)
838 char shadername[OLD_MAX_QPATH];
863 float texcoords[2][2];
865 unsigned char color[4];
872 float lmtexcoords[RBSP_STYLESPERSURF][2];
874 unsigned char color[RBSP_STYLESPERSURF][4];
905 int lightmap_offs[2];
908 float lightmap_origin[3];
909 float lightmap_vecs[2][3];
924 unsigned char lm_styles[RBSP_STYLESPERSURF];
925 unsigned char vt_styles[RBSP_STYLESPERSURF];
926 int lightmapnum[RBSP_STYLESPERSURF];
927 int lightmap_offs[2][RBSP_STYLESPERSURF];
930 float lightmap_origin[3];
931 float lightmap_vecs[2][3];
937#define MAX_ENT_LEAFS 32
struct q2miptex_s q2miptex_t
struct q2texinfo_s q2texinfo_t
struct pvscache_s pvscache_t
struct q64miptex_s q64miptex_t
q1contents_e
Definition: bspfile.h:172
@ Q1CONTENTS_MONSTERCLIP
Definition: bspfile.h:190
@ Q1CONTENTS_SOLID
Definition: bspfile.h:175
@ Q1CONTENTS_CLIP
Definition: bspfile.h:181
@ Q1CONTENTS_SKY
Definition: bspfile.h:179
@ Q1CONTENTS_LADDER
Definition: bspfile.h:189
@ Q1CONTENTS_CURRENT_DOWN
Definition: bspfile.h:187
@ Q1CONTENTS_CURRENT_0
Definition: bspfile.h:182
@ Q1CONTENTS_WATER
Definition: bspfile.h:176
@ Q1CONTENTS_CURRENT_270
Definition: bspfile.h:185
@ Q1CONTENTS_CURRENT_90
Definition: bspfile.h:183
@ Q1CONTENTS_LAVA
Definition: bspfile.h:178
@ Q1CONTENTS_EMPTY
Definition: bspfile.h:174
@ Q1CONTENTS_TRANS
Definition: bspfile.h:188
@ Q1CONTENTS_CORPSE
Definition: bspfile.h:192
@ Q1CONTENTS_PLAYERCLIP
Definition: bspfile.h:191
@ Q1CONTENTS_CURRENT_UP
Definition: bspfile.h:186
@ Q1CONTENTS_SLIME
Definition: bspfile.h:177
@ Q1CONTENTS_CURRENT_180
Definition: bspfile.h:184
q3surfacetype
Definition: bspfile.h:885
@ MST_FLARE
Definition: bspfile.h:890
@ MST_PATCH
Definition: bspfile.h:888
@ MST_PATCH_FIXED
Definition: bspfile.h:892
@ MST_TRIANGLE_SOUP
Definition: bspfile.h:889
@ MST_BAD
Definition: bspfile.h:886
@ MST_PLANAR
Definition: bspfile.h:887
@ MST_FOLIAGE
Definition: bspfile.h:891
Q3LUMP
Definition: bspfile.h:441
@ Q3LUMP_ENTITIES
Definition: bspfile.h:442
@ Q3LUMP_BRUSHES
Definition: bspfile.h:450
@ Q3LUMP_SURFACES
Definition: bspfile.h:455
@ Q3LUMP_VISIBILITY
Definition: bspfile.h:458
@ Q3LUMP_NODES
Definition: bspfile.h:445
@ Q3LUMP_LEAFS
Definition: bspfile.h:446
@ Q3LUMP_LIGHTGRID
Definition: bspfile.h:457
@ Q3LUMP_FOGS
Definition: bspfile.h:454
@ RBSPLUMP_LIGHTINDEXES
Definition: bspfile.h:460
@ Q3LUMP_MODELS
Definition: bspfile.h:449
@ Q3LUMP_LEAFSURFACES
Definition: bspfile.h:447
@ Q3LUMP_DRAWVERTS
Definition: bspfile.h:452
@ Q3LUMP_PLANES
Definition: bspfile.h:444
@ Q3LUMP_BRUSHSIDES
Definition: bspfile.h:451
@ Q3LUMP_SHADERS
Definition: bspfile.h:443
@ Q3LUMPS_TOTAL
Definition: bspfile.h:462
@ Q3LUMP_DRAWINDEXES
Definition: bspfile.h:453
@ Q3LUMP_LEAFBRUSHES
Definition: bspfile.h:448
@ Q3LUMP_LIGHTMAPS
Definition: bspfile.h:456
struct texinfo_s texinfo_t
unsigned char qbyte
Definition: common.h:127
GLuint GLcharARB * name
Definition: glquake.h:155
const GLfloat * v
Definition: glsupp.h:466
char ** data
Definition: p_script.c:63
static AL_API ALsizei n
Definition: snd_al.c:161
cvar_t ambient_level
Definition: snd_dma.c:102
Definition: bspfile.h:878
int brushnum
Definition: bspfile.h:880
char shadername[OLD_MAX_QPATH]
Definition: bspfile.h:879
int visibleside
Definition: bspfile.h:881
Definition: bspfile.h:850
int firstsurface
Definition: bspfile.h:853
float mins[3]
Definition: bspfile.h:851
int num_surfaces
Definition: bspfile.h:854
int firstbrush
Definition: bspfile.h:855
int num_brushes
Definition: bspfile.h:856
float maxs[3]
Definition: bspfile.h:852
Definition: bspfile.h:844
float d
Definition: bspfile.h:846
Definition: bspfile.h:111
int visleafs
Definition: bspfile.h:115
int firstface
Definition: bspfile.h:116
Definition: bspfile.h:317
int contents
Definition: bspfile.h:318
unsigned int nummarksurfaces
Definition: bspfile.h:325
int visofs
Definition: bspfile.h:319
unsigned int firstmarksurface
Definition: bspfile.h:324
Definition: bspfile.h:206
unsigned int firstface
Definition: bspfile.h:211
int planenum
Definition: bspfile.h:207
unsigned int numfaces
Definition: bspfile.h:212
Definition: bspfile.h:330
unsigned int firstmarksurface
Definition: bspfile.h:337
int contents
Definition: bspfile.h:331
unsigned int nummarksurfaces
Definition: bspfile.h:338
int visofs
Definition: bspfile.h:332
Definition: bspfile.h:215
unsigned int firstface
Definition: bspfile.h:220
int planenum
Definition: bspfile.h:216
unsigned int numfaces
Definition: bspfile.h:221
Definition: bspfile.h:230
int planenum
Definition: bspfile.h:231
Definition: bspfile.h:256
Definition: bspfile.h:279
int texinfo
Definition: bspfile.h:285
int planenum
Definition: bspfile.h:280
int lightofs
Definition: bspfile.h:289
int side
Definition: bspfile.h:281
int numedges
Definition: bspfile.h:284
int firstedge
Definition: bspfile.h:283
Definition: bspfile.h:126
int nummiptex
Definition: bspfile.h:127
Definition: bspfile.h:164
float dist
Definition: bspfile.h:166
int type
Definition: bspfile.h:167
Definition: bspfile.h:102
int visleafs
Definition: bspfile.h:106
int firstface
Definition: bspfile.h:107
Definition: bspfile.h:837
int contents
Definition: bspfile.h:840
int surfflags
Definition: bspfile.h:839
Definition: bspfile.h:225
int planenum
Definition: bspfile.h:226
Definition: bspfile.h:252
Definition: bspfile.h:266
short planenum
Definition: bspfile.h:267
int firstedge
Definition: bspfile.h:270
short side
Definition: bspfile.h:268
int lightofs
Definition: bspfile.h:276
short numedges
Definition: bspfile.h:271
short texinfo
Definition: bspfile.h:272
Definition: bspfile.h:304
int contents
Definition: bspfile.h:305
int visofs
Definition: bspfile.h:306
unsigned short firstmarksurface
Definition: bspfile.h:311
unsigned short nummarksurfaces
Definition: bspfile.h:312
Definition: bspfile.h:197
unsigned short numfaces
Definition: bspfile.h:203
unsigned short firstface
Definition: bspfile.h:202
int planenum
Definition: bspfile.h:198
Definition: bspfile.h:148
unsigned int filelen
Definition: bspfile.h:80
Definition: bspfile.h:236
int planenum
Definition: bspfile.h:237
Definition: bspfile.h:133
unsigned height
Definition: bspfile.h:135
unsigned offsets[MIPLEVELS]
Definition: bspfile.h:136
unsigned width
Definition: bspfile.h:135
Definition: bspfile.h:939
int areanum2
Definition: bspfile.h:943
int areanum
Definition: bspfile.h:942
int headnode
Definition: bspfile.h:944
unsigned int leafnums[MAX_ENT_LEAFS]
Definition: bspfile.h:941
int num_leafs
Definition: bspfile.h:940
Definition: bspfile.h:813
int firstareaportal
Definition: bspfile.h:815
int numareaportals
Definition: bspfile.h:814
Definition: bspfile.h:807
int otherarea
Definition: bspfile.h:809
int portalnum
Definition: bspfile.h:808
Definition: bspfile.h:767
int contents
Definition: bspfile.h:770
int numsides
Definition: bspfile.h:769
int firstside
Definition: bspfile.h:768
Definition: bspfile.h:749
short texinfo
Definition: bspfile.h:751
unsigned short planenum
Definition: bspfile.h:750
Definition: bspfile.h:719
unsigned short firstleafface
Definition: bspfile.h:728
unsigned short firstleafbrush
Definition: bspfile.h:731
short area
Definition: bspfile.h:723
unsigned short numleafbrushes
Definition: bspfile.h:732
unsigned short numleaffaces
Definition: bspfile.h:729
short cluster
Definition: bspfile.h:722
int contents
Definition: bspfile.h:720
Definition: bspfile.h:473
int headnode
Definition: bspfile.h:476
int firstface
Definition: bspfile.h:477
Definition: bspfile.h:689
unsigned short firstface
Definition: bspfile.h:694
int planenum
Definition: bspfile.h:690
unsigned short numfaces
Definition: bspfile.h:695
Definition: bspfile.h:791
int numclusters
Definition: bspfile.h:792
Definition: bspfile.h:361
unsigned width
Definition: bspfile.h:363
int contents
Definition: bspfile.h:367
char animname[32]
Definition: bspfile.h:365
unsigned offsets[MIPLEVELS]
Definition: bspfile.h:364
unsigned height
Definition: bspfile.h:363
int value
Definition: bspfile.h:368
int flags
Definition: bspfile.h:366
Definition: bspfile.h:708
int flags
Definition: bspfile.h:710
float vecs[2][4]
Definition: bspfile.h:709
int value
Definition: bspfile.h:711
int nexttexinfo
Definition: bspfile.h:713
char texture[32]
Definition: bspfile.h:712
Definition: bspfile.h:775
int num_sides
Definition: bspfile.h:777
int firstside
Definition: bspfile.h:776
int shadernum
Definition: bspfile.h:778
Definition: bspfile.h:755
int planenum
Definition: bspfile.h:756
int texinfo
Definition: bspfile.h:757
Definition: bspfile.h:896
int patchheight
Definition: bspfile.h:912
int lightmap_height
Definition: bspfile.h:907
int num_indexes
Definition: bspfile.h:903
int firstvertex
Definition: bspfile.h:900
int facetype
Definition: bspfile.h:899
int shadernum
Definition: bspfile.h:897
int lightmapnum
Definition: bspfile.h:904
int num_vertices
Definition: bspfile.h:901
int patchwidth
Definition: bspfile.h:911
int fognum
Definition: bspfile.h:898
int lightmap_width
Definition: bspfile.h:906
int firstindex
Definition: bspfile.h:902
Definition: bspfile.h:736
int firstleafbrush
Definition: bspfile.h:743
int area
Definition: bspfile.h:738
int num_leafsurfaces
Definition: bspfile.h:742
int firstleafsurface
Definition: bspfile.h:741
int cluster
Definition: bspfile.h:737
int num_leafbrushes
Definition: bspfile.h:744
Definition: bspfile.h:482
int num_surfaces
Definition: bspfile.h:486
int firstbrush
Definition: bspfile.h:487
int num_brushes
Definition: bspfile.h:488
int firstsurface
Definition: bspfile.h:485
Definition: bspfile.h:699
int plane
Definition: bspfile.h:700
Definition: bspfile.h:861
Definition: bspfile.h:797
int numclusters
Definition: bspfile.h:798
int rowsize
Definition: bspfile.h:799
Definition: bspfile.h:140
unsigned offsets[MIPLEVELS]
Definition: bspfile.h:143
unsigned height
Definition: bspfile.h:142
unsigned width
Definition: bspfile.h:142
unsigned scale
Definition: bspfile.h:142
Definition: bspfile.h:760
int texinfo
Definition: bspfile.h:762
int facenum
Definition: bspfile.h:763
int planenum
Definition: bspfile.h:761
Definition: bspfile.h:916
int num_indexes
Definition: bspfile.h:923
int patchwidth
Definition: bspfile.h:933
int firstvertex
Definition: bspfile.h:920
int firstindex
Definition: bspfile.h:922
int lightmap_width
Definition: bspfile.h:928
int patchheight
Definition: bspfile.h:934
int facetype
Definition: bspfile.h:919
int shadernum
Definition: bspfile.h:917
int fognum
Definition: bspfile.h:918
int lightmap_height
Definition: bspfile.h:929
int num_vertices
Definition: bspfile.h:921
Definition: bspfile.h:869
Definition: bspfile.h:242
float vecs[2][4]
Definition: bspfile.h:243
int flags
Definition: bspfile.h:245
int miptex
Definition: bspfile.h:244