-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathr_defs.pas
764 lines (670 loc) · 20.1 KB
/
r_defs.pas
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
//------------------------------------------------------------------------------
//
// DelphiHexen is a source port of the game Hexen and it is
// based on original Linux Doom as published by "id Software", on
// Hexen source as published by "Raven" software and DelphiDoom
// as published by Jim Valavanis.
// Copyright (C) 2004-2022 by Jim Valavanis
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
// DESCRIPTION:
// Refresh/rendering module, shared data struct definitions.
//
//------------------------------------------------------------------------------
// Site : https://sourceforge.net/projects/delphidoom/
//------------------------------------------------------------------------------
{$I Doom32.inc}
unit r_defs;
interface
uses
d_delphi,
tables,
{$IFNDEF OPENGL}
t_main,
{$ENDIF}
// Some more or less basic data types
// we depend on.
m_fixed,
// We rely on the thinker data struct
// to handle sound origins in sectors.
d_think,
// SECTORS do store MObjs anyway.
p_mobj_h,
p_udmf,
s_sndseq,
{$IFNDEF OPENGL}
r_range, // JVAL: 3d Floors
r_visplanes, // JVAL: 3d Floors
{$ENDIF}
w_wad;
// Silhouette, needed for clipping Segs (mainly)
// and sprites representing things.
const
SIL_NONE = 0;
SIL_BOTTOM = 1;
SIL_TOP = 2;
SIL_BOTH = 3;
MAXDRAWSEGS = $10000;
var
needsbackscreen: boolean = false;
const
NUMCOLORMAPS = 32;
type
//
// INTERNAL MAP TYPES
// used by play and refresh
//
//
// Your plain vanilla vertex.
// Note: transformed values not buffered locally,
// like some DOOM-alikes ("wt", "WebView") did.
//
vertex_t = packed record
x: fixed_t;
y: fixed_t;
amvalidcount: integer;
interpvalidcount: integer;
end;
Pvertex_t = ^vertex_t;
vertex_tArray = packed array[0..$FFFF] of vertex_t;
Pvertex_tArray = ^vertex_tArray;
// Each sector has a degenmobj_t in its center
// for sound origin purposes.
// I suppose this does not handle sound from
// moving objects (doppler), because
// position is prolly just buffered, not
// updated.
degenmobj_t = packed record
thinker: thinker_t; // not used for anything
x: fixed_t;
y: fixed_t;
z: fixed_t;
end;
Pdegenmobj_t = ^degenmobj_t;
degenmobj_tArray = array[0..$FFF] of degenmobj_t;
Pdegenmobj_tArray = ^degenmobj_tArray;
Pline_t = ^line_t;
Pline_tArray = ^line_tArray;
Pline_tPArray = ^line_tPArray;
//
// The SECTORS record, at runtime.
// Stores things/mobjs.
//
Psector_t = ^sector_t;
sector_t = packed record
floorheight: fixed_t;
ceilingheight: fixed_t;
floorpic: smallint;
ceilingpic: smallint;
lightlevel: smallint;
special: smallint;
tag: smallint;
// 0 = untraversed, 1,2 = sndlines -1
soundtraversed: integer;
// thing that made a sound (or null)
soundtarget: Pmobj_t;
// stone, metal, heavy, etc...
seqType: seqtype_t;
// mapblock bounding box for height changes
blockbox: array[0..3] of integer;
// origin for any sounds played by the sector
soundorg: degenmobj_t;
// if == validcount, already checked
validcount: integer;
// list of mobjs in sector
thinglist: Pmobj_t;
// thinker_t for reversable actions
specialdata: pointer;
linecount: integer;
lines: Pline_tPArray; // [linecount] size
renderflags: LongWord;
flags: LongWord;
iSectorID: integer; // JVAL: 3d floors
// JVAL: 3d floors
midsec: integer;
midline: integer;
// JVAL: Slopes
fa, fb, fd, fic, ca, cb, cd, cic: float;
slopesec: Psector_t;
slopeline: Pline_t;
// JVAL: sector affectees
num_saffectees: integer;
saffectees: PIntegerArray;
// JVAL: sector gravity (VERSION 204)
gravity: fixed_t;
floorangle: angle_t; // JVAL: 20200221 - Texture angle
flooranglex: fixed_t; // JVAL: 20201229 - Texture angle rover
floorangley: fixed_t; // JVAL: 20201229 - Texture angle rover
ceilingangle: angle_t; // JVAL: 20200221 - Texture angle
ceilinganglex: fixed_t; // JVAL: 20201229 - Texture angle rover
ceilingangley: fixed_t; // JVAL: 20201229 - Texture angle rover
{$IFDEF OPENGL}
no_toptextures: boolean;
no_bottomtextures: boolean;
{$ELSE}
// [kb] For R_WiggleFix
cachedheight: integer;
scaleindex: integer;
// JVAL: 20201225 - Speed up maps with large number of slopes
floorvisslope: integer;
ceilingvisslope: integer;
{$ENDIF}
moreids: moreids_t;
rendervalidcount: integer;
windthrust: integer;
windangle: angle_t;
// Interpolate related stuff
interpolate_group: integer; // JVAL: 20220327 - Interpolation group
intrplcnt: integer;
next_floorheight: fixed_t;
next_ceilingheight: fixed_t;
next_lightlevel: smallint;
next_floorangle: angle_t;
next_flooranglex: fixed_t;
next_floorangley: fixed_t;
next_ceilingangle: angle_t;
next_ceilinganglex: fixed_t;
next_ceilingangley: fixed_t;
next_fa, next_fb, next_fd, next_fic, next_ca, next_cb, next_cd, next_cic: float;
prev_floorheight: fixed_t;
prev_ceilingheight: fixed_t;
prev_lightlevel: smallint;
prev_floorangle: angle_t;
prev_flooranglex: fixed_t;
prev_floorangley: fixed_t;
prev_ceilingangle: angle_t;
prev_ceilinganglex: fixed_t;
prev_ceilingangley: fixed_t;
prev_fa, prev_fb, prev_fd, prev_fic, prev_ca, prev_cb, prev_cd, prev_cic: float;
end;
sector_tArray = packed array[0..$FFFF] of sector_t;
Psector_tArray = ^sector_tArray;
//
// The SideDef.
//
side_t = packed record
// add this to the calculated texture column
textureoffset: fixed_t;
// JVAL: 20220211 - UDMF support
toptextureoffset: fixed_t;
bottomtextureoffset: fixed_t;
midtextureoffset: fixed_t;
// add this to the calculated texture top
rowoffset: fixed_t;
// JVAL: 20220211 - UDMF support
toprowoffset: fixed_t;
bottomrowoffset: fixed_t;
midrowoffset: fixed_t;
// Texture indices.
// We do not maintain names here.
toptexture: smallint;
bottomtexture: smallint;
midtexture: smallint;
// Sector the SideDef is facing.
sector: Psector_t;
// Flags
flags: integer;
end;
Pside_t = ^side_t;
side_tArray = packed array[0..$FFFF] of side_t;
Pside_tArray = ^side_tArray;
//
// Move clipping aid for LineDefs.
//
slopetype_t = (
ST_HORIZONTAL,
ST_VERTICAL,
ST_POSITIVE,
ST_NEGATIVE
);
line_t = packed record
// Vertices, from v1 to v2.
v1: Pvertex_t;
v2: Pvertex_t;
// Precalculated v2 - v1 for side checking.
dx: fixed_t;
dy: fixed_t;
// Animation related.
flags: word;
special: byte;
arg1, arg2, arg3, arg4, arg5: byte;
// Visual appearance: SideDefs.
// sidenum[1] will be -1 if one sided
sidenum: packed array[0..1] of integer; // JVAL glbsp was smallint
// Neat. Another bounding box, for the extent
// of the LineDef.
bbox: packed array[0..3] of fixed_t;
// To aid move clipping.
slopetype: slopetype_t;
// Front and back sector.
// Note: redundant? Can be retrieved from SideDefs.
frontsector: Psector_t;
backsector: Psector_t;
// if == validcount, already checked
validcount: integer;
// thinker_t for reversable actions
specialdata: pointer;
renderflags: LongWord;
clslopestep: array[0..1] of float; // JVAL: Slopes
flslopestep: array[0..1] of float; // JVAL: Slopes
// JVAL: 20220209 - UDMF support
moreids: moreids_t;
{$IFNDEF OPENGL}
rendervalidcount: integer; // JVAL: 20220309 - Speed optimization
{$ENDIF}
end;
PPline_t = ^Pline_t;
line_tArray = packed array[0..$FFFF] of line_t;
line_tPArray = packed array[0..$FFFF] of Pline_t;
const
// Line rendering flags
LRF_ISOLATED = 1;
LRF_SLOPED = 4; // JVAL: Slopes
LRF_IGNOREPASS = 8; // JVAL: 20220309 - Speed optimization
const
// Sidedef flags
SDF_NOFAKECONTRAST = 1;
const
// Sector rendering flags
SRF_RIPPLE_FLOOR = 1;
SRF_RIPPLE_CEILING = 2;
SRF_RIPPLE = SRF_RIPPLE_FLOOR or SRF_RIPPLE_CEILING;
SRF_NO_INTERPOLATE = 4;
SRF_FFLOOR = 8; // JVAL: 3d Floors
SRF_DONOTDRAW = 16; // JVAL: 3d Floors
SRF_SLOPEFLOOR = 32; // JVAL: Slopes
SRF_SLOPECEILING = 64; // JVAL: Slopes
SRF_SLOPED = SRF_SLOPEFLOOR + SRF_SLOPECEILING; // JVAL: Slopes
SRF_INTERPOLATE_ROTATE = 512;
SRF_INTERPOLATE_FLOORSLOPE = 1024;
SRF_INTERPOLATE_CEILINGSLOPE = 2048;
SRF_FOG = 4096;
SRF_HIDDEN = 8192; // Hidden in textured automap
const
// Vissprite render flags
VSF_TRANSPARENCY = 1;
VSF_VOXEL = 2;
//
// A SubSector.
// References a Sector.
// Basically, this is a list of LineSegs,
// indicating the visible walls that define
// (all or some) sides of a convex BSP leaf.
//
const
SSF_CENTROIDCALCED = 1;
SSF_BRIDGE = 2;
type
subsector_t = packed record
sector: Psector_t;
numlines: LongWord; // JVAL glbsp (was word)
firstline: LongWord;// JVAL glbsp (was word)
poly: pointer;
x, y: fixed_t; // JVAL 3d Floors (Subsector Centroid)
flags: LongWord;
end;
Psubsector_t = ^subsector_t;
subsector_tArray = packed array[0..$FFFF] of subsector_t;
Psubsector_tArray = ^subsector_tArray;
//
// The LineSeg.
//
seg_t = packed record
v1: Pvertex_t;
v2: Pvertex_t;
offset: fixed_t;
angle: angle_t;
sidedef: Pside_t;
linedef: Pline_t;
// Sector references.
// Could be retrieved from linedef, too.
// backsector is NULL for one sided lines
frontsector: Psector_t;
backsector: Psector_t;
{$IFDEF OPENGL}
length: single;
iSegID: integer;
{$ELSE}
map_length: integer;
inv_length: double;
specialoffsets: boolean;
{$ENDIF}
fakecontrastlight: integer;
miniseg: boolean;
end;
Pseg_t = ^seg_t;
PPseg_t = ^Pseg_t;
seg_tArray = packed array[0..$FFFF] of seg_t;
Pseg_tArray = ^seg_tArray;
seg_tPArray = packed array[0..$FFFF] of Pseg_t;
Pseg_tPArray = ^seg_tPArray;
type
saveseg_t = record
v1: vertex_t;
angle: angle_t;
end;
Psaveseg_t = ^saveseg_t;
saveseg_tArray = packed array[0..$FFFF] of saveseg_t;
Psaveseg_tArray = ^saveseg_tArray;
// ===== Polyobj data =====
type
polyobj_t = record
numsegs: integer;
segs: PPseg_t;
startSpot: degenmobj_t;
x, y: fixed_t;
prevx, prevy: fixed_t;
nextx, nexty: fixed_t;
originalPts: Pvertex_tArray; // used as the base for the rotations
prevPts: Pvertex_tArray; // use to restore the old point values
saveSegs: Psaveseg_tArray; // use to restore the interpolation values
angle: angle_t;
prevangle: angle_t;
nextangle: angle_t;
tag: integer; // reference tag assigned in HereticEd
bbox: packed array[0..3] of fixed_t;
validcount: integer;
crush: boolean; // should the polyobj attempt to crush mobjs?
seqType: integer;
size: fixed_t; // polyobj size (area of POLY_AREAUNIT == size of FRACUNIT)
specialdata: pointer; // pointer a thinker, if the poly is moving
end;
Ppolyobj_t = ^polyobj_t;
polyobj_tArray = array[0..$FFFF] of polyobj_t;
Ppolyobj_tArray = ^polyobj_tArray;
type
Ppolyblock_t = ^polyblock_t;
polyblock_t = record
polyobj: Ppolyobj_t;
prev, next: Ppolyblock_t;
end;
polyblock_tPArray = array[0..$FFFF] of Ppolyblock_t;
Ppolyblock_tPArray = ^polyblock_tPArray;
PPpolyblock_t = ^Ppolyblock_t;
//
// BSP node.
//
node_t = packed record
// Partition line.
x: fixed_t;
y: fixed_t;
dx: fixed_t;
dy: fixed_t;
// Bounding box for each child.
bbox: packed array[0..1, 0..3] of fixed_t;
// If NF_SUBSECTOR its a subsector.
children: packed array[0..1] of LongWord; // JVAL glbsp
end;
Pnode_t = ^node_t;
node_tArray = packed array[0..$FFFF] of node_t;
Pnode_tArray = ^node_tArray;
// posts are runs of non masked source pixels
post_t = packed record
topdelta: byte; // -1 is the last post in a column
length: byte; // length data bytes follows
end;
Ppost_t = ^post_t;
// column_t is a list of 0 or more post_t, (byte)-1 terminated
column_t = post_t;
Pcolumn_t = ^column_t;
//
// OTHER TYPES
//
drawseg_t = packed record
curline: Pseg_t;
x1: integer;
x2: integer;
scale1: fixed_t;
scale2: fixed_t;
scalestep: fixed_t;
{$IFNDEF OPENGL}
scale_dbl: Double; // JVAL: 3d Floors
scalestep_dbl: Double; // JVAL: 3d Floors
use_double: boolean;
{$ENDIF}
// 0=none, 1=bottom, 2=top, 3=both
silhouette: integer;
// do not clip sprites above this
bsilheight: fixed_t;
// do not clip sprites below this
tsilheight: fixed_t;
// Pointers to lists for sprite clipping,
// all three adjusted so [x1] is first value.
sprtopclip: PSmallIntArray;
sprbottomclip: PSmallIntArray;
maskedtexturecol: PSmallIntArray;
// JVAL: 3d Floors
thicksidecol: PSmallintArray;
midsec: Psector_t;
midside: Pside_t;
{$IFNDEF OPENGL}
midvis: Pvisplane3d_t;
midsiderange: midsiderange_t;
// JVAL: 20220306 - New field, precalculates (::silhouette = 0) and (::maskedtexturecol = nil) and (::thicksidecol = nil)
maskedquery: boolean;
{$ENDIF}
end;
Pdrawseg_t = ^drawseg_t;
drawsegsbuffer_t = array[0..$FFF] of Pdrawseg_t;
Pdrawsegsbuffer_t = ^ drawsegsbuffer_t;
// Patches.
// A patch holds one or more columns.
// Patches are used for sprites and all masked pictures,
// and we compose textures from the TEXTURE1/2 lists
// of patches.
patch_t = packed record
width: smallint; // bounding box size
height: smallint;
leftoffset: smallint; // pixels to the left of origin
topoffset: smallint; // pixels below the origin
columnofs: array[0..7] of integer; // only [width] used
// the [0] is &columnofs[width]
end;
Ppatch_t = ^patch_t;
patch_tArray = packed array[0..$FFFF] of patch_t; // JVAL: DO NOT USE
Ppatch_tArray = ^patch_tArray;
patch_tPArray = packed array[0..$FFFF] of Ppatch_t;
Ppatch_tPArray = ^patch_tPArray;
// A vissprite_t is a thing
// that will be drawn during a refresh.
// I.e. a sprite object that is partly visible.
Pvissprite_t = ^vissprite_t;
vissprite_t = packed record
x1: integer;
x2: integer;
{$IFNDEF OPENGL}
// for line side calculation
gx: fixed_t;
gy: fixed_t;
// global bottom / top for silhouette clipping
gz: fixed_t;
gzt: fixed_t;
footclip: fixed_t; // foot clipping
// horizontal position of x1
startfrac: fixed_t;
{$ENDIF}
scale: fixed_t;
{$IFNDEF OPENGL}
// negative if flipped
xiscale: fixed_t;
{$ENDIF}
texturemid: fixed_t;
{$IFNDEF OPENGL}
texturemid2: fixed_t; // JVAL For light boost
vx1, vx2: integer; // JVAL voxel support
ceilingz: fixed_t; // JVAL 3d Floors
cache: Pointer;
lightcache: Pointer;
{$ENDIF}
patch: integer;
// for color translation and shadow draw,
// maxbright frames as well
{$IFNDEF OPENGL} // JVAL: 3d Floors
colormap: PByteArray;
renderflags: LongWord;
{$ENDIF}
mobjflags: integer;
mobjflags_ex: integer;
mo: Pmobj_t;
{$IFDEF OPENGL}
flip: boolean;
{$ENDIF}
_class: integer;
infoscale: fixed_t;
fog: boolean; // JVAL: Mars fog sectors
end;
visspritebuffer_t = array[0..$FFFF] of Pvissprite_t;
visspritebuffer_p = ^visspritebuffer_t;
//
// Sprites are patches with a special naming convention
// so they can be recognized by R_InitSprites.
// The base name is NNNNFx or NNNNFxFx, with
// x indicating the rotation, x = 0, 1-7.
// The sprite and frame specified by a thing_t
// is range checked at run time.
// A sprite is a patch_t that is assumed to represent
// a three dimensional object and may have multiple
// rotations pre drawn.
// Horizontal flipping is used to save space,
// thus NNNNF2F5 defines a mirrored patch.
// Some sprites will only have one picture used
// for all views: NNNNF0
//
spriteframe_t = packed record
// If false use 0 for any position.
// Note: as eight entries are available,
// we might as well insert the same name eight times.
rotate: integer;
// Lump to use for view angles 0-7.
lump: array[0..31] of integer; // JVAL: Up to 32 sprite rotations
// Flip bit (1 = flip) to use for view angles 0-7.
flip: array[0..31] of boolean; // JVAL: Up to 32 sprite rotations
end;
Pspriteframe_t = ^spriteframe_t;
spriteframe_tArray = packed array[0..$FFFF] of spriteframe_t;
Pspriteframe_tArray = ^spriteframe_tArray;
//
// A sprite definition:
// a number of animation frames.
//
spritedef_t = packed record
numframes: integer;
spriteframes: Pspriteframe_tArray;
end;
Pspritedef_t = ^spritedef_t;
spritedef_tArray = packed array[0..$FFFF] of spritedef_t;
Pspritedef_tArray = ^spritedef_tArray;
//
// Texture definition.
// Each texture is composed of one or more patches,
// with patches being lumps stored in the WAD.
// The lumps are referenced by number, and patched
// into the rectangular texture space using origin
// and possibly other attributes.
//
type
mappatch_t = record
originx: smallint;
originy: smallint;
patch: smallint;
stepdir: smallint;
colormap: smallint;
end;
Pmappatch_t = ^mappatch_t;
//
// Texture definition.
// A DOOM wall texture is a list of patches
// which are to be combined in a predefined order.
//
maptexture_t = packed record
name: char8_t;
masked: integer;
width: smallint;
height: smallint;
filler: LongWord; // unused
patchcount: smallint;
patches: array[0..0] of mappatch_t;
end;
Pmaptexture_t = ^maptexture_t;
// A single patch from a texture definition,
// basically a rectangular area within
// the texture rectangle.
texpatch_t = packed record
// Block origin (allways UL),
// which has allready accounted
// for the internal origin of the patch.
originx: integer;
originy: integer;
patch: integer;
end;
Ptexpatch_t = ^texpatch_t;
// A maptexturedef_t describes a rectangular texture,
// which is composed of one or more mappatch_t structures
// that arrange graphic patches.
texture_t = packed record
// Keep name for switch changing, etc.
name: char8_t;
width: smallint;
height: smallint;
factorbits: integer;
// All the patches[patchcount]
// are drawn back to front into the cached texture.
{$IFNDEF OPENGL}
texture32: PTexture; // JVAL: External texture reference
{$ENDIF}
patchcount: smallint;
patches: array[0..0] of texpatch_t;
end;
Ptexture_t = ^texture_t;
texture_tPArray = array[0..$FFFF] of Ptexture_t;
Ptexture_tPArray = ^texture_tPArray;
// JVAL added flat record
flat_t = packed record
// Keep name for switch changing, etc.
name: char8_t;
width: smallint; // Optional ?? JVAL SOS maybe removed?
height: smallint;
{$IFNDEF OPENGL}
flat32: PTexture; // External texture reference
{$ENDIF}
terraintype: integer; // JVAL: 9 December 2007, Added terrain types
translation: integer;
lump: integer;
size: integer;
end;
Pflat_t = ^flat_t;
flatPArray = array[0..$FFFF] of Pflat_t;
PflatPArray = ^flatPArray;
var
numspritelumps: integer;
texturewidth: PIntegerArray;
texturecolumnlump: PSmallIntPArray;
texturecolumnofs: PIntegerPArray; // PWordPArray; //64k
texturecomposite: PBytePArray;
//
// MAPTEXTURE_T CACHING
// When a texture is first needed,
// it counts the number of composite columns
// required in the texture and allocates space
// for a column directory and any new columns.
// The directory will simply point inside other patches
// if there is only one patch in a given column,
// but any columns with multiple patches
// will have new column_ts generated.
//
implementation
end.