Quake II RTX doxygen  1.0 dev
sw.h
Go to the documentation of this file.
1 /*
2 Copyright (C) 1997-2001 Id Software, Inc.
3 
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8 
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13 
14 You should have received a copy of the GNU General Public License along
15 with this program; if not, write to the Free Software Foundation, Inc.,
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 */
18 
19 #include "shared/shared.h"
20 #include "common/bsp.h"
21 #include "common/cmd.h"
22 #include "common/common.h"
23 #include "common/cvar.h"
24 #include "common/files.h"
25 #include "common/math.h"
26 #include "client/client.h"
27 #include "client/video.h"
28 #include "refresh/refresh.h"
29 #include "refresh/images.h"
30 #include "refresh/models.h"
31 #include "system/system.h"
32 
33 #define REF_VERSION "SOFT 0.01"
34 
35 /*
36 ====================================================
37 
38  CONSTANTS
39 
40 ====================================================
41 */
42 
43 #define DSURF_SKY 2
44 #define DSURF_TURB 4
45 #define DSURF_BACKGROUND 8
46 
47 #define CACHE_SIZE 32
48 
49 #define VID_BYTES 4 // can be 4 or 3
50 #define TEX_BYTES 4 // must be 4
51 
52 
53 #define MAXVERTS 64 // max points in a surface polygon
54 #define MAXWORKINGVERTS (MAXVERTS + 4) // max points in an intermediate
55  // polygon (while processing)
56 
57 #define MAXHEIGHT 1200
58 #define MAXWIDTH 1600
59 
60 #define INFINITE_DISTANCE 0x10000 // distance that's always guaranteed to
61  // be farther away than anything in
62  // the scene
63 
64 #define WARP_WIDTH 320
65 #define WARP_HEIGHT 240
66 
67 #define PARTICLE_Z_CLIP 8.0
68 
69 #define TRANSPARENT_COLOR 0xFF
70 
71 #define TURB_SIZE 64 // base turbulent texture size
72 #define TURB_MASK (TURB_SIZE - 1)
73 
74 #define CYCLE 128 // turbulent cycle size
75 
76 #define DS_SPAN_LIST_END -128
77 
78 #define NUMSTACKEDGES 3000
79 #define MINEDGES NUMSTACKEDGES
80 #define MAXEDGES 30000
81 #define NUMSTACKSURFACES 1000
82 #define MINSURFACES NUMSTACKSURFACES
83 #define MAXSURFACES 10000
84 #define MAXSPANS 3000
85 
86 // flags in finalvert_t.flags
87 #define ALIAS_LEFT_CLIP 0x0001
88 #define ALIAS_TOP_CLIP 0x0002
89 #define ALIAS_RIGHT_CLIP 0x0004
90 #define ALIAS_BOTTOM_CLIP 0x0008
91 #define ALIAS_Z_CLIP 0x0010
92 #define ALIAS_XY_CLIP_MASK 0x000F
93 
94 #define SURFCACHE_SIZE_AT_320X240 1024*768
95 
96 #define BMODEL_FULLY_CLIPPED 0x10 // value returned by R_BmodelCheckBBox ()
97  // if bbox is trivially rejected
98 
99 #define CLIP_EPSILON 0.001
100 
101 #define BACKFACE_EPSILON 0.01
102 
103 #define NEAR_CLIP 0.01
104 
105 #define ALIAS_Z_CLIP_PLANE 4
106 
107 // turbulence stuff
108 #define AMP 8*0x10000
109 #define AMP2 3
110 #define SPEED 20
111 
112 
113 /*
114 ====================================================
115 
116 TYPES
117 
118 ====================================================
119 */
120 
121 typedef unsigned char pixel_t;
122 
123 typedef struct {
124  pixel_t *buffer; // invisible buffer
125  int rowbytes; // may be > width if displayed in a window
126  // can be negative for stupid dibs
127  int width;
128  int height;
129 } viddef_t;
130 
131 typedef struct {
132  vrect_t vrect; // subwindow in video for refresh
133  int vrectright, vrectbottom; // right & bottom screen coords
134  float vrectrightedge; // rightmost right edge we care about,
135  // for use in edge list
136  float fvrectx, fvrecty; // for floating-point compares
137  float fvrectx_adj, fvrecty_adj; // left and top edges, for clamping
138  int vrect_x_adj_shift20; // (vrect.x + 0.5 - epsilon) << 20
139  int vrectright_adj_shift20; // (vrectright + 0.5 - epsilon) << 20
140  float fvrectright_adj, fvrectbottom_adj; // right and bottom edges, for clamping
141  float fvrectright; // rightmost edge, for Alias clamping
142  float fvrectbottom; // bottommost edge, for Alias clamping
143 
144  // values for perspective projection
145  float xcenter, ycenter;
146  float xscale, yscale;
147  float xscaleinv, yscaleinv;
148  float xscaleshrink, yscaleshrink;
150 
151  // particle values
152  int vrectright_particle, vrectbottom_particle;
153  int pix_min, pix_max, pix_shift;
154 } oldrefdef_t;
155 
156 typedef struct {
157  float u, v;
158  float s, t;
159  float zi;
160 } emitpoint_t;
161 
162 typedef struct finalvert_s {
163  int u, v, s, t;
164  int l;
165  int zi;
166  int flags;
167  float xyz[3]; // eye space
168 } finalvert_t;
169 
170 typedef struct {
171  void *pskin;
175 
176 typedef struct drawsurf_s {
177  byte *surfdat; // destination for generated surface
178  int rowbytes; // destination logical width in bytes
179  mface_t *surf; // description for surface to generate
180  fixed8_t lightadj[MAX_LIGHTMAPS]; // adjust for lightmap levels for dynamic lighting
182  int surfmip; // mipmapped ratio of surface texels / world pixels
183  int surfwidth; // in mipmapped texels
184  int surfheight; // in mipmapped texels
185 } drawsurf_t;
186 
187 // clipped bmodel edges
188 typedef struct bedge_s {
189  mvertex_t *v[2];
190  struct bedge_s *pnext;
191 } bedge_t;
192 
193 typedef struct clipplane_s {
194  vec3_t normal;
195  float dist;
196  struct clipplane_s *next;
197  byte leftedge;
198  byte rightedge;
199  byte reserved[2];
200 } clipplane_t;
201 
202 #define MAX_BLOCKLIGHTS 1024
203 #define LIGHTMAP_BYTES 3
204 
205 typedef int blocklight_t;
206 
207 typedef struct surfcache_s {
208  struct surfcache_s *next;
209  struct surfcache_s **owner; // NULL is an empty chunk of memory
210  int lightadj[MAX_LIGHTMAPS]; // checked for strobe flush
211  int dlight;
212  int size; // including header
213  unsigned width;
214  unsigned height; // DEBUG only needed for debug
215  float mipscale;
217  byte data[4]; // width*height elements
218 } surfcache_t;
219 
220 typedef struct espan_s {
221  int u, v, count;
222  struct espan_s *pnext;
223 } espan_t;
224 
225 // used by the polygon drawer (R_POLY.C) and sprite setup code (R_SPRITE.C)
226 typedef struct {
227  int nump;
229  byte *pixels; // image
230  int pixel_width; // image width
231  int pixel_height; // image height
232  vec3_t vup, vright, vpn; // in worldspace, for plane eq
233  float dist;
234  float s_offset, t_offset;
235  float viewer_position[3];
236  void (*drawspanlet)(void);
237  int alpha;
239 } polydesc_t;
240 
241 // FIXME: compress, make a union if that will help
242 // insubmodel is only 1, flags is fewer than 32, spanstate could be a byte
243 typedef struct surf_s {
244  struct surf_s *next; // active surface stack in r_edge.c
245  struct surf_s *prev; // used in r_edge.c for active surf stack
246  struct espan_s *spans; // pointer to linked list of spans to draw
247  int key; // sorting key (BSP order)
248  int last_u; // set during tracing
249  int spanstate; // 0 = not in span
250  // 1 = in span
251  // -1 = in inverted span (end before start)
252  int flags; // currentface flags
253  mface_t *msurf;
254  entity_t *entity;
255  float nearzi; // nearest 1/z on surface, for mipmapping
256  qboolean insubmodel;
258 } surf_t;
259 
260 typedef struct edge_s {
261  fixed16_t u;
262  fixed16_t u_step;
263  struct edge_s *prev, *next;
264  uint16_t surfs[2];
266  float nearzi;
267  medge_t *owner;
268 } edge_t;
269 
270 typedef struct maliasst_s {
271  signed short s;
272  signed short t;
273 } maliasst_t;
274 
275 typedef struct maliastri_s {
276  unsigned short index_xyz[3];
277  unsigned short index_st[3];
278 } maliastri_t;
279 
280 typedef struct maliasvert_s {
281  uint8_t v[3];
283 } maliasvert_t;
284 
285 typedef struct maliasframe_s {
286  vec3_t scale;
287  vec3_t translate;
288  vec3_t bounds[2];
289  vec_t radius;
291 } maliasframe_t;
292 
293 typedef struct {
294  finalvert_t *a, *b, *c;
296 
297 
298 /*
299 ====================================================
300 
301 VARS
302 
303 ====================================================
304 */
305 
306 extern int r_framecount; // sequence # of current frame since Quake started
307 extern qboolean r_dowarp;
308 
310 
311 void D_DrawSurfaces(void);
312 void D_WarpScreen(void);
313 
314 //=======================================================================//
315 
316 extern drawsurf_t r_drawsurf;
317 
318 extern int c_surf;
319 
321 
325 
326 extern fixed16_t sadjust, tadjust;
327 extern fixed16_t bbextents, bbextentt;
328 
329 void D_DrawTurbulent16(espan_t *pspan, int *warptable);
330 void D_DrawSpans16(espan_t *pspans);
331 void D_DrawZSpans(espan_t *pspans);
332 
333 surfcache_t *D_CacheSurface(mface_t *surface, int miplevel);
334 
335 extern pixel_t *d_viewbuffer;
336 extern int d_screenrowbytes;
337 extern short *d_pzbuffer;
338 extern int d_zrowbytes;
339 extern int d_zwidth;
340 extern byte *d_spantable[MAXHEIGHT];
341 extern short *d_zspantable[MAXHEIGHT];
342 
343 extern int d_minmip;
344 extern float d_scalemip[3];
345 
346 extern viddef_t vid;
347 extern oldrefdef_t r_refdef;
348 
349 //===================================================================
350 
351 extern int cachewidth;
352 extern pixel_t *cacheblock;
353 
354 extern int r_drawnpolycount;
355 
356 extern int sintable[CYCLE * 2];
357 extern int intsintable[CYCLE * 2];
358 extern int blanktable[CYCLE * 2];
359 
360 extern vec3_t vup, base_vup;
361 extern vec3_t vpn, base_vpn;
362 extern vec3_t vright, base_vright;
363 
364 extern surf_t *auxsurfaces;
366 
367 // surfaces are generated in back to front order by the bsp, so if a surf
368 // pointer is greater than another one, it should be drawn in front
369 // surfaces[1] is the background, and is used as the active surface stack.
370 // surfaces[0] is a dummy, because index 0 is used to indicate no surface
371 // attached to an edge_t
372 
373 //===================================================================
374 
375 extern vec3_t sxformaxis[4]; // s axis transformed into viewspace
376 extern vec3_t txformaxis[4]; // t axis transformed into viewspac
377 
378 extern void R_TransformVector(vec3_t in, vec3_t out);
379 
380 //===========================================================================
381 
382 extern cvar_t *sw_aliasstats;
383 extern cvar_t *sw_clearcolor;
384 extern cvar_t *sw_drawflat;
385 extern cvar_t *sw_draworder;
386 extern cvar_t *sw_maxedges;
387 extern cvar_t *sw_maxsurfs;
388 extern cvar_t *sw_mipcap;
389 extern cvar_t *sw_mipscale;
390 extern cvar_t *sw_mode;
391 extern cvar_t *sw_reportsurfout;
392 extern cvar_t *sw_reportedgeout;
393 extern cvar_t *sw_surfcacheoverride;
394 extern cvar_t *sw_waterwarp;
395 extern cvar_t *sw_drawsird;
396 extern cvar_t *sw_dynamic;
397 extern cvar_t *sw_modulate;
398 
399 extern cvar_t *r_fullbright;
400 extern cvar_t *r_drawentities;
401 extern cvar_t *r_drawworld;
402 extern cvar_t *r_lerpmodels;
403 
404 extern cvar_t *r_speeds;
405 
406 extern cvar_t *vid_fullscreen;
407 extern cvar_t *vid_gamma;
408 
409 
410 extern clipplane_t view_clipplanes[4];
411 extern int *pfrustum_indexes[4];
412 
413 
414 //=============================================================================
415 
416 void R_RenderWorld(void);
417 
418 //=============================================================================
419 
420 extern cplane_t screenedge[4];
421 
422 extern vec3_t r_origin;
423 
424 extern entity_t r_worldentity;
425 extern model_t *currentmodel;
426 extern entity_t *currententity;
427 extern vec3_t modelorg;
428 extern vec3_t r_entorigin;
429 extern vec3_t entity_rotation[3];
430 
431 extern int r_visframecount;
432 
433 extern mface_t *r_alpha_surfaces;
434 
435 //=============================================================================
436 
437 //
438 // current entity info
439 //
440 extern qboolean insubmodel;
441 
442 void R_DrawAlphaSurfaces(void);
443 
444 void R_DrawSprite(void);
445 void R_DrawBeam(entity_t *e);
446 
447 void R_RenderFace(mface_t *fa, int clipflags);
448 void R_RenderBmodelFace(bedge_t *pedges, mface_t *psurf);
449 void R_TransformPlane(cplane_t *p, float *normal, float *dist);
450 void R_TransformFrustum(void);
451 
452 void R_DrawSubmodelPolygons(mmodel_t *pmodel, int clipflags, mnode_t *topnode);
453 void R_DrawSolidClippedSubmodelPolygons(mmodel_t *pmodel, mnode_t *topnode);
454 
455 void R_AliasDrawModel(void);
456 void R_BeginEdgeFrame(void);
457 void R_ScanEdges(void);
458 void R_MarkLights(mnode_t *headnode);
459 
460 void R_RotateBmodel(void);
461 
462 extern int c_faceclip;
463 extern int r_polycount;
464 extern int r_wholepolycount;
465 
466 extern fixed16_t sadjust, tadjust;
467 extern fixed16_t bbextents, bbextentt;
468 
469 extern mvertex_t *r_ptverts, *r_ptvertsmax;
470 
471 extern int r_currentkey;
472 extern int r_currentbkey;
473 
474 void R_DrawParticles(void);
475 
476 extern int r_amodels_drawn;
477 extern edge_t *auxedges;
478 extern int r_numallocatededges;
480 
481 extern edge_t *newedges[MAXHEIGHT];
482 extern edge_t *removeedges[MAXHEIGHT];
483 
484 extern fixed8_t r_aliasblendcolor[3];
485 
486 extern int r_alias_alpha;
487 extern int r_alias_one_minus_alpha;
488 
489 extern int r_outofsurfaces;
490 extern int r_outofedges;
491 
492 extern int r_maxvalidedgeoffset;
493 
495 
496 void R_DrawTriangle(void);
497 void R_AliasClipTriangle(finalvert_t *index0, finalvert_t *index1, finalvert_t *index2);
499 
500 extern float r_time1;
501 extern int r_frustum_indexes[4 * 6];
503 extern qboolean r_surfsonstack;
504 
505 extern mleaf_t *r_viewleaf;
507 
508 extern int r_clipflags;
509 extern int r_dlightframecount;
510 
511 extern bsp_t *r_worldmodel;
512 
513 extern blocklight_t blocklights[MAX_BLOCKLIGHTS * LIGHTMAP_BYTES]; // allow some very large lightmaps
514 
515 void R_PrintAliasStats(void);
516 void R_PrintTimes(void);
517 void R_LightPoint(vec3_t p, vec3_t color);
518 void R_SetupFrame(void);
519 void R_BuildLightMap(void);
520 
521 extern refdef_t r_newrefdef;
522 
523 //====================================================================
524 
525 void R_NewMap(void);
526 
527 void R_InitCaches(void);
528 void R_FreeCaches(void);
529 void D_FlushCaches(void);
530 void D_SCDump_f(void);
531 
532 void R_InitTurb(void);
533 
534 void R_InitImages(void);
535 void R_ShutdownImages(void);
536 
537 void R_BuildGammaTable(void);
538 
539 void R_InitSkyBox(void);
540 void R_EmitSkyBox(void);
541 
542 void R_ApplySIRDAlgorithum(void);
543 
544 void R_IMFlatShadedQuad(vec3_t a, vec3_t b, vec3_t c, vec3_t d, color_t color, float alpha);
545 
546 void R_InitDraw(void);
547 
edge_p
edge_t * edge_p
Definition: sw.h:479
maliasvert_t
struct maliasvert_s maliasvert_t
drawsurf_s
Definition: sw.h:176
edge_t
struct edge_s edge_t
surfcache_s::size
int size
Definition: sw.h:212
vright
vec3_t vright
Definition: main.c:51
R_DrawParticles
void R_DrawParticles(void)
Definition: part.c:119
oldrefdef_t::fvrectright
float fvrectright
Definition: sw.h:141
R_BeginEdgeFrame
void R_BeginEdgeFrame(void)
Definition: edge.c:80
drawsurf_s::surfheight
int surfheight
Definition: sw.h:184
espan_s
Definition: sw.h:220
blocklight_t
int blocklight_t
Definition: sw.h:205
r_viewleaf
mleaf_t * r_viewleaf
Definition: main.c:73
sw_modulate
cvar_t * sw_modulate
Definition: main.c:87
blocklights
blocklight_t blocklights[MAX_BLOCKLIGHTS *LIGHTMAP_BYTES]
Definition: light.c:207
d_zwidth
int d_zwidth
Definition: main.c:129
sw_reportedgeout
cvar_t * sw_reportedgeout
Definition: main.c:82
affinetridesc_t
Definition: sw.h:170
miplevel
static int miplevel
Definition: edge.c:61
r_maxedgesseen
int r_maxedgesseen
Definition: sw.h:502
surfcache_s
Definition: sw.h:207
finalvert_s::u
int u
Definition: sw.h:163
r_newrefdef
refdef_t r_newrefdef
Definition: main.c:28
R_InitDraw
void R_InitDraw(void)
Definition: draw.c:109
R_RotateBmodel
void R_RotateBmodel(void)
Definition: bsp.c:71
r_aliasblendcolor
fixed8_t r_aliasblendcolor[3]
Definition: alias.c:31
maliastri_s::index_xyz
unsigned short index_xyz[3]
Definition: sw.h:276
r_time1
float r_time1
Definition: main.c:35
R_MarkLights
void R_MarkLights(mnode_t *headnode)
Definition: light.c:76
viddef_t::buffer
pixel_t * buffer
Definition: sw.h:124
maliasframe_s::scale
vec3_t scale
Definition: gl.h:226
drawsurf_t
struct drawsurf_s drawsurf_t
R_ScanEdges
void R_ScanEdges(void)
Definition: edge.c:556
screenedge
cplane_t screenedge[4]
Definition: main.c:59
image_t
struct image_s image_t
Definition: material.h:27
r_currentkey
int r_currentkey
Definition: edge.c:46
surface_p
surf_t * surface_p
Definition: sw.h:365
d_sdivzstepu
float d_sdivzstepu
Definition: main.c:116
surf_s::next
struct surf_s * next
Definition: sw.h:244
surfcache_s::height
unsigned height
Definition: sw.h:214
maliasst_s
Definition: sw.h:270
R_TransformFrustum
void R_TransformFrustum(void)
Definition: misc.c:70
r_worldmodel
bsp_t * r_worldmodel
Definition: main.c:31
fv
static float fv
Definition: edge.c:59
currentmodel
model_t * currentmodel
Definition: main.c:29
R_DrawBeam
void R_DrawBeam(entity_t *e)
Definition: main.c:871
insubmodel
qboolean insubmodel
Definition: bsp.c:25
r_dowarp
qboolean r_dowarp
Definition: main.c:40
oldrefdef_t::vrectright_adj_shift20
int vrectright_adj_shift20
Definition: sw.h:139
R_ApplySIRDAlgorithum
void R_ApplySIRDAlgorithum(void)
Definition: sird.c:155
surf_s::flags
int flags
Definition: sw.h:252
sw_draworder
cvar_t * sw_draworder
Definition: main.c:79
viddef_t::width
int width
Definition: sw.h:127
maliastri_s::index_st
unsigned short index_st[3]
Definition: sw.h:277
sw_aliasstats
cvar_t * sw_aliasstats
Definition: main.c:76
surfcache_s::lightadj
int lightadj[MAX_LIGHTMAPS]
Definition: sw.h:210
d_scalemip
float d_scalemip[3]
Definition: misc.c:28
vup
vec3_t vup
Definition: main.c:49
espan_s::pnext
struct espan_s * pnext
Definition: sw.h:222
CYCLE
#define CYCLE
Definition: sw.h:74
polydesc_t::pixel_width
int pixel_width
Definition: sw.h:230
removeedges
edge_t * removeedges[MAXHEIGHT]
Definition: edge.c:42
viddef_t::height
int height
Definition: sw.h:128
edge_s::surfs
uint16_t surfs[2]
Definition: sw.h:264
polydesc_t::alpha
int alpha
Definition: sw.h:237
oldrefdef_t::fvrectright_adj
float fvrectright_adj
Definition: sw.h:140
sw_surfcacheoverride
cvar_t * sw_surfcacheoverride
Definition: main.c:84
surf_s::msurf
mface_t * msurf
Definition: sw.h:253
clipplane_s::reserved
byte reserved[2]
Definition: sw.h:199
R_DrawSubmodelPolygons
void R_DrawSubmodelPolygons(mmodel_t *pmodel, int clipflags, mnode_t *topnode)
Definition: bsp.c:313
c_surf
int c_surf
Definition: main.c:42
r_outofsurfaces
int r_outofsurfaces
Definition: main.c:37
finalvert_s::t
int t
Definition: sw.h:163
vpn
vec3_t vpn
Definition: main.c:50
newedges
edge_t * newedges[MAXHEIGHT]
Definition: edge.c:41
d_ziorigin
float d_ziorigin
Definition: sw.h:324
r_clipflags
int r_clipflags
Definition: main.c:44
R_DrawTriangle
void R_DrawTriangle(void)
Definition: polyset.c:113
r_maxsurfsseen
int r_maxsurfsseen
Definition: main.c:43
surfcache_s::image
image_t * image
Definition: sw.h:216
oldrefdef_t::yscale
float yscale
Definition: sw.h:146
viddef_t
Definition: sw.h:123
sintable
int sintable[CYCLE *2]
Definition: main.c:133
blanktable
int blanktable[CYCLE *2]
Definition: main.c:135
R_InitTurb
void R_InitTurb(void)
Definition: main.c:142
maliasvert_s::v
uint8_t v[3]
Definition: sw.h:281
cachewidth
int cachewidth
Definition: main.c:123
finalvert_s
Definition: sw.h:162
D_CacheSurface
surfcache_t * D_CacheSurface(mface_t *surface, int miplevel)
Definition: surf.c:330
r_drawworld
cvar_t * r_drawworld
Definition: main.c:96
clipplane_s::normal
vec3_t normal
Definition: sw.h:194
R_DrawSprite
void R_DrawSprite(void)
Definition: poly.c:835
oldrefdef_t::vrectrightedge
float vrectrightedge
Definition: sw.h:134
r_outofedges
int r_outofedges
Definition: main.c:38
oldrefdef_t::vrectright_particle
int vrectright_particle
Definition: sw.h:152
surf_s::spans
struct espan_s * spans
Definition: sw.h:246
sw_drawsird
cvar_t * sw_drawsird
Definition: main.c:93
R_InitCaches
void R_InitCaches(void)
Definition: surf.c:172
R_DrawSolidClippedSubmodelPolygons
void R_DrawSolidClippedSubmodelPolygons(mmodel_t *pmodel, mnode_t *topnode)
Definition: bsp.c:245
pfrustum_indexes
int * pfrustum_indexes[4]
Definition: main.c:70
espan_s::count
int count
Definition: sw.h:221
vid
viddef_t vid
Definition: main.c:22
finalvert_s::v
int v
Definition: sw.h:163
polydesc_t::pixels
byte * pixels
Definition: sw.h:229
maliasframe_s::translate
vec3_t translate
Definition: gl.h:227
edge_s::next
struct edge_s * next
Definition: sw.h:263
espan_t
struct espan_s espan_t
polydesc_t::t_offset
float t_offset
Definition: sw.h:234
oldrefdef_t::fvrecty_adj
float fvrecty_adj
Definition: sw.h:137
MAX_BLOCKLIGHTS
#define MAX_BLOCKLIGHTS
Definition: sw.h:202
bedge_s::pnext
struct bedge_s * pnext
Definition: sw.h:190
sadjust
fixed16_t sadjust
Definition: sw.h:466
surfcache_t
struct surfcache_s surfcache_t
d_tdivzstepv
float d_tdivzstepv
Definition: sw.h:323
WARP_WIDTH
#define WARP_WIDTH
Definition: sw.h:64
r_drawentities
cvar_t * r_drawentities
Definition: main.c:97
view_clipplanes
clipplane_t view_clipplanes[4]
Definition: raster.c:37
surf_s::entity
entity_t * entity
Definition: sw.h:254
viddef_t::rowbytes
int rowbytes
Definition: sw.h:125
oldrefdef_t::scale_for_mip
float scale_for_mip
Definition: sw.h:149
r_oldviewcluster
int r_oldviewcluster
Definition: sw.h:506
drawsurf_s::surf
mface_t * surf
Definition: sw.h:179
R_IMFlatShadedQuad
void R_IMFlatShadedQuad(vec3_t a, vec3_t b, vec3_t c, vec3_t d, color_t color, float alpha)
Definition: poly.c:791
r_dlightframecount
int r_dlightframecount
Definition: light.c:22
maliasframe_s::bounds
vec3_t bounds[2]
Definition: gl.h:228
surf_max
surf_t * surf_max
Definition: sw.h:365
R_InitSkyBox
void R_InitSkyBox(void)
Definition: sky.c:77
clipplane_s::leftedge
byte leftedge
Definition: sw.h:197
edge_s::u_step
fixed16_t u_step
Definition: sw.h:262
clipplane_s::rightedge
byte rightedge
Definition: sw.h:198
d_zistepv
float d_zistepv
Definition: sw.h:323
espan_s::v
int v
Definition: sw.h:221
polydesc_t::nump
int nump
Definition: sw.h:227
pixel_t
unsigned char pixel_t
Definition: sw.h:121
R_AliasClipTriangle
void R_AliasClipTriangle(finalvert_t *index0, finalvert_t *index1, finalvert_t *index2)
Definition: aclip.c:183
maliasframe_s::radius
vec_t radius
Definition: gl.h:229
surf_t
struct surf_s surf_t
oldrefdef_t::fvrectbottom
float fvrectbottom
Definition: sw.h:142
r_wholepolycount
int r_wholepolycount
Definition: main.c:68
edge_s::owner
medge_t * owner
Definition: sw.h:267
emitpoint_t
Definition: sw.h:156
drawsurf_s::lightadj
fixed8_t lightadj[MAX_LIGHTMAPS]
Definition: sw.h:180
drawsurf_s::rowbytes
int rowbytes
Definition: sw.h:178
D_DrawSpans16
void D_DrawSpans16(espan_t *pspans)
Definition: scan.c:222
maliasframe_t
struct maliasframe_s maliasframe_t
finalvert_s::xyz
float xyz[3]
Definition: sw.h:167
r_maxvalidedgeoffset
int r_maxvalidedgeoffset
surf_s::nearzi
float nearzi
Definition: sw.h:255
surfcache_s::mipscale
float mipscale
Definition: sw.h:215
R_TransformVector
void R_TransformVector(vec3_t in, vec3_t out)
Definition: misc.c:96
d_tdivzstepu
float d_tdivzstepu
Definition: sw.h:322
R_TransformPlane
void R_TransformPlane(cplane_t *p, float *normal, float *dist)
polydesc_t::dist
float dist
Definition: sw.h:233
r_framecount
int r_framecount
Definition: main.c:64
D_SCDump_f
void D_SCDump_f(void)
Definition: surf.c:311
d_zistepu
float d_zistepu
Definition: sw.h:322
edge_s::nearzi
float nearzi
Definition: sw.h:266
R_BuildGammaTable
void R_BuildGammaTable(void)
Definition: image.c:109
sw_mipscale
cvar_t * sw_mipscale
Definition: misc.c:25
clipplane_s::next
struct clipplane_s * next
Definition: sw.h:196
drawsurf_s::image
image_t * image
Definition: sw.h:181
sxformaxis
vec3_t sxformaxis[4]
surfcache_s::owner
struct surfcache_s ** owner
Definition: sw.h:209
R_EmitSkyBox
void R_EmitSkyBox(void)
Definition: sky.c:116
emitpoint_t::v
float v
Definition: sw.h:157
emitpoint_t::zi
float zi
Definition: sw.h:159
sw_clearcolor
cvar_t * sw_clearcolor
Definition: main.c:77
clipplane_s
Definition: sw.h:193
clipplane_t
struct clipplane_s clipplane_t
tadjust
fixed16_t tadjust
Definition: sw.h:326
espan_s::u
int u
Definition: sw.h:221
maliasst_s::t
signed short t
Definition: sw.h:272
edge_s::u
fixed16_t u
Definition: sw.h:261
edge_s::nextremove
struct edge_s * nextremove
Definition: sw.h:265
void
void(APIENTRY *qwglDrawBuffer)(GLenum mode)
D_DrawSurfaces
void D_DrawSurfaces(void)
Definition: edge.c:1001
finalvert_s::zi
int zi
Definition: sw.h:165
r_alias_one_minus_alpha
int r_alias_one_minus_alpha
Definition: alias.c:30
r_alpha_surfaces
mface_t * r_alpha_surfaces
Definition: poly.c:41
sw_drawflat
cvar_t * sw_drawflat
Definition: main.c:78
bedge_s
Definition: sw.h:188
r_warpbuffer
byte r_warpbuffer[WARP_WIDTH *WARP_HEIGHT *VID_BYTES]
Definition: main.c:33
txformaxis
vec3_t txformaxis[4]
D_DrawZSpans
void D_DrawZSpans(espan_t *pspans)
Definition: scan.c:352
surf_s::key
int key
Definition: sw.h:247
d_minmip
int d_minmip
Definition: misc.c:27
sw_waterwarp
cvar_t * sw_waterwarp
Definition: main.c:85
sw_dynamic
cvar_t * sw_dynamic
Definition: main.c:86
r_frustum_indexes
int r_frustum_indexes[4 *6]
Definition: main.c:71
maliasst_t
struct maliasst_s maliasst_t
R_RenderWorld
void R_RenderWorld(void)
Definition: bsp.c:474
affinetridesc_t::skinwidth
int skinwidth
Definition: sw.h:172
vid_gamma
cvar_t * vid_gamma
Definition: main.c:104
surf_s::d_zistepv
float d_zistepv
Definition: sw.h:257
surf_s::d_zistepu
float d_zistepu
Definition: sw.h:257
r_amodels_drawn
int r_amodels_drawn
Definition: alias.c:25
surfaces
surf_t * surfaces
Definition: edge.c:35
drawsurf_s::surfmip
int surfmip
Definition: sw.h:182
emitpoint_t::t
float t
Definition: sw.h:158
D_DrawTurbulent16
void D_DrawTurbulent16(espan_t *pspan, int *warptable)
Definition: scan.c:83
aliastriangleparms_t
Definition: sw.h:293
VID_BYTES
#define VID_BYTES
Definition: sw.h:49
R_DrawAlphaSurfaces
void R_DrawAlphaSurfaces(void)
Definition: poly.c:764
entity_rotation
vec3_t entity_rotation[3]
Definition: bsp.c:32
r_lerpmodels
cvar_t * r_lerpmodels
Definition: main.c:99
r_polycount
int r_polycount
Definition: main.c:66
intsintable
int intsintable[CYCLE *2]
Definition: main.c:134
r_drawnpolycount
int r_drawnpolycount
Definition: main.c:67
R_PrintAliasStats
void R_PrintAliasStats(void)
Definition: misc.c:58
R_RenderBmodelFace
void R_RenderBmodelFace(bedge_t *pedges, mface_t *psurf)
Definition: raster.c:477
r_ptvertsmax
mvertex_t * r_ptvertsmax
Definition: sw.h:469
bbextentt
fixed16_t bbextentt
Definition: sw.h:327
edge_max
edge_t * edge_max
Definition: sw.h:479
surf_s::d_ziorigin
float d_ziorigin
Definition: sw.h:257
c
statCounters_t c
Definition: main.c:30
r_worldentity
entity_t r_worldentity
Definition: main.c:26
r_speeds
cvar_t * r_speeds
Definition: main.c:102
oldrefdef_t::vrect
vrect_t vrect
Definition: sw.h:132
D_WarpScreen
void D_WarpScreen(void)
Definition: scan.c:32
d_viewbuffer
pixel_t * d_viewbuffer
Definition: main.c:125
polydesc_t::one_minus_alpha
int one_minus_alpha
Definition: sw.h:238
R_RenderFace
void R_RenderFace(mface_t *fa, int clipflags)
Definition: raster.c:328
oldrefdef_t
Definition: sw.h:131
r_numallocatededges
int r_numallocatededges
Definition: main.c:36
oldrefdef_t::yscaleinv
float yscaleinv
Definition: sw.h:147
LIGHTMAP_BYTES
#define LIGHTMAP_BYTES
Definition: sw.h:203
WARP_HEIGHT
#define WARP_HEIGHT
Definition: sw.h:65
masliasvert_s
Definition: gl.h:220
R_AliasDrawModel
void R_AliasDrawModel(void)
Definition: alias.c:674
R_PrintTimes
void R_PrintTimes(void)
Definition: misc.c:38
polydesc_t
Definition: sw.h:226
edge_s::prev
struct edge_s * prev
Definition: sw.h:263
R_InitImages
void R_InitImages(void)
Definition: image.c:164
surf_s::last_u
int last_u
Definition: sw.h:248
finalvert_s::s
int s
Definition: sw.h:163
drawsurf_s::surfwidth
int surfwidth
Definition: sw.h:183
currententity
entity_t * currententity
Definition: bsp.c:26
r_cnumsurfs
int r_cnumsurfs
Definition: sw.h:502
oldrefdef_t::yscaleshrink
float yscaleshrink
Definition: sw.h:148
r_affinetridesc
affinetridesc_t r_affinetridesc
Definition: alias.c:27
bedge_s::v
mvertex_t * v[2]
Definition: sw.h:189
surf_s::insubmodel
qboolean insubmodel
Definition: sw.h:256
polydesc_t::vup
vec3_t vup
Definition: sw.h:232
oldrefdef_t::pix_shift
int pix_shift
Definition: sw.h:153
surfcache_s::data
byte data[4]
Definition: sw.h:217
finalvert_s::flags
int flags
Definition: sw.h:166
R_SetupFrame
void R_SetupFrame(void)
Definition: misc.c:243
maliasst_s::s
signed short s
Definition: sw.h:271
R_ShutdownImages
void R_ShutdownImages(void)
Definition: image.c:180
d_pzbuffer
short * d_pzbuffer
Definition: main.c:127
r_drawsurf
drawsurf_t r_drawsurf
Definition: surf.c:22
client.h
sw_mode
cvar_t * sw_mode
c_faceclip
int c_faceclip
Definition: raster.c:35
drawsurf_s::surfdat
byte * surfdat
Definition: sw.h:177
R_AliasProjectAndClipTestFinalVert
void R_AliasProjectAndClipTestFinalVert(finalvert_t *fv)
Definition: alias.c:188
aliastriangleparms_t::c
finalvert_t * c
Definition: sw.h:294
oldrefdef_t::vrectright
int vrectright
Definition: sw.h:133
maliastri_t
struct maliastri_s maliastri_t
r_currentbkey
int r_currentbkey
Definition: bsp.c:34
r_fullbright
cvar_t * r_fullbright
Definition: main.c:98
modelorg
vec3_t modelorg
Definition: bsp.c:27
surf_s::prev
struct surf_s * prev
Definition: sw.h:245
r_viewcluster
int r_viewcluster
Definition: main.c:74
R_BuildLightMap
void R_BuildLightMap(void)
Definition: light.c:290
sw_reportsurfout
cvar_t * sw_reportsurfout
Definition: main.c:83
oldrefdef_t::vrect_x_adj_shift20
int vrect_x_adj_shift20
Definition: sw.h:138
d_screenrowbytes
int d_screenrowbytes
Definition: main.c:126
surfcache_s::dlight
int dlight
Definition: sw.h:211
r_origin
vec3_t r_origin
Definition: main.c:52
base_vup
vec3_t base_vup
Definition: sw.h:360
base_vpn
vec3_t base_vpn
Definition: sw.h:361
color
static vec4_t color
Definition: mesh.c:33
clipplane_s::dist
float dist
Definition: sw.h:195
surfcache_s::width
unsigned width
Definition: sw.h:213
maliasvert_s
Definition: sw.h:280
r_visframecount
int r_visframecount
Definition: main.c:65
auxedges
edge_t * auxedges
Definition: edge.c:31
r_ptverts
mvertex_t * r_ptverts
r_alias_alpha
int r_alias_alpha
Definition: alias.c:29
oldrefdef_t::ycenter
float ycenter
Definition: sw.h:145
r_entorigin
vec3_t r_entorigin
Definition: bsp.c:29
bbextents
fixed16_t bbextents
Definition: sw.h:467
affinetridesc_t::skinheight
int skinheight
Definition: sw.h:173
polydesc_t::pverts
emitpoint_t * pverts
Definition: sw.h:228
d_sdivzstepv
float d_sdivzstepv
Definition: main.c:117
bedge_t
struct bedge_s bedge_t
vid_fullscreen
cvar_t * vid_fullscreen
Definition: refresh.c:33
finalvert_t
struct finalvert_s finalvert_t
r_refdef
oldrefdef_t r_refdef
Definition: main.c:57
base_vright
vec3_t base_vright
Definition: sw.h:362
d_spantable
byte * d_spantable[MAXHEIGHT]
Definition: main.c:130
MAXHEIGHT
#define MAXHEIGHT
Definition: sw.h:57
R_FreeCaches
void R_FreeCaches(void)
Definition: surf.c:206
surfcache_s::next
struct surfcache_s * next
Definition: sw.h:208
polydesc_t::pixel_height
int pixel_height
Definition: sw.h:231
maliasframe_s
Definition: gl.h:225
auxsurfaces
surf_t * auxsurfaces
Definition: edge.c:34
aliastriangleparms
aliastriangleparms_t aliastriangleparms
Definition: polyset.c:47
D_FlushCaches
void D_FlushCaches(void)
Definition: surf.c:222
maliasframe_s::verts
maliasvert_t * verts
Definition: sw.h:290
R_LightPoint
void R_LightPoint(vec3_t p, vec3_t color)
Definition: light.c:174
r_edges
edge_t * r_edges
Definition: edge.c:32
sw_maxedges
cvar_t * sw_maxedges
Definition: main.c:80
maliastri_s
Definition: sw.h:275
d_zspantable
short * d_zspantable[MAXHEIGHT]
Definition: main.c:131
surf_s
Definition: sw.h:243
finalvert_s::l
int l
Definition: sw.h:164
maliasvert_s::lightnormalindex
uint8_t lightnormalindex
Definition: sw.h:282
cacheblock
pixel_t * cacheblock
Definition: main.c:122
d_zrowbytes
int d_zrowbytes
Definition: main.c:128
edge_s
Definition: sw.h:260
sw_maxsurfs
cvar_t * sw_maxsurfs
Definition: main.c:81
d_sdivzorigin
float d_sdivzorigin
Definition: main.c:118
surf_s::spanstate
int spanstate
Definition: sw.h:249
d_tdivzorigin
float d_tdivzorigin
Definition: sw.h:324
sw_mipcap
cvar_t * sw_mipcap
Definition: misc.c:24
oldrefdef_t::fvrecty
float fvrecty
Definition: sw.h:136
affinetridesc_t::pskin
void * pskin
Definition: sw.h:171
R_NewMap
void R_NewMap(void)
Definition: main.c:331
r_surfsonstack
qboolean r_surfsonstack