4#define TERRAINTHICKNESS 16
5#define TERRAINACTIVESECTIONS 3000
37#define SECTHEIGHTSIZE 17
39#define SECTIONSPERBLOCK 16
42#define CHUNKBIAS (MAXCLUSTERS*MAXSECTIONS/2)
43#define CHUNKLIMIT (MAXCLUSTERS*MAXSECTIONS)
46#define HMLMSTRIDE (LMCHUNKS*SECTTEXSIZE)
48#define SECTION_MAGIC (*(int*)"HMMS")
49#define SECTION_VER_DEFAULT 1
66#define TGS_NODOWNLOAD 16
67#define TGS_NORENDER 32
68#define TGS_DEFAULTONFAIL 64
90#define TSF_INTERNAL (TSF_RELIGHT|TSF_DIRTY|TSF_EDITED|TSF_NOTIFY)
113 unsigned int texmap[SECTTEXSIZE][SECTTEXSIZE];
114 float heights[SECTHEIGHTSIZE*SECTHEIGHTSIZE];
143 unsigned int offset[SECTIONSPERBLOCK*SECTIONSPERBLOCK];
214 vec4_t colours[SECTHEIGHTSIZE*SECTHEIGHTSIZE];
215 char texname[4][MAX_QPATH];
293 unsigned short numcp[2];
296 unsigned short tesssize[2];
310 unsigned short lmbase[2];
314 unsigned short lmextents[2];
447#define plugterrainfuncs_name "Terrain"
unsigned int width
Definition: bymorphed.h:4
unsigned int height
Definition: bymorphed.h:5
unsigned char qbyte
Definition: common.h:127
s
Definition: execloop.h:53
int Surf_NewLightmaps(int count, int width, int height, uploadfmt_t fmt, qboolean deluxe)
Definition: r_surf.c:3524
@ TMF_SCALE
Definition: gl_terrain.h:94
struct hmpolyset_s hmpolyset_t
@ TSLS_LOADING1
Definition: gl_terrain.h:187
@ TSLS_LOADING2
Definition: gl_terrain.h:188
@ TSLS_FAILED
Definition: gl_terrain.h:190
@ TSLS_LOADING0
Definition: gl_terrain.h:186
@ TSLS_LOADED
Definition: gl_terrain.h:189
@ TSLS_NOTLOADED
Definition: gl_terrain.h:185
struct patchtessvert_s patchtessvert_t
struct brushbatch_s brushbatch_t
@ TSF_HASHEIGHTS
Definition: gl_terrain.h:75
@ TSF_D_UNUSED4
Definition: gl_terrain.h:82
@ TSF_DIRTY
Definition: gl_terrain.h:87
@ TSF_D_UNUSED2
Definition: gl_terrain.h:80
@ TSF_EDITED
Definition: gl_terrain.h:88
@ TSF_HASCOLOURS
Definition: gl_terrain.h:74
@ TSF_RELIGHT
Definition: gl_terrain.h:86
@ TSF_NOTIFY
Definition: gl_terrain.h:85
@ TSF_HASWATER_V0
Definition: gl_terrain.h:73
@ TSF_HASSHADOW
Definition: gl_terrain.h:76
@ TSF_D_UNUSED1
Definition: gl_terrain.h:79
@ TSF_D_UNUSED3
Definition: gl_terrain.h:81
struct heightmap_s heightmap_t
unsigned int PatchInfo_EvaluateIndexes(const unsigned short *size, index_t *out_indexes)
Definition: gl_q2bsp.c:680
struct plugterrainfuncs_s plugterrainfuncs_t
struct brushtex_s brushtex_t
struct qcpatchvert_s qcpatchvert_t
patchtessvert_t * PatchInfo_Evaluate(const qcpatchvert_t *cp, const unsigned short patch_cp[2], const short subdiv[2], unsigned short *size)
Definition: gl_q2bsp.c:632
GLfloat GLfloat y
Definition: glquake.h:158
GLsizei count
Definition: glquake.h:149
GLint size
Definition: glquake.h:157
GLfloat x
Definition: glquake.h:158
int idx
Definition: pr_lua.c:221
puint_t string_t
Definition: progtype.h:66
vec3_t offset
Definition: q2m_flash.c:28
uploadfmt_t fmt
Definition: r_2d.c:48
unsigned short index_t
Definition: render.h:56
enum uploadfmt uploadfmt_t
Definition: gl_terrain.h:237
avec4_t align
Definition: gl_terrain.h:243
mesh_t * pmesh
Definition: gl_terrain.h:240
struct brushbatch_s * next
Definition: gl_terrain.h:242
int lightmap
Definition: gl_terrain.h:241
vbo_t vbo
Definition: gl_terrain.h:238
mesh_t mesh
Definition: gl_terrain.h:239
Definition: gl_terrain.h:303
unsigned short relit
Definition: gl_terrain.h:312
unsigned short numpoints
Definition: gl_terrain.h:307
qbyte * lightdata
Definition: gl_terrain.h:317
int lightmap
Definition: gl_terrain.h:309
brushtex_t * tex
Definition: gl_terrain.h:304
unsigned short lmscale
Definition: gl_terrain.h:308
unsigned short relight
Definition: gl_terrain.h:311
unsigned int surfaceflags
Definition: gl_terrain.h:315
unsigned int surfacevalue
Definition: gl_terrain.h:316
vec3_t * points
Definition: gl_terrain.h:306
Definition: gl_terrain.h:291
brushtex_t * tex
Definition: gl_terrain.h:292
patchtessvert_t * tessvert
Definition: gl_terrain.h:297
Definition: gl_terrain.h:281
unsigned int contents
Definition: gl_terrain.h:282
vec3_t maxs
Definition: gl_terrain.h:289
vec4_t * planes
Definition: gl_terrain.h:288
unsigned char selected
Definition: gl_terrain.h:286
unsigned int id
Definition: gl_terrain.h:283
unsigned char ispatch
Definition: gl_terrain.h:287
unsigned int numplanes
Definition: gl_terrain.h:285
unsigned int axialplanes
Definition: gl_terrain.h:284
Definition: gl_terrain.h:247
int lmcount
Definition: gl_terrain.h:254
shader_t * shader
Definition: gl_terrain.h:250
struct brushtex_s * next
Definition: gl_terrain.h:259
char shadername[MAX_QPATH]
Definition: gl_terrain.h:248
struct brushbatch_s * batches
Definition: gl_terrain.h:256
qboolean rebuild
Definition: gl_terrain.h:258
int firstlm
Definition: gl_terrain.h:253
Definition: gl_terrain.h:137
int ver
Definition: gl_terrain.h:142
int magic
Definition: gl_terrain.h:141
Definition: gl_terrain.h:129
int magic
Definition: gl_terrain.h:130
int ver
Definition: gl_terrain.h:131
Definition: gl_terrain.h:110
unsigned int flags
Definition: gl_terrain.h:111
int reserved1
Definition: gl_terrain.h:121
int ents_num
Definition: gl_terrain.h:120
float maxh
Definition: gl_terrain.h:119
int reserved4
Definition: gl_terrain.h:122
int reserved2
Definition: gl_terrain.h:124
float minh
Definition: gl_terrain.h:118
unsigned short reserved0
Definition: gl_terrain.h:116
float waterheight
Definition: gl_terrain.h:117
int reserved3
Definition: gl_terrain.h:123
unsigned short holes
Definition: gl_terrain.h:115
Definition: gl_terrain.h:99
int size
Definition: gl_terrain.h:100
int reserved2
Definition: gl_terrain.h:104
int reserved3
Definition: gl_terrain.h:103
int reserved1
Definition: gl_terrain.h:105
float scale
Definition: gl_terrain.h:102
Definition: gl_terrain.h:389
entity_t ent
Definition: gl_terrain.h:393
size_t traceseq
Definition: gl_terrain.h:391
struct hmentity_s * next
Definition: gl_terrain.h:395
int refs
Definition: gl_terrain.h:392
size_t drawnframe
Definition: gl_terrain.h:390
Definition: gl_terrain.h:403
struct lmsect_s * next
Definition: gl_terrain.h:404
int y
Definition: gl_terrain.h:405
int x
Definition: gl_terrain.h:405
int lm
Definition: gl_terrain.h:405
Definition: gl_terrain.h:343
hmcluster_t * cluster[MAXCLUSTERS *MAXCLUSTERS]
Definition: gl_terrain.h:360
struct relight_ctx_s * relightcontext
Definition: gl_terrain.h:421
char groundshadername[MAX_QPATH]
Definition: gl_terrain.h:346
qboolean forcedefault
Definition: gl_terrain.h:351
int maxsegy
Definition: gl_terrain.h:358
enum heightmap_s::@294 defaultgroundtype
float defaultwaterheight
Definition: gl_terrain.h:354
unsigned int brushmaxlms
Definition: gl_terrain.h:428
unsigned int numbrushes
Definition: gl_terrain.h:431
unsigned int * brushlmremaps
Definition: gl_terrain.h:427
char defaultgroundtexture[MAX_QPATH]
Definition: gl_terrain.h:352
mesh_t * askymesh
Definition: gl_terrain.h:364
char defaultwatershader[MAX_QPATH]
Definition: gl_terrain.h:353
enum heightmap_s::@295 mode
qboolean recalculatebrushlighting
Definition: gl_terrain.h:424
int firstsegy
Definition: gl_terrain.h:357
brushes_t * wbrushes
Definition: gl_terrain.h:430
@ DGT_HOLES
Definition: gl_terrain.h:373
@ DGT_SOLID
Definition: gl_terrain.h:372
@ DGT_FLAT
Definition: gl_terrain.h:374
struct heightmap_s::lmsect_s * unusedlmsects
unsigned int numusedlmsects
Definition: gl_terrain.h:400
shader_t * shader
Definition: gl_terrain.h:362
int tilepixcount[2]
Definition: gl_terrain.h:382
char * texmask
Definition: gl_terrain.h:419
float brushlmscale
Definition: gl_terrain.h:426
qboolean entsdirty
Definition: gl_terrain.h:420
int tilecount[2]
Definition: gl_terrain.h:381
char path[MAX_QPATH]
Definition: gl_terrain.h:344
unsigned int numunusedlmsects
Definition: gl_terrain.h:401
lmalloc_t brushlmalloc
Definition: gl_terrain.h:425
mesh_t skymesh
Definition: gl_terrain.h:363
struct llightinfo_s * lightthreadmem
Definition: gl_terrain.h:422
size_t traceseq
Definition: gl_terrain.h:368
qboolean brushesedited
Definition: gl_terrain.h:433
unsigned int exteriorcontents
Definition: gl_terrain.h:366
vec2_t relightmin
Definition: gl_terrain.h:414
unsigned char * seed
Definition: gl_terrain.h:350
struct heightmap_s::hmentity_s * entities
int firstsegx
Definition: gl_terrain.h:357
unsigned int loadingsections
Definition: gl_terrain.h:367
char skyname[MAX_QPATH]
Definition: gl_terrain.h:345
unsigned int relightidx
Definition: gl_terrain.h:413
hmsection_t * relight
Definition: gl_terrain.h:412
unsigned int culldistance
Definition: gl_terrain.h:347
qboolean legacyterrain
Definition: gl_terrain.h:365
shader_t * skyshader
Definition: gl_terrain.h:361
int maxsegx
Definition: gl_terrain.h:358
int activesections
Definition: gl_terrain.h:384
void * entitylock
Definition: gl_terrain.h:397
float defaultgroundheight
Definition: gl_terrain.h:355
link_t recycle
Definition: gl_terrain.h:385
@ HMM_BLOCKS
Definition: gl_terrain.h:379
@ HMM_TERRAIN
Definition: gl_terrain.h:378
brushtex_t * brushtextures
Definition: gl_terrain.h:429
unsigned int brushidseq
Definition: gl_terrain.h:432
float maxdrawdist
Definition: gl_terrain.h:348
float sectionsize
Definition: gl_terrain.h:359
size_t drawnframe
Definition: gl_terrain.h:369
qboolean inheritedlightthreadmem
Definition: gl_terrain.h:423
Definition: gl_terrain.h:231
Definition: gl_terrain.h:147
mesh_t * amesh
Definition: gl_terrain.h:151
mesh_t mesh
Definition: gl_terrain.h:150
shader_t * shader
Definition: gl_terrain.h:149
struct hmpolyset_s * next
Definition: gl_terrain.h:148
vbo_t vbo
Definition: gl_terrain.h:152
Definition: gl_terrain.h:193
mesh_t mesh
Definition: gl_terrain.h:221
float maxh
Definition: gl_terrain.h:204
pvscache_t pvscache
Definition: gl_terrain.h:213
size_t traceseq
Definition: gl_terrain.h:210
vbo_t vbo
Definition: gl_terrain.h:220
int maxents
Definition: gl_terrain.h:227
float timestamp
Definition: gl_terrain.h:198
struct hmwater_s * water
Definition: gl_terrain.h:208
mesh_t * amesh
Definition: gl_terrain.h:222
unsigned int flags
Definition: gl_terrain.h:202
hmpolyset_t * polys
Definition: gl_terrain.h:224
int lmx
Definition: gl_terrain.h:217
int sx
Definition: gl_terrain.h:195
struct hmentity_s ** ents
Definition: gl_terrain.h:228
struct heightmap_s * hmmod
Definition: gl_terrain.h:205
float maxh_cull
Definition: gl_terrain.h:203
link_t recycle
Definition: gl_terrain.h:194
int loadstate
Definition: gl_terrain.h:197
texnums_t textures
Definition: gl_terrain.h:219
int lightmap
Definition: gl_terrain.h:216
int numents
Definition: gl_terrain.h:226
Definition: gl_terrain.h:155
float minheight
Definition: gl_terrain.h:159
qboolean simple
Definition: gl_terrain.h:158
qbyte holes[8]
Definition: gl_terrain.h:163
float maxheight
Definition: gl_terrain.h:160
unsigned int contentmask
Definition: gl_terrain.h:157
struct hmwater_s * next
Definition: gl_terrain.h:156
char shadername[MAX_QPATH]
Definition: gl_terrain.h:161
float heights[9 *9]
Definition: gl_terrain.h:164
shader_t * shader
Definition: gl_terrain.h:162
Definition: gl_model.h:90
Definition: gl_model.h:972
Definition: gl_terrain.h:263
vec3_t v
Definition: gl_terrain.h:264
vec2_t tc
Definition: gl_terrain.h:266
vec4_t rgba
Definition: gl_terrain.h:265
Definition: gl_terrain.h:437
int int sy
Definition: gl_terrain.h:443
qboolean(QDECL *AutogenerateSection)(heightmap_t *hm
void(QDECL *AddMesh)(heightmap_t *hm
int model_t const char vec3_t vec3_t axis[3]
Definition: gl_terrain.h:441
int sx
Definition: gl_terrain.h:443
int int unsigned int tgsflags
Definition: gl_terrain.h:446
int int int hmsection_t ** sects
Definition: gl_terrain.h:443
int model_t const char vec3_t vec3_t float scale
Definition: gl_terrain.h:441
qboolean initialise
Definition: gl_terrain.h:439
int model_t const char vec3_t epos
Definition: gl_terrain.h:441
int loadflags
Definition: gl_terrain.h:441
void *QDECL * GenerateWater(hmsection_t *s, float maxheight)
unsigned char *QDECL * GetLightmap(hmsection_t *s, int idx, qboolean edit)
int int int count
Definition: gl_terrain.h:443
hmsection_t *QDECL * GetSection(heightmap_t *hm, int x, int y, unsigned int flags)
qboolean(QDECL *InitLightmap)(hmsection_t *s
qboolean success
Definition: gl_terrain.h:444
int(QDECL *GenerateSections)(heightmap_t *hm
int model_t * mod
Definition: gl_terrain.h:441
int model_t const char * modelname
Definition: gl_terrain.h:441
Definition: bspfile.h:939
Definition: gl_terrain.h:322
float planedist
Definition: gl_terrain.h:325
vec3_t sdir
Definition: gl_terrain.h:326
float tbias
Definition: gl_terrain.h:329
vec3_t tdir
Definition: gl_terrain.h:328
float sbias
Definition: gl_terrain.h:327
vec3_t planenormal
Definition: gl_terrain.h:324
string_t shadername
Definition: gl_terrain.h:323
Definition: gl_terrain.h:332
unsigned int cp_width
Definition: gl_terrain.h:335
unsigned int subdiv_x
Definition: gl_terrain.h:337
unsigned int cp_height
Definition: gl_terrain.h:336
vec3_t texinfo
Definition: gl_terrain.h:339
unsigned int contents
Definition: gl_terrain.h:334
unsigned int subdiv_y
Definition: gl_terrain.h:338
string_t shadername
Definition: gl_terrain.h:333
Definition: gl_terrain.h:272
vec3_t v
Definition: gl_terrain.h:273
vec4_t rgba
Definition: gl_terrain.h:274
vec2_t tc
Definition: gl_terrain.h:275
Definition: gl_model.h:320
unsigned int flags
Definition: valid.c:313