vkQuake2 doxygen  1.0 dev
r_local.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
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (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.
12 
13 See the GNU General Public License for more details.
14 
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 
19 */
20 
21 #include <stdio.h>
22 #include <stdlib.h>
23 #include <string.h>
24 #include <math.h>
25 #include <stdarg.h>
26 
27 #include "../client/ref.h"
28 
29 #ifdef id386
30 #undef id386
31 #define id386 0
32 #else
33 #define id386 0
34 #endif
35 #define COLMODEL //qb: tnq2
36 #define REF_VERSION "KolorSoft 1.1" //qb: LOL
37 
38 // up / down
39 #define PITCH 0
40 
41 // left / right
42 #define YAW 1
43 
44 // fall over
45 #define ROLL 2
46 
47 #define CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x))) //qb: handy
48 
49 /*
50 
51  skins will be outline flood filled and mip mapped
52  pics and sprites with alpha will be outline flood filled
53  pic won't be mip mapped
54 
55  model skin
56  sprite frame
57  wall texture
58  pic
59 
60 */
61 
62 typedef enum
63 {
69 } imagetype_t;
70 
71 typedef struct image_s
72 {
73  char name[MAX_QPATH]; // game path, including extension
75  int width, height;
76  qboolean transparent; // true if any 255 pixels in image
77  int registration_sequence; // 0 = free
78  byte *pixels[4]; // mip levels
79 } image_t;
80 
81 
82 //===================================================================
83 
84 typedef unsigned char pixel_t;
85 
86 typedef struct vrect_s
87 {
88  int x,y,width,height;
89  struct vrect_s *pnext;
90 } vrect_t;
91 
92 typedef struct
93 {
94  pixel_t *buffer; // invisible buffer
95  pixel_t *colormap; // 256 * VID_GRADES size
96  pixel_t *alphamap; // 256 * 256 translucency map
97  int rowbytes; // may be > width if displayed in a window
98  // can be negative for stupid dibs
99  int width;
100  int height;
101 } viddef_t;
102 
103 typedef enum
104 {
106 
109 
111 } rserr_t;
112 
113 extern viddef_t vid;
114 
115 // !!! if this is changed, it must be changed in asm_draw.h too !!!
116 typedef struct
117 {
118  vrect_t vrect; // subwindow in video for refresh
119  // FIXME: not need vrect next field here?
120  vrect_t aliasvrect; // scaled Alias version
121  int vrectright, vrectbottom; // right & bottom screen coords
122  int aliasvrectright, aliasvrectbottom; // scaled Alias versions
123  float vrectrightedge; // rightmost right edge we care about,
124  // for use in edge list
125  float fvrectx, fvrecty; // for floating-point compares
126  float fvrectx_adj, fvrecty_adj; // left and top edges, for clamping
127  int vrect_x_adj_shift20; // (vrect.x + 0.5 - epsilon) << 20
128  int vrectright_adj_shift20; // (vrectright + 0.5 - epsilon) << 20
129  float fvrectright_adj, fvrectbottom_adj;
130  // right and bottom edges, for clamping
131  float fvrectright; // rightmost edge, for Alias clamping
132  float fvrectbottom; // bottommost edge, for Alias clamping
133  float horizontalFieldOfView; // at Z = 1.0, this many X is visible
134  // 2.0 = 90 degrees
135  float xOrigin; // should probably always be 0.5
136  float yOrigin; // between be around 0.3 to 0.5
137 
140 
141  unsigned ambientlight;
142 } oldrefdef_t;
143 
144 extern oldrefdef_t r_refdef;
145 
146 #include "r_model.h"
147 
148 #define CACHE_SIZE 32
149 
150 /*
151 ====================================================
152 
153  CONSTANTS
154 
155 ====================================================
156 */
157 
158 #define VID_CBITS 6
159 #define VID_GRADES (1 << VID_CBITS)
160 
161 
162 // r_shared.h: general refresh-related stuff shared between the refresh and the
163 // driver
164 
165 
166 #define MAXVERTS 64 // max points in a surface polygon
167 #define MAXWORKINGVERTS (MAXVERTS+4) // max points in an intermediate
168  // polygon (while processing)
169 // !!! if this is changed, it must be changed in d_ifacea.h too !!!
170 #define MAXHEIGHT 1200
171 #define MAXWIDTH 1600
172 
173 #define INFINITE_DISTANCE 0x10000 // distance that's always guaranteed to
174  // be farther away than anything in
175  // the scene
176 
177 
178 // d_iface.h: interface header file for rasterization driver modules
179 
180 #define WARP_WIDTH 320
181 #define WARP_HEIGHT 240
182 
183 
184 #define MAX_LBM_HEIGHT 480
185 
186 
187 #define PARTICLE_Z_CLIP 8.0
188 
189 // !!! must be kept the same as in quakeasm.h !!!
190 #define TRANSPARENT_COLOR 0xFF
191 
192 
193 // !!! if this is changed, it must be changed in d_ifacea.h too !!!
194 #define TURB_TEX_SIZE 64 // base turbulent texture size
195 
196 // !!! if this is changed, it must be changed in d_ifacea.h too !!!
197 #define CYCLE 128 // turbulent cycle size
198 
199 #define SCANBUFFERPAD 0x1000
200 
201 #define DS_SPAN_LIST_END -128
202 
203 //qb: increased to solve dropped faces in maps with large open spaces like SMD
204 #define NUMSTACKEDGES 8192 //qb: 8192 per qsb - was 2400
205 #define MINEDGES NUMSTACKEDGES
206 #define NUMSTACKSURFACES 8192 //qb: 8192 per qsb - was 1000
207 #define MINSURFACES NUMSTACKSURFACES
208 #define MAXSPANS 8192 //qb: was 3000.
209 
210 // flags in finalvert_t.flags
211 #define ALIAS_LEFT_CLIP 0x0001
212 #define ALIAS_TOP_CLIP 0x0002
213 #define ALIAS_RIGHT_CLIP 0x0004
214 #define ALIAS_BOTTOM_CLIP 0x0008
215 #define ALIAS_Z_CLIP 0x0010
216 #define ALIAS_XY_CLIP_MASK 0x000F
217 
218 #define SURFCACHE_SIZE_AT_320X240 1024*768
219 
220 #define BMODEL_FULLY_CLIPPED 0x10 // value returned by R_BmodelCheckBBox ()
221  // if bbox is trivially rejected
222 
223 #define XCENTERING (1.0 / 2.0)
224 #define YCENTERING (1.0 / 2.0)
225 
226 #define CLIP_EPSILON 0.001
227 
228 #define BACKFACE_EPSILON 0.01
229 
230 // !!! if this is changed, it must be changed in asm_draw.h too !!!
231 #define NEAR_CLIP 0.01
232 
233 
234 #define MAXALIASVERTS 2000 // TODO: tune this
235 #define ALIAS_Z_CLIP_PLANE 4
236 
237 // turbulence stuff
238 
239 #define AMP 8*0x10000
240 #define AMP2 3
241 #define SPEED 20
242 
243 #define LIGHT_MIN 5 // lowest light value we'll allow, to avoid the
244 // need for inner-loop light clamping
245 
246 
247 /*
248 ====================================================
249 
250 TYPES
251 
252 ====================================================
253 */
254 
255 typedef struct
256 {
257  float u, v;
258  float s, t;
259  float zi;
260 } emitpoint_t;
261 
262 /*
263 ** if you change this structure be sure to change the #defines
264 ** listed after it!
265 */
266 #define SMALL_FINALVERT 0
267 
268 #if SMALL_FINALVERT
269 
270 typedef struct finalvert_s {
271  short u, v, s, t;
272  int l;
273  int zi;
274  int flags;
275  float xyz[3]; // eye space
276 } finalvert_t;
277 
278 #define FINALVERT_V0 0
279 #define FINALVERT_V1 2
280 #define FINALVERT_V2 4
281 #define FINALVERT_V3 6
282 #define FINALVERT_V4 8
283 #define FINALVERT_V5 12
284 #define FINALVERT_FLAGS 16
285 #define FINALVERT_X 20
286 #define FINALVERT_Y 24
287 #define FINALVERT_Z 28
288 #define FINALVERT_SIZE 32
289 
290 #else
291 
292 typedef struct finalvert_s {
293  int u, v, s, t;
294  int l;
295  int zi;
296  int flags;
297  float xyz[3]; // eye space
298 #ifdef COLMODEL
299  // leilei - colored light
300  int lr, lg, lb;
301 #endif
302 } finalvert_t;
303 
304 #define FINALVERT_V0 0
305 #define FINALVERT_V1 4
306 #define FINALVERT_V2 8
307 #define FINALVERT_V3 12
308 #define FINALVERT_V4 16
309 #define FINALVERT_V5 20
310 #define FINALVERT_FLAGS 24
311 #define FINALVERT_X 28
312 #define FINALVERT_Y 32
313 #define FINALVERT_Z 36
314 
315 #ifdef COLMODEL
316 #define FINALVERT_LR 40
317 #define FINALVERT_LG 44
318 #define FINALVERT_LB 48
319 #define FINALVERT_SIZE 52
320 #else
321 #define FINALVERT_SIZE 40
322 #endif
323 
324 #endif
325 
326 typedef struct
327 {
328  void *pskin;
335  int drawtype;
340 
341 typedef struct
342 {
343  byte *surfdat; // destination for generated surface
344  int rowbytes; // destination logical width in bytes
345  msurface_t *surf; // description for surface to generate
347  // adjust for lightmap levels for dynamic lighting
349  int surfmip; // mipmapped ratio of surface texels / world pixels
350  int surfwidth; // in mipmapped texels
351  int surfheight; // in mipmapped texels
352 } drawsurf_t;
353 
354 
355 
356 typedef struct {
359  float *plightvec;
360 
361  // leilei - colored lighting
362 
363  float *prlightvec;
364  float *pglightvec;
365  float *pblightvec;
366 } alight_t;
367 
368 // clipped bmodel edges
369 
370 typedef struct bedge_s
371 {
373  struct bedge_s *pnext;
374 } bedge_t;
375 
376 
377 // !!! if this is changed, it must be changed in asm_draw.h too !!!
378 typedef struct clipplane_s
379 {
381  float dist;
382  struct clipplane_s *next;
383  byte leftedge;
384  byte rightedge;
385  byte reserved[2];
386 } clipplane_t;
387 
388 
389 typedef struct surfcache_s
390 {
391  struct surfcache_s *next;
392  struct surfcache_s **owner; // NULL is an empty chunk of memory
393  int lightadj[MAXLIGHTMAPS]; // checked for strobe flush
394  int dlight;
395  int size; // including header
396  unsigned width;
397  unsigned height; // DEBUG only needed for debug
398  float mipscale;
400  byte data[4]; // width*height elements
401 } surfcache_t;
402 
403 // !!! if this is changed, it must be changed in asm_draw.h too !!!
404 typedef struct espan_s
405 {
406  int u, v, count;
407  struct espan_s *pnext;
408 } espan_t;
409 
410 // used by the polygon drawer (R_POLY.C) and sprite setup code (R_SPRITE.C)
411 typedef struct
412 {
413  int nump;
415  byte *pixels; // image
416  int pixel_width; // image width
417  int pixel_height; // image height
418  vec3_t vup, vright, vpn; // in worldspace, for plane eq
419  float dist;
420  float s_offset, t_offset;
421  float viewer_position[3];
422  void (*drawspanlet)( void );
424 } polydesc_t;
425 
426 // FIXME: compress, make a union if that will help
427 // insubmodel is only 1, flags is fewer than 32, spanstate could be a byte
428 typedef struct surf_s
429 {
430  struct surf_s *next; // active surface stack in r_edge.c
431  struct surf_s *prev; // used in r_edge.c for active surf stack
432  struct espan_s *spans; // pointer to linked list of spans to draw
433  int key; // sorting key (BSP order)
434  int last_u; // set during tracing
435  int spanstate; // 0 = not in span
436  // 1 = in span
437  // -1 = in inverted span (end before
438  // start)
439  int flags; // currentface flags
442  float nearzi; // nearest 1/z on surface, for mipmapping
445 
446  int pad[2]; // to 64 bytes
447 } surf_t;
448 
449 // !!! if this is changed, it must be changed in asm_draw.h too !!!
450 typedef struct edge_s
451 {
454  struct edge_s *prev, *next;
455  unsigned short surfs[2];
457  float nearzi;
459 } edge_t;
460 
461 
462 /*
463 ====================================================
464 
465 VARS
466 
467 ====================================================
468 */
469 
470 extern int d_spanpixcount;
471 extern int r_framecount; // sequence # of current frame since Quake
472  // started
473 extern float r_aliasuvscale; // scale-up factor for screen u and v
474  // on Alias vertices passed to driver
475 extern qboolean r_dowarp;
476 
478 
480 
481 void D_DrawSurfaces (void);
482 void R_DrawParticle( void );
483 void D_ViewChanged (void);
484 void D_WarpScreen (void);
485 void R_PolysetUpdateTables (void);
486 
487 extern void *acolormap; // FIXME: should go away
488 
489 //qb: leilei - colored lighting
490 extern byte palmap2[64][64][64]; // Colored Lighting Lookup Table
491 
492 void R_AliasClipTriangleRGB(finalvert_t *index0, finalvert_t *index1, finalvert_t *index2);
493 
494 
495 //=======================================================================//
496 
497 // callbacks to Quake
498 
499 extern drawsurf_t r_drawsurf;
500 
501 void R_DrawSurface (void);
502 
503 extern int c_surf;
504 
505 //extern byte r_warpbuffer[WARP_WIDTH * WARP_HEIGHT];
506 extern byte *r_warpbuffer;
507 extern int r_warpwidth;
508 extern int r_warpheight;
509 
510 
511 extern float scale_for_mip;
512 
513 extern qboolean d_roverwrapped;
514 extern surfcache_t *sc_rover;
516 
520 
523 
524 
525 void D_DrawSpans16 (espan_t *pspans);
526 void D_DrawZSpans (espan_t *pspans);
527 void Turbulent8 (espan_t *pspan);
528 void NonTurbulent8 (espan_t *pspan); //PGM
529 
531 
533 
535 
536 extern pixel_t *d_viewbuffer;
537 extern short *d_pzbuffer;
538 extern unsigned int d_zrowbytes, d_zwidth;
539 extern short *zspantable[MAXHEIGHT];
540 extern int d_scantable[MAXHEIGHT];
541 
542 extern int d_minmip;
543 extern float d_scalemip[3];
544 
545 //===================================================================
546 
547 extern int cachewidth;
548 extern pixel_t *cacheblock;
549 extern int r_screenwidth;
550 
551 extern int r_drawnpolycount;
552 
553 extern int sintable[4200];
554 extern int intsintable[4200];
555 extern int blanktable[4200]; // PGM
556 
560 
562 
563 // surfaces are generated in back to front order by the bsp, so if a surf
564 // pointer is greater than another one, it should be drawn in front
565 // surfaces[1] is the background, and is used as the active surface stack.
566 // surfaces[0] is a dummy, because index 0 is used to indicate no surface
567 // attached to an edge_t
568 
569 //===================================================================
570 
571 extern vec3_t sxformaxis[4]; // s axis transformed into viewspace
572 extern vec3_t txformaxis[4]; // t axis transformed into viewspac
573 
574 extern float xcenter, ycenter;
575 extern float xscale, yscale;
576 extern float xscaleinv, yscaleinv;
578 
579 extern void TransformVector (vec3_t in, vec3_t out);
580 extern void SetUpForLineScan(fixed8_t startvertu, fixed8_t startvertv,
581  fixed8_t endvertu, fixed8_t endvertv);
582 
584 
585 //===========================================================================
586 
587 extern cvar_t *sw_aliasstats;
588 extern cvar_t *sw_clearcolor;
589 extern cvar_t *sw_drawflat;
590 extern cvar_t *sw_draworder;
591 extern cvar_t *sw_maxedges;
592 extern cvar_t *sw_maxsurfs;
593 extern cvar_t *sw_mipcap;
594 extern cvar_t *sw_mipscale;
595 extern cvar_t *sw_mode;
596 extern cvar_t *sw_reportsurfout;
597 extern cvar_t *sw_reportedgeout;
598 extern cvar_t *sw_stipplealpha;
600 extern cvar_t *sw_waterwarp;
601 extern cvar_t *sw_transmooth; // texture dither on transparencies
602 
603 extern cvar_t *r_fullbright;
604 extern cvar_t *r_lefthand;
605 extern cvar_t *r_drawentities;
606 extern cvar_t *r_drawworld;
607 extern cvar_t *r_dspeeds;
608 extern cvar_t *r_lerpmodels;
609 
610 extern cvar_t *r_speeds;
611 
612 extern cvar_t *r_lightlevel; //FIXME HACK
613 
614 extern cvar_t *vid_fullscreen;
615 extern cvar_t *vid_gamma;
616 
617 extern cvar_t *r_customwidth;
618 extern cvar_t *r_customheight;
619 extern cvar_t *r_coloredlights; // leilei
620 extern cvar_t *r_lightsaturation;
621 //extern cvar_t *sw_transquality; // leilei
622 
623 extern clipplane_t view_clipplanes[4];
624 extern int *pfrustum_indexes[4];
625 extern byte *thepalette; //qb: keep the palette around.
626 
627 
628 //=============================================================================
629 
630 void R_RenderWorld (void);
631 
632 //=============================================================================
633 
634 extern mplane_t screenedge[4];
635 
636 extern vec3_t r_origin;
637 
638 extern entity_t r_worldentity;
639 extern model_t *currentmodel;
640 extern entity_t *currententity;
641 extern vec3_t modelorg;
642 extern vec3_t r_entorigin;
643 
644 
645 float shadelight[3]; //qb: put it here
646 
647 extern float verticalFieldOfView;
648 extern float xOrigin, yOrigin;
649 
650 extern int r_visframecount;
651 
653 extern int coloredlights; //qb: moved here
654 
655 //=============================================================================
656 
657 void R_ClearPolyList (void);
658 void R_DrawPolyList (void);
659 
660 //
661 // current entity info
662 //
663 extern qboolean insubmodel;
664 
665 void R_DrawAlphaSurfaces( void );
666 
667 void R_DrawSprite (void);
668 void R_DrawBeam( entity_t *e );
669 
670 void R_RenderFace (msurface_t *fa, int clipflags);
671 void R_RenderBmodelFace (bedge_t *pedges, msurface_t *psurf);
672 void R_TransformPlane (mplane_t *p, float *normal, float *dist);
673 void R_TransformFrustum (void);
674 void R_DrawSurfaceBlock16 (void);
675 void R_DrawSurfaceBlock8 (void);
676 
677 #if id386
678 
679 void R_DrawSurfaceBlock8_mip0 (void);
680 void R_DrawSurfaceBlock8_mip1 (void);
681 void R_DrawSurfaceBlock8_mip2 (void);
682 void R_DrawSurfaceBlock8_mip3 (void);
683 
684 #endif
685 
686 // leilei - colored lighting
687 void R_DrawSurfaceBlock8RGB_mip0 (void);
688 void R_DrawSurfaceBlock8RGB_mip1 (void);
689 void R_DrawSurfaceBlock8RGB_mip2 (void);
690 void R_DrawSurfaceBlock8RGB_mip3 (void);
691 // o^_^o
692 
693 
694 void R_GenSkyTile (void *pdest);
695 void R_GenSkyTile16 (void *pdest);
696 void R_Surf8Patch (void);
697 void R_Surf16Patch (void);
698 void R_DrawSubmodelPolygons (model_t *pmodel, int clipflags, mnode_t *topnode);
699 void R_DrawSolidClippedSubmodelPolygons (model_t *pmodel, mnode_t *topnode);
700 
701 void R_AddPolygonEdges (emitpoint_t *pverts, int numverts, int miplevel);
702 surf_t *R_GetSurf (void);
703 void R_AliasDrawModel (void);
704 void R_BeginEdgeFrame (void);
705 void R_ScanEdges (void);
706 void D_DrawSurfaces (void);
707 void R_InsertNewEdges (edge_t *edgestoadd, edge_t *edgelist);
708 void R_StepActiveU (edge_t *pedge);
709 void R_RemoveEdges (edge_t *pedge);
710 void R_PushDlights (model_t *model);
711 void R_LightPointColor(vec3_t p, vec3_t color); //qb: use this
712 
713 byte BestColor(int r, int g, int b, int start, int stop); //for colored light
714 int FindColor(int r, int g, int b);
715 void Draw_InitRGBMap(void);
716 
717 extern void R_Surf8Start (void);
718 extern void R_Surf8End (void);
719 extern void R_Surf16Start (void);
720 extern void R_Surf16End (void);
721 extern void R_EdgeCodeStart (void);
722 extern void R_EdgeCodeEnd (void);
723 
724 extern void R_RotateBmodel (void);
725 
726 extern int c_faceclip;
727 extern int r_polycount;
728 extern int r_wholepolycount;
729 
731 
734 
736 
737 extern float entity_rotation[3][3];
738 
739 extern int r_currentkey;
740 extern int r_currentbkey;
741 
742 void R_InitTurb (void);
743 
744 void R_DrawParticles (void);
745 void R_SurfacePatch (void);
746 
747 extern int r_amodels_drawn;
748 extern edge_t *auxedges;
749 extern int r_numallocatededges;
751 
752 extern edge_t *newedges[MAXHEIGHT];
753 extern edge_t *removeedges[MAXHEIGHT];
754 
755 // FIXME: make stack vars when debugging done
756 extern edge_t edge_head;
757 extern edge_t edge_tail;
758 extern edge_t edge_aftertail;
759 
760 extern int r_aliasblendcolor;
761 
763 
764 extern int r_outofsurfaces;
765 extern int r_outofedges;
766 
768 extern int r_maxvalidedgeoffset;
769 
770 typedef struct
771 {
772  finalvert_t *a, *b, *c;
774 
776 
777 void R_DrawTriangle( void );
778 //void R_DrawTriangle (finalvert_t *index0, finalvert_t *index1, finalvert_t *index2);
779 void R_AliasClipTriangle (finalvert_t *index0, finalvert_t *index1, finalvert_t *index2);
780 
781 
782 extern float r_time1;
783 extern float da_time1, da_time2;
786 extern int r_frustum_indexes[4*6];
788 extern qboolean r_surfsonstack;
789 
790 extern mleaf_t *r_viewleaf;
792 
793 extern int r_clipflags;
794 extern int r_dlightframecount;
796 
797 extern image_t *r_notexture_mip;
798 extern model_t *r_worldmodel;
799 
800 void R_PrintAliasStats (void);
801 void R_PrintTimes (void);
802 void R_PrintDSpeeds (void);
803 void R_AnimateLight (void);
804 void R_LightPoint (vec3_t p, vec3_t color);
805 void R_SetupFrame (void);
806 void R_cshift_f (void);
807 void R_EmitEdge (mvertex_t *pv0, mvertex_t *pv1);
808 void R_ClipEdge (mvertex_t *pv0, mvertex_t *pv1, clipplane_t *clip);
809 void R_SplitEntityOnNode2 (mnode_t *node);
810 
811 extern refdef_t r_newrefdef;
812 
814 
815 extern void *colormap;
816 
817 //====================================================================
818 
819 float R_DLightPoint (vec3_t p);
820 
821 void R_NewMap (void);
822 void R_Register (void);
823 void R_UnRegister (void);
824 void Draw_InitLocal (void);
825 qboolean R_Init( void *hInstance, void *wndProc );
826 void R_Shutdown (void);
827 void R_InitCaches (void);
828 void D_FlushCaches (void);
829 
830 void R_ScreenShot_f( void );
831 void R_BeginRegistration (char *map);
832 struct model_s *R_RegisterModel (char *name);
833 void R_EndRegistration (void);
834 
835 void R_RenderFrame (refdef_t *fd);
836 
837 struct image_s *Draw_FindPic (char *name);
838 
839 void Draw_GetPicSize (int *w, int *h, char *name);
840 void Draw_Pic (int x, int y, char *name);
841 void Draw_StretchPic (int x, int y, int w, int h, char *name);
842 void Draw_StretchRaw (int x, int y, int w, int h, int cols, int rows, byte *data);
843 void Draw_Char (int x, int y, int c);
844 void Draw_TileClear (int x, int y, int w, int h, char *name);
845 void Draw_Fill (int x, int y, int w, int h, int c);
846 void Draw_FadeScreen (void);
847 
848 void Draw_GetPalette (void);
849 
850 void R_BeginFrame( float camera_separation );
851 
852 void R_CinematicSetPalette( const unsigned char *palette );
853 
854 extern unsigned d_8to24table[256]; // base
855 extern unsigned d_8to24tabble[256]; // base
856 
857 void Sys_MakeCodeWriteable (unsigned long startaddr, unsigned long length);
858 void Sys_SetFPCW (void);
859 
860 void LoadPCX (char *filename, byte **pic, byte **palette, int *width, int *height);
861 
862 void R_InitImages (void);
863 void R_ShutdownImages (void);
865 void R_FreeUnusedImages (void);
866 
867 void R_GammaCorrectAndSetPalette( const unsigned char *pal );
868 
869 #ifdef QMAX
870 void R_AddStain (vec3_t org, float intensity, float r, float g, float b);
871 void Draw_ScaledPic (int x, int y, float scale, float alpha, char *pic);
872 #endif
873 
874 extern mtexinfo_t *sky_texinfo[6];
875 
876 void R_InitSkyBox (void);
877 
878 typedef struct swstate_s
879 {
881  int prev_mode; // last valid SW mode
882 
883  byte gammatable[256];
884  byte currentpalette[1024];
885 
886 } swstate_t;
887 
888 void R_IMFlatShadedQuad( vec3_t a, vec3_t b, vec3_t c, vec3_t d, int color, float alpha );
889 
890 extern swstate_t sw_state;
891 
892 /*
893 ====================================================================
894 
895 IMPORTED FUNCTIONS
896 
897 ====================================================================
898 */
899 
900 extern refimport_t ri;
901 
902 /*
903 ====================================================================
904 
905 IMPLEMENTATION FUNCTIONS
906 
907 ====================================================================
908 */
909 
910 void SWimp_BeginFrame( float camera_separation );
911 void SWimp_EndFrame (void);
912 int SWimp_Init( void *hInstance, void *wndProc );
913 void SWimp_SetPalette( const unsigned char *palette);
914 void SWimp_Shutdown( void );
915 rserr_t SWimp_SetMode(int *pwidth, int *pheight, int mode, qboolean fullscreen);
916 void SWimp_AppActivate( qboolean active );
917 
R_InitTurb
void R_InitTurb(void)
Definition: r_main.c:246
R_ClipEdge
void R_ClipEdge(mvertex_t *pv0, mvertex_t *pv1, clipplane_t *clip)
Definition: r_rast.c:398
drawsurf_t::image
image_t * image
Definition: r_local.h:348
r_model.h
it_sprite
@ it_sprite
Definition: r_local.h:65
sky_texinfo
mtexinfo_t * sky_texinfo[6]
r_maxedgesseen
int r_maxedgesseen
Definition: r_local.h:787
d_scalemip
float d_scalemip[3]
Definition: r_misc.c:32
cachewidth
int cachewidth
Definition: r_main.c:195
surfcache_s::size
int size
Definition: r_local.h:395
c_surf
int c_surf
Definition: r_main.c:64
rserr_t
rserr_t
Definition: r_local.h:103
edge_tail
edge_t edge_tail
Definition: r_edge.c:71
oldrefdef_t::fvrectright
float fvrectright
Definition: r_local.h:131
sxformaxis
vec3_t sxformaxis[4]
height
GLsizei height
Definition: qgl_win.c:69
espan_s
Definition: r_local.h:404
Draw_FadeScreen
void Draw_FadeScreen(void)
Definition: r_draw.c:620
currentmodel
model_t * currentmodel
Definition: r_main.c:39
D_DrawSurfaces
void D_DrawSurfaces(void)
Definition: r_edge.c:1088
r_framecount
int r_framecount
Definition: r_main.c:97
FindColor
int FindColor(int r, int g, int b)
Definition: r_draw.c:96
sw_mipscale
cvar_t * sw_mipscale
Definition: r_misc.c:27
d_sdivzorigin
float d_sdivzorigin
Definition: r_main.c:190
r_time1
float r_time1
Definition: r_main.c:54
MAX_QPATH
#define MAX_QPATH
Definition: q_shared.h:80
yscaleshrink
float yscaleshrink
Definition: r_local.h:577
R_DrawSurfaceBlock8_mip0
void R_DrawSurfaceBlock8_mip0(void)
Definition: r_surf.c:236
finalvert_s::lr
int lr
Definition: r_local.h:300
r_amodels_drawn
int r_amodels_drawn
Definition: r_alias.c:32
R_InitSkyBox
void R_InitSkyBox(void)
Definition: r_rast.c:113
R_CinematicSetPalette
void R_CinematicSetPalette(const unsigned char *palette)
Definition: r_main.c:1274
refdef_t
Definition: ref.h:102
R_DrawSurfaceBlock8RGB_mip0
void R_DrawSurfaceBlock8RGB_mip0(void)
oldrefdef_t::vieworg
vec3_t vieworg
Definition: r_local.h:138
affinetridesc_t
Definition: r_local.h:326
surfcache_s
Definition: r_local.h:389
finalvert_s::u
int u
Definition: r_local.h:293
R_BeginRegistration
void R_BeginRegistration(char *map)
Definition: r_model.c:1213
R_DrawSurfaceBlock8RGB_mip1
void R_DrawSurfaceBlock8RGB_mip1(void)
insubmodel
qboolean insubmodel
Definition: r_bsp.c:27
R_PolysetUpdateTables
void R_PolysetUpdateTables(void)
Definition: r_polyse.c:196
thepalette
byte * thepalette
Definition: r_main.c:33
surf_max
surf_t * surf_max
Definition: r_local.h:561
viddef_t::buffer
pixel_t * buffer
Definition: r_local.h:94
imagetype_t
imagetype_t
Definition: r_local.h:62
R_Surf8Start
void R_Surf8Start(void)
mvertex_t
Definition: r_model.h:45
pfrustum_indexes
int * pfrustum_indexes[4]
Definition: r_main.c:104
R_ScreenShot_f
void R_ScreenShot_f(void)
Definition: r_misc.c:627
c_faceclip
int c_faceclip
Definition: r_rast.c:34
r_speeds
cvar_t * r_speeds
Definition: r_main.c:141
de_time1
float de_time1
Definition: r_local.h:785
r_outofedges
int r_outofedges
Definition: r_main.c:58
screenedge
mplane_t screenedge[4]
Definition: r_main.c:92
r_ppn
vec3_t r_ppn
Definition: r_local.h:479
surf_s::next
struct surf_s * next
Definition: r_local.h:430
R_GammaCorrectAndSetPalette
void R_GammaCorrectAndSetPalette(const unsigned char *pal)
Definition: r_main.c:1257
ri
refimport_t ri
Definition: r_main.c:25
verticalFieldOfView
float verticalFieldOfView
Definition: r_main.c:89
R_SurfacePatch
void R_SurfacePatch(void)
Definition: r_misc.c:532
espan_t
struct espan_s espan_t
sw_maxedges
cvar_t * sw_maxedges
Definition: r_main.c:123
aliasxcenter
float aliasxcenter
Definition: r_local.h:762
surfcache_s::height
unsigned height
Definition: r_local.h:397
sw_aliasstats
cvar_t * sw_aliasstats
Definition: r_main.c:118
R_EmitEdge
void R_EmitEdge(mvertex_t *pv0, mvertex_t *pv1)
Definition: r_rast.c:219
txformaxis
vec3_t txformaxis[4]
oldrefdef_t::viewangles
vec3_t viewangles
Definition: r_local.h:139
surface_p
surf_t * surface_p
Definition: r_local.h:561
it_wall
@ it_wall
Definition: r_local.h:66
yscaleinv
float yscaleinv
Definition: r_local.h:576
d_tdivzstepv
float d_tdivzstepv
Definition: r_local.h:518
D_CacheSurface
surfcache_t * D_CacheSurface(msurface_t *surface, int miplevel)
Definition: r_surf.c:638
vrect_s::height
int height
Definition: vid.h:24
vright
vec3_t vright
Definition: r_main.c:74
oldrefdef_t::vrectright_adj_shift20
int vrectright_adj_shift20
Definition: r_local.h:128
R_GenSkyTile16
void R_GenSkyTile16(void *pdest)
alight_t::prlightvec
float * prlightvec
Definition: r_local.h:363
r_edges
edge_t * r_edges
Definition: r_edge.c:49
surf_s::flags
int flags
Definition: r_local.h:439
mtexinfo_s
Definition: r_model.h:83
R_Surf8Patch
void R_Surf8Patch(void)
qboolean
qboolean
Definition: q_shared.h:63
x
GLint GLenum GLint x
Definition: qgl_win.c:116
viddef_t::width
int width
Definition: r_local.h:99
dp_time1
float dp_time1
Definition: r_main.c:112
surfcache_s::lightadj
int lightadj[MAXLIGHTMAPS]
Definition: r_local.h:393
sw_surfcacheoverride
cvar_t * sw_surfcacheoverride
Definition: r_main.c:129
oldrefdef_t::xOrigin
float xOrigin
Definition: r_local.h:135
r_cnumsurfs
int r_cnumsurfs
Definition: r_local.h:787
d_viewbuffer
pixel_t * d_viewbuffer
Definition: r_main.c:196
r_notexture_mip
image_t * r_notexture_mip
Definition: r_main.c:110
R_DrawSprite
void R_DrawSprite(void)
Definition: r_sprite.c:40
de_time2
float de_time2
Definition: r_local.h:785
SWimp_Init
int SWimp_Init(void *hInstance, void *wndProc)
Definition: rw_imp.c:118
d_tdivzorigin
float d_tdivzorigin
Definition: r_local.h:519
erroradjustup
int erroradjustup
Definition: r_local.h:583
espan_s::pnext
struct espan_s * pnext
Definition: r_local.h:407
polydesc_t::pixel_width
int pixel_width
Definition: r_local.h:416
polydesc_t::stipple_parity
int stipple_parity
Definition: r_local.h:423
mnode_s
Definition: r_model.h:123
r_drawentities
cvar_t * r_drawentities
Definition: r_main.c:135
R_LightPointColor
void R_LightPointColor(vec3_t p, vec3_t color)
Definition: r_light.c:387
model_s
Definition: r_model.h:171
surf_s::pad
int pad[2]
Definition: r_local.h:446
r_drawworld
cvar_t * r_drawworld
Definition: r_main.c:134
viddef_t::height
int height
Definition: r_local.h:100
r_oldviewcluster
int r_oldviewcluster
Definition: r_local.h:791
Draw_StretchRaw
void Draw_StretchRaw(int x, int y, int w, int h, int cols, int rows, byte *data)
Definition: r_draw.c:423
affinetridesc_t::pfinalverts
finalvert_t * pfinalverts
Definition: r_local.h:333
r_origin
vec3_t r_origin
Definition: r_main.c:75
Draw_FindPic
struct image_s * Draw_FindPic(char *name)
Definition: r_draw.c:37
entity_rotation
float entity_rotation[3][3]
Definition: r_bsp.c:34
sintable
int sintable[4200]
Definition: r_rast.c:47
r_wholepolycount
int r_wholepolycount
Definition: r_main.c:102
oldrefdef_t::fvrectright_adj
float fvrectright_adj
Definition: r_local.h:129
xscaleinv
float xscaleinv
Definition: r_main.c:83
edge_aftertail
edge_t edge_aftertail
Definition: r_edge.c:72
width
GLint GLsizei width
Definition: qgl_win.c:115
clipplane_s::reserved
byte reserved[2]
Definition: r_local.h:385
r_drawsurf
drawsurf_t r_drawsurf
Definition: r_surf.c:24
r_visframecount
int r_visframecount
Definition: r_main.c:98
edge_s::surfs
unsigned short surfs[2]
Definition: r_local.h:455
SWimp_SetMode
rserr_t SWimp_SetMode(int *pwidth, int *pheight, int mode, qboolean fullscreen)
Definition: rw_imp.c:189
finalvert_s::t
int t
Definition: r_local.h:293
affinetridesc_t::do_vis_thresh
qboolean do_vis_thresh
Definition: r_local.h:337
r_pright
vec3_t r_pright
Definition: r_part.c:22
scale_for_mip
float scale_for_mip
Definition: r_edge.c:79
image_s::registration_sequence
int registration_sequence
Definition: r_local.h:77
R_BeginEdgeFrame
void R_BeginEdgeFrame(void)
Definition: r_edge.c:109
r_surfsonstack
qboolean r_surfsonstack
Definition: r_main.c:66
surfcache_s::image
image_t * image
Definition: r_local.h:399
type
GLenum type
Definition: qgl_win.c:72
R_RotateBmodel
void R_RotateBmodel(void)
Definition: r_bsp.c:75
oldrefdef_t::yOrigin
float yOrigin
Definition: r_local.h:136
viddef_t
Definition: vid.h:27
se_time1
float se_time1
Definition: r_main.c:113
d_zrowbytes
unsigned int d_zrowbytes
Definition: r_main.c:198
cvar_s
Definition: q_shared.h:324
finalvert_s
Definition: r_local.h:292
BestColor
byte BestColor(int r, int g, int b, int start, int stop)
Definition: r_draw.c:135
intensity
cvar_t * intensity
Definition: gl_image.c:31
mleaf_s
Definition: r_model.h:143
intsintable
int intsintable[4200]
Definition: r_rast.c:48
R_DrawTriangle
void R_DrawTriangle(void)
Definition: r_polyse.c:218
bedge_t
struct bedge_s bedge_t
r_lefthand
cvar_t * r_lefthand
Definition: r_main.c:117
r_warpheight
int r_warpheight
Definition: r_main.c:47
clipplane_s::normal
vec3_t normal
Definition: r_local.h:380
sw_draworder
cvar_t * sw_draworder
Definition: r_main.c:122
xOrigin
float xOrigin
Definition: r_main.c:90
oldrefdef_t::vrectrightedge
float vrectrightedge
Definition: r_local.h:123
SWimp_AppActivate
void SWimp_AppActivate(qboolean active)
Definition: rw_imp.c:292
vup
vec3_t vup
Definition: r_main.c:72
r_viewcluster
int r_viewcluster
Definition: r_main.c:108
rserr_unknown
@ rserr_unknown
Definition: r_local.h:110
D_WarpScreen
void D_WarpScreen(void)
Definition: r_scan.c:52
d_8to24tabble
unsigned d_8to24tabble[256]
Definition: r_main.c:28
surf_s::spans
struct espan_s * spans
Definition: r_local.h:432
R_DrawSubmodelPolygons
void R_DrawSubmodelPolygons(model_t *pmodel, int clipflags, mnode_t *topnode)
Definition: r_bsp.c:415
rw_time2
float rw_time2
Definition: r_local.h:784
r_numallocatededges
int r_numallocatededges
Definition: r_main.c:55
espan_s::count
int count
Definition: r_local.h:406
affinetridesc_t::drawtype
int drawtype
Definition: r_local.h:335
image_t
struct image_s image_t
R_ShutdownImages
void R_ShutdownImages(void)
Definition: r_image.c:603
Draw_Char
void Draw_Char(int x, int y, int c)
Definition: r_draw.c:242
MAXHEIGHT
#define MAXHEIGHT
Definition: r_local.h:170
aliasxscale
float aliasxscale
Definition: r_main.c:85
finalvert_s::v
int v
Definition: r_local.h:293
aliasycenter
float aliasycenter
Definition: r_local.h:762
polydesc_t::pixels
byte * pixels
Definition: r_local.h:415
edge_s::next
struct edge_s * next
Definition: r_local.h:454
polydesc_t::t_offset
float t_offset
Definition: r_local.h:420
R_Init
qboolean R_Init(void *hInstance, void *wndProc)
Definition: r_main.c:326
R_DLightPoint
float R_DLightPoint(vec3_t p)
Draw_InitRGBMap
void Draw_InitRGBMap(void)
Definition: r_draw.c:174
oldrefdef_t::fvrecty_adj
float fvrecty_adj
Definition: r_local.h:126
u
static int u
Definition: r_part.c:472
R_DrawSurfaceBlock8_mip3
void R_DrawSurfaceBlock8_mip3(void)
Definition: r_surf.c:386
bedge_s::pnext
struct bedge_s * pnext
Definition: r_local.h:373
vid_gamma
cvar_t * vid_gamma
Definition: vid_dll.c:43
SetUpForLineScan
void SetUpForLineScan(fixed8_t startvertu, fixed8_t startvertv, fixed8_t endvertu, fixed8_t endvertv)
d_pix_max
int d_pix_max
Definition: r_local.h:534
base_vup
vec3_t base_vup
Definition: r_local.h:557
finalvert_t
struct finalvert_s finalvert_t
da_time1
float da_time1
Definition: r_main.c:112
R_DrawSolidClippedSubmodelPolygons
void R_DrawSolidClippedSubmodelPolygons(model_t *pmodel, mnode_t *topnode)
Definition: r_bsp.c:336
d_ziorigin
float d_ziorigin
Definition: r_local.h:519
base_vpn
vec3_t base_vpn
Definition: r_local.h:558
sw_mipcap
cvar_t * sw_mipcap
Definition: r_misc.c:26
D_FlushCaches
void D_FlushCaches(void)
Definition: r_surf.c:481
sw_drawflat
cvar_t * sw_drawflat
Definition: r_main.c:121
miplevel
static int miplevel
Definition: r_edge.c:77
it_pic
@ it_pic
Definition: r_local.h:67
base_vright
vec3_t base_vright
Definition: r_local.h:559
surf_s::entity
entity_t * entity
Definition: r_local.h:441
viddef_t::rowbytes
int rowbytes
Definition: r_local.h:97
R_DrawSurfaceBlock16
void R_DrawSurfaceBlock16(void)
xscaleshrink
float xscaleshrink
Definition: r_main.c:84
r
GLdouble GLdouble r
Definition: qgl_win.c:336
D_ViewChanged
void D_ViewChanged(void)
Definition: r_misc.c:78
R_InitImages
void R_InitImages(void)
Definition: r_image.c:593
medge_t
Definition: r_model.h:77
r_polycount
int r_polycount
Definition: r_main.c:100
R_Surf16Start
void R_Surf16Start(void)
r_affinetridesc
affinetridesc_t r_affinetridesc
Definition: r_alias.c:34
image_s::height
int height
Definition: r_local.h:75
dv_time1
float dv_time1
Definition: r_local.h:785
d_vrectx
int d_vrectx
Definition: r_misc.c:38
R_AliasClipTriangleRGB
void R_AliasClipTriangleRGB(finalvert_t *index0, finalvert_t *index1, finalvert_t *index2)
Definition: r_aclip.c:372
r_lerpmodels
cvar_t * r_lerpmodels
Definition: r_main.c:138
se_time2
float se_time2
Definition: r_local.h:785
refimport_t
Definition: ref.h:192
Sys_MakeCodeWriteable
void Sys_MakeCodeWriteable(unsigned long startaddr, unsigned long length)
Definition: rw_imp.c:322
clipplane_s::leftedge
byte leftedge
Definition: r_local.h:383
bbextentt
fixed16_t bbextentt
Definition: r_local.h:522
edge_s::u_step
fixed16_t u_step
Definition: r_local.h:453
R_AddPolygonEdges
void R_AddPolygonEdges(emitpoint_t *pverts, int numverts, int miplevel)
clipplane_s::rightedge
byte rightedge
Definition: r_local.h:384
zspantable
short * zspantable[MAXHEIGHT]
Definition: r_misc.c:43
alight_t::pglightvec
float * pglightvec
Definition: r_local.h:364
R_PrintTimes
void R_PrintTimes(void)
Definition: r_misc.c:131
R_InitCaches
void R_InitCaches(void)
Definition: r_surf.c:442
R_NewMap
void R_NewMap(void)
Definition: r_main.c:415
R_GetSurf
surf_t * R_GetSurf(void)
espan_s::v
int v
Definition: r_local.h:406
polydesc_t::nump
int nump
Definition: r_local.h:413
surfaces
surf_t * surfaces
Definition: r_edge.c:51
rserr_invalid_mode
@ rserr_invalid_mode
Definition: r_local.h:108
sw_waterwarp
cvar_t * sw_waterwarp
Definition: r_main.c:130
r_currentkey
int r_currentkey
Definition: r_edge.c:62
R_GenSkyTile
void R_GenSkyTile(void *pdest)
R_ClearPolyList
void R_ClearPolyList(void)
oldrefdef_t::fvrectbottom
float fvrectbottom
Definition: r_local.h:132
d_pix_shift
int d_pix_shift
Definition: r_local.h:534
R_DrawSurfaceBlock8RGB_mip3
void R_DrawSurfaceBlock8RGB_mip3(void)
drawsurf_t::surfheight
int surfheight
Definition: r_local.h:351
edge_s::owner
medge_t * owner
Definition: r_local.h:458
emitpoint_t
Definition: r_local.h:255
r_aliasblendcolor
int r_aliasblendcolor
Definition: r_alias.c:47
d_spanpixcount
int d_spanpixcount
Definition: r_main.c:99
r_coloredlights
cvar_t * r_coloredlights
Definition: r_main.c:154
R_Surf16Patch
void R_Surf16Patch(void)
finalvert_s::xyz
float xyz[3]
Definition: r_local.h:297
R_DrawParticles
void R_DrawParticles(void)
Definition: r_part.c:598
drawsurf_t::rowbytes
int rowbytes
Definition: r_local.h:344
surf_s::nearzi
float nearzi
Definition: r_local.h:442
surfcache_s::mipscale
float mipscale
Definition: r_local.h:398
alight_t::shadelight
int shadelight
Definition: r_local.h:358
pixel_t
unsigned char pixel_t
Definition: r_local.h:84
r_aliasuvscale
float r_aliasuvscale
Definition: r_main.c:56
d_roverwrapped
qboolean d_roverwrapped
Definition: r_misc.c:30
Draw_Fill
void Draw_Fill(int x, int y, int w, int h, int c)
Definition: r_draw.c:586
r_fov_greater_than_90
qboolean r_fov_greater_than_90
r_currentbkey
int r_currentbkey
Definition: r_bsp.c:36
polydesc_t::dist
float dist
Definition: r_local.h:419
sw_stipplealpha
cvar_t * sw_stipplealpha
Definition: r_main.c:128
r_clipflags
int r_clipflags
Definition: r_main.c:67
R_PrintAliasStats
void R_PrintAliasStats(void)
Definition: r_misc.c:175
sadjust
fixed16_t sadjust
Definition: r_local.h:732
surf_s::msurf
msurface_t * msurf
Definition: r_local.h:440
d_tdivzstepu
float d_tdivzstepu
Definition: r_local.h:517
r_newrefdef
refdef_t r_newrefdef
Definition: r_main.c:38
drawsurf_t::surfmip
int surfmip
Definition: r_local.h:349
surf_t
struct surf_s surf_t
edge_head
edge_t edge_head
Definition: r_edge.c:70
r_entorigin
vec3_t r_entorigin
Definition: r_bsp.c:31
D_DrawSpans16
void D_DrawSpans16(espan_t *pspans)
Definition: r_scan.c:429
errorterm
int errorterm
Definition: r_local.h:583
edge_s::nearzi
float nearzi
Definition: r_local.h:457
affinetridesc_t::ptriangles
dtriangle_t * ptriangles
Definition: r_local.h:332
R_DrawSurfaceBlock8
void R_DrawSurfaceBlock8(void)
clipplane_s::next
struct clipplane_s * next
Definition: r_local.h:382
da_time2
float da_time2
Definition: r_local.h:783
r_worldmodel
model_t * r_worldmodel
Definition: r_main.c:41
surfcache_s::owner
struct surfcache_s ** owner
Definition: r_local.h:392
R_TransformFrustum
void R_TransformFrustum(void)
Definition: r_misc.c:187
xscale
float xscale
Definition: r_main.c:82
emitpoint_t::v
float v
Definition: r_local.h:257
R_Surf16End
void R_Surf16End(void)
emitpoint_t::zi
float zi
Definition: r_local.h:259
dv_time2
float dv_time2
Definition: r_local.h:785
edge_p
edge_t * edge_p
Definition: r_local.h:750
r_outofsurfaces
int r_outofsurfaces
Definition: r_main.c:57
image_s::type
imagetype_t type
Definition: r_local.h:74
clipplane_s
Definition: r_local.h:378
espan_s::u
int u
Definition: r_local.h:406
drawsurf_t::surfdat
byte * surfdat
Definition: r_local.h:343
SWimp_EndFrame
void SWimp_EndFrame(void)
Definition: rw_imp.c:163
edge_s::u
fixed16_t u
Definition: r_local.h:452
R_RenderWorld
void R_RenderWorld(void)
Definition: r_bsp.c:616
r_drawnpolycount
int r_drawnpolycount
Definition: r_main.c:101
bbextents
fixed16_t bbextents
Definition: r_local.h:733
r_customwidth
cvar_t * r_customwidth
Definition: vid_dll.c:49
d_scantable
int d_scantable[MAXHEIGHT]
Definition: r_misc.c:42
edge_s::nextremove
struct edge_s * nextremove
Definition: r_local.h:456
Turbulent8
void Turbulent8(espan_t *pspan)
Definition: r_scan.c:150
vrect_s::x
int x
Definition: vid.h:24
d_zistepv
float d_zistepv
Definition: r_local.h:518
currententity
entity_t * currententity
Definition: r_bsp.c:28
r_alpha_surfaces
msurface_t * r_alpha_surfaces
Definition: r_poly.c:47
r_pup
vec3_t r_pup
Definition: r_local.h:479
sw_reportedgeout
cvar_t * sw_reportedgeout
Definition: r_main.c:126
swstate_t
struct swstate_s swstate_t
finalvert_s::zi
int zi
Definition: r_local.h:295
image_s::pixels
byte * pixels[4]
Definition: r_local.h:78
R_DrawPolyList
void R_DrawPolyList(void)
image_s::width
int width
Definition: r_local.h:75
alight_t::plightvec
float * plightvec
Definition: r_local.h:359
bedge_s
Definition: r_local.h:370
Draw_GetPicSize
void Draw_GetPicSize(int *w, int *h, char *name)
Definition: r_draw.c:321
alight_t::pblightvec
float * pblightvec
Definition: r_local.h:365
acolormap
void * acolormap
r_viewleaf
mleaf_t * r_viewleaf
Definition: r_main.c:107
alpha
GLfloat GLfloat GLfloat alpha
Definition: qgl_win.c:74
r_screenwidth
int r_screenwidth
Definition: r_main.c:87
d_zistepu
float d_zistepu
Definition: r_local.h:517
image_s::name
char name[MAX_QPATH]
Definition: r_local.h:73
image_s::transparent
qboolean transparent
Definition: r_local.h:76
ycenter
float ycenter
Definition: r_local.h:574
it_skin
@ it_skin
Definition: r_local.h:64
r_dowarp
qboolean r_dowarp
Definition: r_main.c:60
surf_s::key
int key
Definition: r_local.h:433
coloredlights
int coloredlights
Definition: r_main.c:156
r_dspeeds
cvar_t * r_dspeeds
Definition: r_main.c:136
affinetridesc_t::pskindesc
int pskindesc
Definition: r_local.h:329
r_lightlevel
cvar_t * r_lightlevel
Definition: r_main.c:142
edge_t
struct edge_s edge_t
name
cvar_t * name
Definition: cl_main.c:79
MAXLIGHTMAPS
#define MAXLIGHTMAPS
Definition: qfiles.h:409
Draw_GetPalette
void Draw_GetPalette(void)
Definition: r_main.c:1423
d_minmip
int d_minmip
Definition: r_misc.c:31
affinetridesc_t::skinwidth
int skinwidth
Definition: r_local.h:330
swstate_s
Definition: r_local.h:878
swstate_s::prev_mode
int prev_mode
Definition: r_local.h:881
surf_s::d_zistepv
float d_zistepv
Definition: r_local.h:444
surf_s::d_zistepu
float d_zistepu
Definition: r_local.h:444
R_DrawSurfaceBlock8_mip2
void R_DrawSurfaceBlock8_mip2(void)
Definition: r_surf.c:336
s
static fixed16_t s
Definition: r_scan.c:30
ubasestep
int ubasestep
Definition: r_local.h:730
emitpoint_t::t
float t
Definition: r_local.h:258
d_initial_rover
surfcache_t * d_initial_rover
Definition: r_misc.c:29
swstate_s::gammatable
byte gammatable[256]
Definition: r_local.h:883
rw_time1
float rw_time1
Definition: r_local.h:784
y
GLint y
Definition: qgl_win.c:115
aliastriangleparms_t
Definition: r_local.h:770
R_PushDlights
void R_PushDlights(model_t *model)
Definition: r_light.c:94
clipplane_t
struct clipplane_s clipplane_t
R_RegisterModel
struct model_s * R_RegisterModel(char *name)
Definition: r_model.c:1239
d_pix_min
int d_pix_min
Definition: r_misc.c:40
R_IMFlatShadedQuad
void R_IMFlatShadedQuad(vec3_t a, vec3_t b, vec3_t c, vec3_t d, int color, float alpha)
Definition: r_poly.c:1381
R_AliasClipTriangle
void R_AliasClipTriangle(finalvert_t *index0, finalvert_t *index1, finalvert_t *index2)
Definition: r_aclip.c:271
SWimp_BeginFrame
void SWimp_BeginFrame(float camera_separation)
LoadPCX
void LoadPCX(char *filename, byte **pic, byte **palette, int *width, int *height)
Definition: r_image.c:87
oldrefdef_t::horizontalFieldOfView
float horizontalFieldOfView
Definition: r_local.h:133
oldrefdef_t::aliasvrectright
int aliasvrectright
Definition: r_local.h:122
R_EdgeCodeStart
void R_EdgeCodeStart(void)
erroradjustdown
int erroradjustdown
Definition: r_local.h:583
sw_maxsurfs
cvar_t * sw_maxsurfs
Definition: r_main.c:124
surf_s::d_ziorigin
float d_ziorigin
Definition: r_local.h:444
vrect_s::pnext
struct vrect_s * pnext
Definition: r_local.h:89
R_AnimateLight
void R_AnimateLight(void)
R_DrawBeam
void R_DrawBeam(entity_t *e)
Definition: r_main.c:1342
affinetridesc_t::seamfixupX16
int seamfixupX16
Definition: r_local.h:336
oldrefdef_t::vrect
vrect_t vrect
Definition: r_local.h:118
R_StepActiveU
void R_StepActiveU(edge_t *pedge)
Definition: r_edge.c:216
affinetridesc_t::numtriangles
int numtriangles
Definition: r_local.h:334
sc_base
surfcache_t * sc_base
Definition: r_local.h:813
fixed16_t
int fixed16_t
Definition: q_shared.h:139
drawsurf_t::surf
msurface_t * surf
Definition: r_local.h:345
Draw_Pic
void Draw_Pic(int x, int y, char *name)
Definition: r_draw.c:438
sw_mode
cvar_t * sw_mode
Definition: r_main.c:125
d_8to24table
unsigned d_8to24table[256]
Definition: r_main.c:27
R_UnRegister
void R_UnRegister(void)
Definition: r_main.c:314
d_vrectbottom_particle
int d_vrectbottom_particle
Definition: r_local.h:532
oldrefdef_t
Definition: r_local.h:116
vrect_s::width
int width
Definition: vid.h:24
R_LightPoint
void R_LightPoint(vec3_t p, vec3_t color)
Definition: r_light.c:226
affinetridesc_t::vis_thresh
int vis_thresh
Definition: r_local.h:338
R_FreeUnusedImages
void R_FreeUnusedImages(void)
Definition: r_image.c:564
sw_reportsurfout
cvar_t * sw_reportsurfout
Definition: r_main.c:127
polydesc_t
Definition: r_local.h:411
edge_s::prev
struct edge_s * prev
Definition: r_local.h:454
surf_s::last_u
int last_u
Definition: r_local.h:434
finalvert_s::s
int s
Definition: r_local.h:293
R_EndRegistration
void R_EndRegistration(void)
Definition: r_model.c:1282
rserr_ok
@ rserr_ok
Definition: r_local.h:105
R_RenderFace
void R_RenderFace(msurface_t *fa, int clipflags)
Definition: r_rast.c:525
pdest
static byte * pdest
Definition: r_part.c:470
r_warpbuffer
byte * r_warpbuffer
Definition: r_main.c:45
bedge_s::v
mvertex_t * v[2]
Definition: r_local.h:372
surf_s::insubmodel
qboolean insubmodel
Definition: r_local.h:443
entity_s
Definition: ref.h:49
polydesc_t::vup
vec3_t vup
Definition: r_local.h:418
view_clipplanes
clipplane_t view_clipplanes[4]
Definition: r_rast.c:38
swstate_s::fullscreen
qboolean fullscreen
Definition: r_local.h:880
surfcache_s::data
byte data[4]
Definition: r_local.h:400
fixed8_t
int fixed8_t
Definition: q_shared.h:138
R_RenderBmodelFace
void R_RenderBmodelFace(bedge_t *pedges, msurface_t *psurf)
Definition: r_rast.c:738
alight_t
Definition: r_local.h:356
finalvert_s::flags
int flags
Definition: r_local.h:296
R_AliasDrawModel
void R_AliasDrawModel(void)
Definition: r_alias.c:1068
Draw_StretchPic
void Draw_StretchPic(int x, int y, int w, int h, char *name)
Definition: r_draw.c:405
db_time1
float db_time1
Definition: r_local.h:784
yOrigin
float yOrigin
Definition: r_local.h:648
newedges
edge_t * newedges[MAXHEIGHT]
Definition: r_edge.c:57
R_Register
void R_Register(void)
Definition: r_main.c:260
d_zwidth
unsigned int d_zwidth
Definition: r_local.h:538
d_vrectright_particle
int d_vrectright_particle
Definition: r_local.h:532
colormap
void * colormap
Definition: r_main.c:51
R_DrawSurfaceBlock8RGB_mip2
void R_DrawSurfaceBlock8RGB_mip2(void)
r_ptverts
mvertex_t * r_ptverts
NonTurbulent8
void NonTurbulent8(espan_t *pspan)
Definition: r_scan.c:281
r_frustum_indexes
int r_frustum_indexes[4 *6]
Definition: r_main.c:105
drawsurf_t
Definition: r_local.h:341
r_customheight
cvar_t * r_customheight
Definition: vid_dll.c:50
aliastriangleparms_t::c
finalvert_t * c
Definition: r_local.h:772
aliasyscale
float aliasyscale
Definition: r_local.h:762
msurface_s
Definition: r_model.h:93
D_DrawZSpans
void D_DrawZSpans(espan_t *pspans)
Definition: r_scan.c:574
oldrefdef_t::vrectright
int vrectright
Definition: r_local.h:121
d_vrecty
int d_vrecty
Definition: r_local.h:532
aliastriangleparms
aliastriangleparms_t aliastriangleparms
Definition: r_polyse.c:62
removeedges
edge_t * removeedges[MAXHEIGHT]
Definition: r_edge.c:58
edge_max
edge_t * edge_max
Definition: r_local.h:750
d_sdivzstepu
float d_sdivzstepu
Definition: r_main.c:188
R_FindImage
image_t * R_FindImage(char *name, imagetype_t type)
Definition: r_image.c:491
mplane_s
Definition: r_model.h:57
surf_s::prev
struct surf_s * prev
Definition: r_local.h:431
db_time2
float db_time2
Definition: r_local.h:784
modelorg
vec3_t modelorg
Definition: r_bsp.c:29
R_Shutdown
void R_Shutdown(void)
Definition: r_main.c:375
R_EdgeCodeEnd
void R_EdgeCodeEnd(void)
oldrefdef_t::vrect_x_adj_shift20
int vrect_x_adj_shift20
Definition: r_local.h:127
surfcache_s::dlight
int dlight
Definition: r_local.h:394
r_warpwidth
int r_warpwidth
Definition: r_main.c:46
r_maxvalidedgeoffset
int r_maxvalidedgeoffset
finalvert_s::lb
int lb
Definition: r_local.h:300
R_RenderFrame
void R_RenderFrame(refdef_t *fd)
Definition: r_main.c:1033
palmap2
byte palmap2[64][64][64]
Definition: r_draw.c:91
R_PrintDSpeeds
void R_PrintDSpeeds(void)
Definition: r_misc.c:151
R_DrawSurface
void R_DrawSurface(void)
Definition: r_surf.c:145
clipplane_s::dist
float dist
Definition: r_local.h:381
R_DrawAlphaSurfaces
void R_DrawAlphaSurfaces(void)
Definition: r_poly.c:1342
surfcache_s::width
unsigned width
Definition: r_local.h:396
R_BeginFrame
void R_BeginFrame(float camera_separation)
Definition: r_main.c:1177
w
GLdouble GLdouble GLdouble w
Definition: qgl_win.c:291
R_cshift_f
void R_cshift_f(void)
finalvert_s::lg
int lg
Definition: r_local.h:300
R_DrawParticle
void R_DrawParticle(void)
Definition: r_part.c:475
R_InsertNewEdges
void R_InsertNewEdges(edge_t *edgestoadd, edge_t *edgelist)
Definition: r_edge.c:155
r_ptvertsmax
mvertex_t * r_ptvertsmax
Definition: r_local.h:735
image_s
Definition: r_local.h:71
d_sdivzstepv
float d_sdivzstepv
Definition: r_main.c:189
auxedges
edge_t * auxedges
Definition: r_edge.c:48
affinetridesc_t::skinheight
int skinheight
Definition: r_local.h:331
polydesc_t::pverts
emitpoint_t * pverts
Definition: r_local.h:414
R_SplitEntityOnNode2
void R_SplitEntityOnNode2(mnode_t *node)
vrect_s
Definition: vid.h:22
mode
GLenum mode
Definition: qgl_win.c:113
sw_clearcolor
cvar_t * sw_clearcolor
Definition: r_main.c:120
r_dlightframecount
int r_dlightframecount
Definition: r_light.c:24
cacheblock
pixel_t * cacheblock
Definition: r_main.c:194
viddef_t::colormap
pixel_t * colormap
Definition: r_local.h:95
R_ScanEdges
void R_ScanEdges(void)
Definition: r_edge.c:635
d_pzbuffer
short * d_pzbuffer
Definition: r_main.c:197
r_worldentity
entity_t r_worldentity
Definition: r_main.c:30
sc_rover
surfcache_t * sc_rover
Definition: r_local.h:813
r_fullbright
cvar_t * r_fullbright
Definition: r_main.c:137
tadjust
fixed16_t tadjust
Definition: r_local.h:521
Sys_SetFPCW
void Sys_SetFPCW(void)
Definition: rw_imp.c:351
surfcache_s::next
struct surfcache_s * next
Definition: r_local.h:391
Draw_InitLocal
void Draw_InitLocal(void)
Definition: r_draw.c:222
sw_transmooth
cvar_t * sw_transmooth
Definition: r_main.c:131
r_lightsaturation
cvar_t * r_lightsaturation
Definition: r_main.c:155
polydesc_t::pixel_height
int pixel_height
Definition: r_local.h:417
swstate_s::currentpalette
byte currentpalette[1024]
Definition: r_local.h:884
xcenter
float xcenter
Definition: r_main.c:81
dtriangle_t
Definition: qfiles.h:101
viddef_t::alphamap
pixel_t * alphamap
Definition: r_local.h:96
sw_state
swstate_t sw_state
Definition: r_main.c:49
R_TransformPlane
void R_TransformPlane(mplane_t *p, float *normal, float *dist)
Definition: r_misc.c:279
r_maxsurfsseen
int r_maxsurfsseen
Definition: r_main.c:65
vpn
vec3_t vpn
Definition: r_main.c:73
rserr_invalid_fullscreen
@ rserr_invalid_fullscreen
Definition: r_local.h:107
oldrefdef_t::aliasvrect
vrect_t aliasvrect
Definition: r_local.h:120
R_SetupFrame
void R_SetupFrame(void)
Definition: r_misc.c:426
drawsurf_t::surfwidth
int surfwidth
Definition: r_local.h:350
TransformVector
void TransformVector(vec3_t in, vec3_t out)
Definition: r_misc.c:216
vec3_t
vec_t vec3_t[3]
Definition: q_shared.h:134
surf_s
Definition: r_local.h:428
r_pcurrentvertbase
mvertex_t * r_pcurrentvertbase
Definition: r_main.c:62
finalvert_s::l
int l
Definition: r_local.h:294
vid_fullscreen
cvar_t * vid_fullscreen
Definition: vid_dll.c:47
yscale
float yscale
Definition: r_local.h:575
SWimp_SetPalette
void SWimp_SetPalette(const unsigned char *palette)
Definition: rw_imp.c:257
R_Surf8End
void R_Surf8End(void)
R_DrawSurfaceBlock8_mip1
void R_DrawSurfaceBlock8_mip1(void)
Definition: r_surf.c:286
SWimp_Shutdown
void SWimp_Shutdown(void)
Definition: rw_imp.c:274
r_refdef
oldrefdef_t r_refdef
Definition: r_main.c:80
surfcache_t
struct surfcache_s surfcache_t
void
void(APIENTRY *qglAccum)(GLenum op
blanktable
int blanktable[4200]
Definition: r_rast.c:49
vrect_t
struct vrect_s vrect_t
dp_time2
float dp_time2
Definition: r_local.h:784
oldrefdef_t::ambientlight
unsigned ambientlight
Definition: r_local.h:141
edge_s
Definition: r_local.h:450
Draw_TileClear
void Draw_TileClear(int x, int y, int w, int h, char *name)
Definition: r_draw.c:537
alight_t::ambientlight
int ambientlight
Definition: r_local.h:357
surf_s::spanstate
int spanstate
Definition: r_local.h:435
R_RemoveEdges
void R_RemoveEdges(edge_t *pedge)
Definition: r_edge.c:196
oldrefdef_t::fvrecty
float fvrecty
Definition: r_local.h:125
affinetridesc_t::pskin
void * pskin
Definition: r_local.h:328
vrect_s::y
int y
Definition: vid.h:24
it_sky
@ it_sky
Definition: r_local.h:68
vid
viddef_t vid
Definition: r_main.c:24
shadelight
float shadelight[3]
Definition: r_local.h:645