2 Copyright (C) 1996-1997 Id Software, Inc.
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.
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.
13 See the GNU General Public License for more details.
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.
20 // d_iface.h: interface header file for rasterization driver modules
22 #define WARP_WIDTH 320
23 #define WARP_HEIGHT 200
25 #define MAX_LBM_HEIGHT 480
35 pt_static
, pt_grav
, pt_slowgrav
, pt_fire
, pt_explode
, pt_explode2
, pt_blob
, pt_blob2
38 // !!! if this is changed, it must be changed in d_ifacea.h too !!!
39 typedef struct particle_s
41 // driver-usable fields
44 // drivers never touch the following fields
45 struct particle_s
*next
;
52 #define PARTICLE_Z_CLIP 8.0
54 typedef struct polyvert_s
{
58 typedef struct polydesc_s
{
61 msurface_t
*pcurrentface
;
65 // !!! if this is changed, it must be changed in d_ifacea.h too !!!
66 typedef struct finalvert_s
{
67 int v
[6]; // u, v, s, t, l, 1/z
72 // !!! if this is changed, it must be changed in d_ifacea.h too !!!
76 maliasskindesc_t
*pskindesc
;
79 mtriangle_t
*ptriangles
;
80 finalvert_t
*pfinalverts
;
86 // !!! if this is changed, it must be changed in d_ifacea.h too !!!
88 float u
, v
, zi
, color
;
94 emitpoint_t
*pverts
; // there's room for an extra element at [nump],
95 // if the driver wants to duplicate element [0] at
96 // element [nump] to avoid dealing with wrapping
97 mspriteframe_t
*pspriteframe
;
98 vec3_t vup
, vright
, vpn
; // in worldspace
109 extern cvar_t r_drawflat
;
110 extern int d_spanpixcount
;
111 extern int r_framecount
; // sequence # of current frame since Quake
113 extern qboolean r_drawpolys
; // 1 if driver wants clipped polygons
114 // rather than a span list
115 extern qboolean r_drawculledpolys
; // 1 if driver wants clipped polygons that
116 // have been culled by the edge list
117 extern qboolean r_worldpolysbacktofront
; // 1 if driver wants polygons
118 // delivered back to front rather
119 // than front to back
120 extern qboolean r_recursiveaffinetriangles
; // true if a driver wants to use
121 // recursive triangular subdivison
122 // and vertex drawing via
123 // D_PolysetDrawFinalVerts() past
124 // a certain distance (normally
125 // only used by the software
127 extern float r_aliasuvscale
; // scale-up factor for screen u and v
128 // on Alias vertices passed to driver
129 extern int r_pixbytes
;
130 extern qboolean r_dowarp
;
132 extern affinetridesc_t r_affinetridesc
;
133 extern spritedesc_t r_spritedesc
;
134 extern zpointdesc_t r_zpointdesc
;
135 extern polydesc_t r_polydesc
;
137 extern int d_con_indirect
; // if 0, Quake will draw console directly
138 // to vid.buffer; if 1, Quake will
139 // draw console via D_DrawRect. Must be
142 extern vec3_t r_pright
, r_pup
, r_ppn
;
145 void D_Aff8Patch (void *pcolormap
);
146 void D_BeginDirectRect (int x
, int y
, byte
*pbitmap
, int width
, int height
);
147 void D_DisableBackBufferAccess (void);
148 void D_EndDirectRect (int x
, int y
, int width
, int height
);
149 void D_PolysetDraw (void);
150 void D_PolysetDrawFinalVerts (finalvert_t
*fv
, int numverts
);
151 void D_DrawParticle (particle_t
*pparticle
);
152 void D_DrawPoly (void);
153 void D_DrawSprite (void);
154 void D_DrawSurfaces (void);
155 void D_DrawZPoint (void);
156 void D_EnableBackBufferAccess (void);
157 void D_EndParticles (void);
159 void D_ViewChanged (void);
160 void D_SetupFrame (void);
161 void D_StartParticles (void);
162 void D_TurnZOn (void);
163 void D_WarpScreen (void);
165 void D_FillRect (vrect_t
*vrect
, int color
);
166 void D_DrawRect (void);
167 void D_UpdateRects (vrect_t
*prect
);
169 // currently for internal use only, and should be a do-nothing function in
171 // FIXME: this should go away
172 void D_PolysetUpdateTables (void);
174 // these are currently for internal use only, and should not be used by drivers
175 extern int r_skydirect
;
176 extern byte
*r_skysource
;
178 // transparency types for D_DrawRect ()
180 #define DR_TRANSPARENT 1
182 // !!! must be kept the same as in quakeasm.h !!!
183 #define TRANSPARENT_COLOR 0xFF
185 extern void *acolormap
; // FIXME: should go away
187 //=======================================================================//
189 // callbacks to Quake
193 pixel_t
*surfdat
; // destination for generated surface
194 int rowbytes
; // destination logical width in bytes
195 msurface_t
*surf
; // description for surface to generate
196 fixed8_t lightadj
[MAXLIGHTMAPS
];
197 // adjust for lightmap levels for dynamic lighting
198 texture_t
*texture
; // corrected for animating textures
199 int surfmip
; // mipmapped ratio of surface texels / world pixels
200 int surfwidth
; // in mipmapped texels
201 int surfheight
; // in mipmapped texels
204 extern drawsurf_t r_drawsurf
;
206 void R_DrawSurface (void);
207 void R_GenTile (msurface_t
*psurf
, void *pdest
);
210 // !!! if this is changed, it must be changed in d_ifacea.h too !!!
211 #define TURB_TEX_SIZE 64 // base turbulent texture size
213 // !!! if this is changed, it must be changed in d_ifacea.h too !!!
214 #define CYCLE 128 // turbulent cycle size
216 #define TILE_SIZE 128 // size of textures generated by R_GenTiledSurf
219 #define SKYSIZE (1 << SKYSHIFT)
220 #define SKYMASK (SKYSIZE - 1)
222 extern float skyspeed
, skyspeed2
;
223 extern float skytime
;
226 extern vrect_t scr_vrect
;
228 extern byte
*r_warpbuffer
;