|
|
1.1 ! root 1: // d_iface.h: interface header file for rasterization driver modules ! 2: ! 3: #define WARP_WIDTH 320 ! 4: #define WARP_HEIGHT 200 ! 5: ! 6: #define MAX_LBM_HEIGHT 200 ! 7: ! 8: typedef struct ! 9: { ! 10: float u, v; ! 11: float s, t; ! 12: float zi; ! 13: } emitpoint_t; ! 14: ! 15: typedef enum { ! 16: pt_static, pt_grav, pt_slowgrav, pt_fire, pt_explode, pt_explode2, pt_blob, pt_blob2 ! 17: } ptype_t; ! 18: ! 19: // !!! if this is changed, it must be changed in d_ifacea.h too !!! ! 20: typedef struct particle_s ! 21: { ! 22: // driver-usable fields ! 23: vec3_t org; ! 24: float color; ! 25: // drivers never touch the following fields ! 26: struct particle_s *next; ! 27: vec3_t vel; ! 28: float ramp; ! 29: float die; ! 30: ptype_t type; ! 31: } particle_t; ! 32: ! 33: #define PARTICLE_Z_CLIP 8.0 ! 34: ! 35: typedef struct polyvert_s { ! 36: float u, v, zi, s, t; ! 37: } polyvert_t; ! 38: ! 39: typedef struct polydesc_s { ! 40: int numverts; ! 41: float nearzi; ! 42: msurface_t *pcurrentface; ! 43: polyvert_t *pverts; ! 44: } polydesc_t; ! 45: ! 46: // !!! if this is changed, it must be changed in d_ifacea.h too !!! ! 47: typedef struct finalvert_s { ! 48: int v[6]; // u, v, s, t, l, 1/z ! 49: int flags; ! 50: float reserved; ! 51: } finalvert_t; ! 52: ! 53: // !!! if this is changed, it must be changed in d_ifacea.h too !!! ! 54: typedef struct ! 55: { ! 56: void *pskin; ! 57: maliasskindesc_t *pskindesc; ! 58: int skinwidth; ! 59: int skinheight; ! 60: mtriangle_t *ptriangles; ! 61: finalvert_t *pfinalverts; ! 62: int numtriangles; ! 63: int drawtype; ! 64: int seamfixupX16; ! 65: } affinetridesc_t; ! 66: ! 67: // !!! if this is changed, it must be changed in d_ifacea.h too !!! ! 68: typedef struct { ! 69: float u, v, zi, color; ! 70: } screenpart_t; ! 71: ! 72: typedef struct ! 73: { ! 74: int nump; ! 75: emitpoint_t *pverts; // there's room for an extra element at [nump], ! 76: // if the driver wants to duplicate element [0] at ! 77: // element [nump] to avoid dealing with wrapping ! 78: mspriteframe_t *pspriteframe; ! 79: vec3_t vup, vright, vpn; // in worldspace ! 80: float nearzi; ! 81: } spritedesc_t; ! 82: ! 83: typedef struct ! 84: { ! 85: int u, v; ! 86: float zi; ! 87: int color; ! 88: } zpointdesc_t; ! 89: ! 90: extern cvar_t r_drawflat; ! 91: extern int d_spanpixcount; ! 92: extern int r_framecount; // sequence # of current frame since Quake ! 93: // started ! 94: extern qboolean r_drawpolys; // 1 if driver wants clipped polygons ! 95: // rather than a span list ! 96: extern qboolean r_drawculledpolys; // 1 if driver wants clipped polygons that ! 97: // have been culled by the edge list ! 98: extern qboolean r_worldpolysbacktofront; // 1 if driver wants polygons ! 99: // delivered back to front rather ! 100: // than front to back ! 101: extern qboolean r_recursiveaffinetriangles; // true if a driver wants to use ! 102: // recursive triangular subdivison ! 103: // and vertex drawing via ! 104: // D_PolysetDrawFinalVerts() past ! 105: // a certain distance (normally ! 106: // only used by the software ! 107: // driver) ! 108: extern float r_aliasuvscale; // scale-up factor for screen u and v ! 109: // on Alias vertices passed to driver ! 110: extern int r_pixbytes; ! 111: extern qboolean r_dowarp; ! 112: ! 113: extern affinetridesc_t r_affinetridesc; ! 114: extern spritedesc_t r_spritedesc; ! 115: extern zpointdesc_t r_zpointdesc; ! 116: extern polydesc_t r_polydesc; ! 117: ! 118: extern int d_con_indirect; // if 0, Quake will draw console directly ! 119: // to vid.buffer; if 1, Quake will ! 120: // draw console via D_DrawRect. Must be ! 121: // defined by driver ! 122: ! 123: extern vec3_t r_pright, r_pup, r_ppn; ! 124: ! 125: ! 126: void D_Aff8Patch (void *pcolormap); ! 127: void D_BeginDirectRect (int x, int y, byte *pbitmap, int width, int height); ! 128: void D_DisableBackBufferAccess (void); ! 129: void D_EndDirectRect (int x, int y, int width, int height); ! 130: void D_PolysetDraw (void); ! 131: void D_PolysetDrawFinalVerts (finalvert_t *fv, int numverts); ! 132: void D_DrawParticle (particle_t *pparticle); ! 133: void D_DrawPoly (void); ! 134: void D_DrawSprite (void); ! 135: void D_DrawSurfaces (void); ! 136: void D_DrawZPoint (void); ! 137: void D_EnableBackBufferAccess (void); ! 138: void D_EndParticles (void); ! 139: void D_Init (void); ! 140: void D_ViewChanged (void); ! 141: void D_SetupFrame (void); ! 142: void D_StartParticles (void); ! 143: void D_TurnZOn (void); ! 144: void D_WarpScreen (void); ! 145: ! 146: void D_FillRect (vrect_t *vrect, int color); ! 147: void D_DrawRect (void); ! 148: void D_UpdateRects (vrect_t *prect); ! 149: ! 150: // currently for internal use only, and should be a do-nothing function in ! 151: // hardware drivers ! 152: // FIXME: this should go away ! 153: void D_PolysetUpdateTables (void); ! 154: ! 155: // these are currently for internal use only, and should not be used by drivers ! 156: extern int r_skydirect; ! 157: extern byte *r_skysource; ! 158: ! 159: // transparency types for D_DrawRect () ! 160: #define DR_SOLID 0 ! 161: #define DR_TRANSPARENT 1 ! 162: ! 163: // !!! must be kept the same as in quakeasm.h !!! ! 164: #define TRANSPARENT_COLOR 0xFF ! 165: ! 166: extern void *acolormap; // FIXME: should go away ! 167: ! 168: //=======================================================================// ! 169: ! 170: // callbacks to Quake ! 171: ! 172: typedef struct ! 173: { ! 174: pixel_t *surfdat; // destination for generated surface ! 175: int rowbytes; // destination logical width in bytes ! 176: msurface_t *surf; // description for surface to generate ! 177: fixed8_t lightadj[MAXLIGHTMAPS]; ! 178: // adjust for lightmap levels for dynamic lighting ! 179: texture_t *texture; // corrected for animating textures ! 180: int surfmip; // mipmapped ratio of surface texels / world pixels ! 181: int surfwidth; // in mipmapped texels ! 182: int surfheight; // in mipmapped texels ! 183: } drawsurf_t; ! 184: ! 185: extern drawsurf_t r_drawsurf; ! 186: ! 187: void R_DrawSurface (void); ! 188: void R_GenTile (msurface_t *psurf, void *pdest); ! 189: ! 190: ! 191: // !!! if this is changed, it must be changed in d_ifacea.h too !!! ! 192: #define TURB_TEX_SIZE 64 // base turbulent texture size ! 193: ! 194: // !!! if this is changed, it must be changed in d_ifacea.h too !!! ! 195: #define CYCLE 128 // turbulent cycle size ! 196: ! 197: #define TILE_SIZE 128 // size of textures generated by R_GenTiledSurf ! 198: ! 199: #define SKYSHIFT 7 ! 200: #define SKYSIZE (1 << SKYSHIFT) ! 201: #define SKYMASK (SKYSIZE - 1) ! 202: ! 203: extern float skyspeed, skyspeed2; ! 204: extern float skytime; ! 205: ! 206: extern int c_surf; ! 207: extern vrect_t scr_vrect; ! 208: ! 209: extern byte *r_warpbuffer; ! 210:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.