|
|
1.1.1.2 ! root 1: #ifndef GLQUAKE 1.1 root 2: // r_shared.h: general refresh-related stuff shared between the refresh and the 3: // driver 4: 5: // FIXME: clean up and move into d_iface.h 6: 7: #ifndef _R_SHARED_H_ 8: #define _R_SHARED_H_ 9: 10: #define MAXVERTS 16 // max points in a surface polygon 11: #define MAXWORKINGVERTS (MAXVERTS+4) // max points in an intermediate 12: // polygon (while processing) 13: // !!! if this is changed, it must be changed in d_ifacea.h too !!! 1.1.1.2 ! root 14: #define MAXHEIGHT 1024 ! 15: #define MAXWIDTH 1280 ! 16: #define MAXDIMENSION ((MAXHEIGHT > MAXWIDTH) ? MAXHEIGHT : MAXWIDTH) ! 17: ! 18: #define SIN_BUFFER_SIZE (MAXDIMENSION+CYCLE) 1.1 root 19: 20: #define INFINITE_DISTANCE 0x10000 // distance that's always guaranteed to 21: // be farther away than anything in 22: // the scene 23: 24: //=================================================================== 25: 26: extern void R_DrawLine (polyvert_t *polyvert0, polyvert_t *polyvert1); 27: 28: extern int cachewidth; 29: extern pixel_t *cacheblock; 30: extern int screenwidth; 31: 32: extern float pixelAspect; 33: 34: extern int r_drawnpolycount; 35: 36: extern cvar_t r_clearcolor; 37: 1.1.1.2 ! root 38: extern int sintable[SIN_BUFFER_SIZE]; ! 39: extern int intsintable[SIN_BUFFER_SIZE]; 1.1 root 40: 41: extern vec3_t vup, base_vup; 42: extern vec3_t vpn, base_vpn; 43: extern vec3_t vright, base_vright; 44: extern entity_t *currententity; 45: 1.1.1.2 ! root 46: #define NUMSTACKEDGES 2400 1.1 root 47: #define MINEDGES NUMSTACKEDGES 1.1.1.2 ! root 48: #define NUMSTACKSURFACES 800 1.1 root 49: #define MINSURFACES NUMSTACKSURFACES 50: #define MAXSPANS 3000 51: 52: // !!! if this is changed, it must be changed in asm_draw.h too !!! 53: typedef struct espan_s 54: { 55: int u, v, count; 56: struct espan_s *pnext; 57: } espan_t; 58: 59: // FIXME: compress, make a union if that will help 60: // insubmodel is only 1, flags is fewer than 32, spanstate could be a byte 61: typedef struct surf_s 62: { 63: struct surf_s *next; // active surface stack in r_edge.c 64: struct surf_s *prev; // used in r_edge.c for active surf stack 65: struct espan_s *spans; // pointer to linked list of spans to draw 66: int key; // sorting key (BSP order) 67: int last_u; // set during tracing 68: int spanstate; // 0 = not in span 69: // 1 = in span 70: // -1 = in inverted span (end before 71: // start) 72: int flags; // currentface flags 73: void *data; // associated data like msurface_t 74: entity_t *entity; 75: float nearzi; // nearest 1/z on surface, for mipmapping 76: qboolean insubmodel; 77: float d_ziorigin, d_zistepu, d_zistepv; 78: 79: int pad[2]; // to 64 bytes 80: } surf_t; 81: 82: extern surf_t *surfaces, *surface_p, *surf_max; 83: 84: // surfaces are generated in back to front order by the bsp, so if a surf 85: // pointer is greater than another one, it should be drawn in front 86: // surfaces[1] is the background, and is used as the active surface stack. 87: // surfaces[0] is a dummy, because index 0 is used to indicate no surface 88: // attached to an edge_t 89: 90: //=================================================================== 91: 92: extern vec3_t sxformaxis[4]; // s axis transformed into viewspace 93: extern vec3_t txformaxis[4]; // t axis transformed into viewspac 94: 1.1.1.2 ! root 95: extern vec3_t modelorg, base_modelorg; 1.1 root 96: 97: extern float xcenter, ycenter; 98: extern float xscale, yscale; 99: extern float xscaleinv, yscaleinv; 100: extern float xscaleshrink, yscaleshrink; 101: 102: extern int d_lightstylevalue[256]; // 8.8 frac of base light value 103: 104: extern void TransformVector (vec3_t in, vec3_t out); 105: extern void SetUpForLineScan(fixed8_t startvertu, fixed8_t startvertv, 106: fixed8_t endvertu, fixed8_t endvertv); 107: 108: extern int r_skymade; 109: extern void R_MakeSky (void); 110: 111: extern int ubasestep, errorterm, erroradjustup, erroradjustdown; 112: 113: // flags in finalvert_t.flags 114: #define ALIAS_LEFT_CLIP 0x0001 115: #define ALIAS_TOP_CLIP 0x0002 116: #define ALIAS_RIGHT_CLIP 0x0004 117: #define ALIAS_BOTTOM_CLIP 0x0008 118: #define ALIAS_Z_CLIP 0x0010 119: // !!! if this is changed, it must be changed in d_ifacea.h too !!! 120: #define ALIAS_ONSEAM 0x0020 // also defined in modelgen.h; 121: // must be kept in sync 122: #define ALIAS_XY_CLIP_MASK 0x000F 123: 124: // !!! if this is changed, it must be changed in asm_draw.h too !!! 125: typedef struct edge_s 126: { 127: fixed16_t u; 128: fixed16_t u_step; 129: struct edge_s *prev, *next; 130: unsigned short surfs[2]; 131: struct edge_s *nextremove; 132: float nearzi; 133: medge_t *owner; 134: } edge_t; 135: 136: #endif // _R_SHARED_H_ 137: 1.1.1.2 ! root 138: #endif // GLQUAKE
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.