Go to the documentation of this file.
27 #include "../client/ref.h"
35 #define COLMODEL //qb: tnq2
36 #define REF_VERSION "KolorSoft 1.1" //qb: LOL
47 #define CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x))) //qb: handy
148 #define CACHE_SIZE 32
159 #define VID_GRADES (1 << VID_CBITS)
166 #define MAXVERTS 64 // max points in a surface polygon
167 #define MAXWORKINGVERTS (MAXVERTS+4) // max points in an intermediate
170 #define MAXHEIGHT 1200
171 #define MAXWIDTH 1600
173 #define INFINITE_DISTANCE 0x10000 // distance that's always guaranteed to
180 #define WARP_WIDTH 320
181 #define WARP_HEIGHT 240
184 #define MAX_LBM_HEIGHT 480
187 #define PARTICLE_Z_CLIP 8.0
190 #define TRANSPARENT_COLOR 0xFF
194 #define TURB_TEX_SIZE 64 // base turbulent texture size
197 #define CYCLE 128 // turbulent cycle size
199 #define SCANBUFFERPAD 0x1000
201 #define DS_SPAN_LIST_END -128
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.
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
218 #define SURFCACHE_SIZE_AT_320X240 1024*768
220 #define BMODEL_FULLY_CLIPPED 0x10 // value returned by R_BmodelCheckBBox ()
223 #define XCENTERING (1.0 / 2.0)
224 #define YCENTERING (1.0 / 2.0)
226 #define CLIP_EPSILON 0.001
228 #define BACKFACE_EPSILON 0.01
231 #define NEAR_CLIP 0.01
234 #define MAXALIASVERTS 2000 // TODO: tune this
235 #define ALIAS_Z_CLIP_PLANE 4
239 #define AMP 8*0x10000
243 #define LIGHT_MIN 5 // lowest light value we'll allow, to avoid the
266 #define SMALL_FINALVERT 0
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
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
316 #define FINALVERT_LR 40
317 #define FINALVERT_LG 44
318 #define FINALVERT_LB 48
319 #define FINALVERT_SIZE 52
321 #define FINALVERT_SIZE 40
421 float viewer_position[3];
490 extern byte palmap2[64][64][64];
713 byte BestColor(
int r,
int g,
int b,
int start,
int stop);
871 void Draw_ScaledPic (
int x,
int y,
float scale,
float alpha,
char *pic);
912 int SWimp_Init(
void *hInstance,
void *wndProc );
void R_ClipEdge(mvertex_t *pv0, mvertex_t *pv1, clipplane_t *clip)
mtexinfo_t * sky_texinfo[6]
void Draw_FadeScreen(void)
void D_DrawSurfaces(void)
int FindColor(int r, int g, int b)
void R_DrawSurfaceBlock8_mip0(void)
void R_CinematicSetPalette(const unsigned char *palette)
void R_DrawSurfaceBlock8RGB_mip0(void)
void R_BeginRegistration(char *map)
void R_DrawSurfaceBlock8RGB_mip1(void)
void R_PolysetUpdateTables(void)
int * pfrustum_indexes[4]
void R_ScreenShot_f(void)
void R_GammaCorrectAndSetPalette(const unsigned char *pal)
float verticalFieldOfView
void R_SurfacePatch(void)
void R_EmitEdge(mvertex_t *pv0, mvertex_t *pv1)
surfcache_t * D_CacheSurface(msurface_t *surface, int miplevel)
int vrectright_adj_shift20
void R_GenSkyTile16(void *pdest)
int lightadj[MAXLIGHTMAPS]
cvar_t * sw_surfcacheoverride
image_t * r_notexture_mip
int SWimp_Init(void *hInstance, void *wndProc)
void R_LightPointColor(vec3_t p, vec3_t color)
void Draw_StretchRaw(int x, int y, int w, int h, int cols, int rows, byte *data)
finalvert_t * pfinalverts
struct image_s * Draw_FindPic(char *name)
float entity_rotation[3][3]
rserr_t SWimp_SetMode(int *pwidth, int *pheight, int mode, qboolean fullscreen)
int registration_sequence
void R_BeginEdgeFrame(void)
void R_RotateBmodel(void)
byte BestColor(int r, int g, int b, int start, int stop)
void R_DrawTriangle(void)
void SWimp_AppActivate(qboolean active)
unsigned d_8to24tabble[256]
void R_DrawSubmodelPolygons(model_t *pmodel, int clipflags, mnode_t *topnode)
void R_ShutdownImages(void)
void Draw_Char(int x, int y, int c)
qboolean R_Init(void *hInstance, void *wndProc)
float R_DLightPoint(vec3_t p)
void Draw_InitRGBMap(void)
void R_DrawSurfaceBlock8_mip3(void)
void SetUpForLineScan(fixed8_t startvertu, fixed8_t startvertv, fixed8_t endvertu, fixed8_t endvertv)
struct finalvert_s finalvert_t
void R_DrawSolidClippedSubmodelPolygons(model_t *pmodel, mnode_t *topnode)
void R_DrawSurfaceBlock16(void)
affinetridesc_t r_affinetridesc
void R_AliasClipTriangleRGB(finalvert_t *index0, finalvert_t *index1, finalvert_t *index2)
void Sys_MakeCodeWriteable(unsigned long startaddr, unsigned long length)
void R_AddPolygonEdges(emitpoint_t *pverts, int numverts, int miplevel)
short * zspantable[MAXHEIGHT]
void R_GenSkyTile(void *pdest)
void R_ClearPolyList(void)
void R_DrawSurfaceBlock8RGB_mip3(void)
void R_DrawParticles(void)
void Draw_Fill(int x, int y, int w, int h, int c)
qboolean r_fov_greater_than_90
void R_PrintAliasStats(void)
void D_DrawSpans16(espan_t *pspans)
void R_DrawSurfaceBlock8(void)
struct clipplane_s * next
struct surfcache_s ** owner
void R_TransformFrustum(void)
void SWimp_EndFrame(void)
int d_scantable[MAXHEIGHT]
struct edge_s * nextremove
void Turbulent8(espan_t *pspan)
msurface_t * r_alpha_surfaces
cvar_t * sw_reportedgeout
struct swstate_s swstate_t
void R_DrawPolyList(void)
void Draw_GetPicSize(int *w, int *h, char *name)
GLfloat GLfloat GLfloat alpha
void Draw_GetPalette(void)
void R_DrawSurfaceBlock8_mip2(void)
surfcache_t * d_initial_rover
void R_PushDlights(model_t *model)
struct clipplane_s clipplane_t
struct model_s * R_RegisterModel(char *name)
void R_IMFlatShadedQuad(vec3_t a, vec3_t b, vec3_t c, vec3_t d, int color, float alpha)
void R_AliasClipTriangle(finalvert_t *index0, finalvert_t *index1, finalvert_t *index2)
void SWimp_BeginFrame(float camera_separation)
void LoadPCX(char *filename, byte **pic, byte **palette, int *width, int *height)
float horizontalFieldOfView
void R_EdgeCodeStart(void)
void R_AnimateLight(void)
void R_DrawBeam(entity_t *e)
void R_StepActiveU(edge_t *pedge)
void Draw_Pic(int x, int y, char *name)
unsigned d_8to24table[256]
int d_vrectbottom_particle
void R_LightPoint(vec3_t p, vec3_t color)
void R_FreeUnusedImages(void)
cvar_t * sw_reportsurfout
void R_EndRegistration(void)
void R_RenderFace(msurface_t *fa, int clipflags)
clipplane_t view_clipplanes[4]
void R_RenderBmodelFace(bedge_t *pedges, msurface_t *psurf)
void R_AliasDrawModel(void)
void Draw_StretchPic(int x, int y, int w, int h, char *name)
edge_t * newedges[MAXHEIGHT]
int d_vrectright_particle
void R_DrawSurfaceBlock8RGB_mip2(void)
void NonTurbulent8(espan_t *pspan)
int r_frustum_indexes[4 *6]
void D_DrawZSpans(espan_t *pspans)
aliastriangleparms_t aliastriangleparms
edge_t * removeedges[MAXHEIGHT]
image_t * R_FindImage(char *name, imagetype_t type)
void R_RenderFrame(refdef_t *fd)
void R_PrintDSpeeds(void)
void R_DrawAlphaSurfaces(void)
void R_BeginFrame(float camera_separation)
GLdouble GLdouble GLdouble w
void R_DrawParticle(void)
void R_InsertNewEdges(edge_t *edgestoadd, edge_t *edgelist)
void R_SplitEntityOnNode2(mnode_t *node)
struct surfcache_s * next
void Draw_InitLocal(void)
cvar_t * r_lightsaturation
byte currentpalette[1024]
void R_TransformPlane(mplane_t *p, float *normal, float *dist)
@ rserr_invalid_fullscreen
void TransformVector(vec3_t in, vec3_t out)
mvertex_t * r_pcurrentvertbase
void SWimp_SetPalette(const unsigned char *palette)
void R_DrawSurfaceBlock8_mip1(void)
void SWimp_Shutdown(void)
struct surfcache_s surfcache_t
void(APIENTRY *qglAccum)(GLenum op
void Draw_TileClear(int x, int y, int w, int h, char *name)
void R_RemoveEdges(edge_t *pedge)