vkQuake2 doxygen  1.0 dev
r_local.h File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <stdarg.h>
#include "../client/ref.h"
#include "r_model.h"

Go to the source code of this file.

Classes

struct  image_s
 
struct  vrect_s
 
struct  viddef_t
 
struct  oldrefdef_t
 
struct  emitpoint_t
 
struct  finalvert_s
 
struct  affinetridesc_t
 
struct  drawsurf_t
 
struct  alight_t
 
struct  bedge_s
 
struct  clipplane_s
 
struct  surfcache_s
 
struct  espan_s
 
struct  polydesc_t
 
struct  surf_s
 
struct  edge_s
 
struct  aliastriangleparms_t
 
struct  swstate_s
 

Macros

#define id386   0
 
#define COLMODEL
 
#define REF_VERSION   "KolorSoft 1.1"
 
#define PITCH   0
 
#define YAW   1
 
#define ROLL   2
 
#define CLAMP(x, low, high)   (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x)))
 
#define CACHE_SIZE   32
 
#define VID_CBITS   6
 
#define VID_GRADES   (1 << VID_CBITS)
 
#define MAXVERTS   64
 
#define MAXWORKINGVERTS   (MAXVERTS+4)
 
#define MAXHEIGHT   1200
 
#define MAXWIDTH   1600
 
#define INFINITE_DISTANCE   0x10000
 
#define WARP_WIDTH   320
 
#define WARP_HEIGHT   240
 
#define MAX_LBM_HEIGHT   480
 
#define PARTICLE_Z_CLIP   8.0
 
#define TRANSPARENT_COLOR   0xFF
 
#define TURB_TEX_SIZE   64
 
#define CYCLE   128
 
#define SCANBUFFERPAD   0x1000
 
#define DS_SPAN_LIST_END   -128
 
#define NUMSTACKEDGES   8192
 
#define MINEDGES   NUMSTACKEDGES
 
#define NUMSTACKSURFACES   8192
 
#define MINSURFACES   NUMSTACKSURFACES
 
#define MAXSPANS   8192
 
#define ALIAS_LEFT_CLIP   0x0001
 
#define ALIAS_TOP_CLIP   0x0002
 
#define ALIAS_RIGHT_CLIP   0x0004
 
#define ALIAS_BOTTOM_CLIP   0x0008
 
#define ALIAS_Z_CLIP   0x0010
 
#define ALIAS_XY_CLIP_MASK   0x000F
 
#define SURFCACHE_SIZE_AT_320X240   1024*768
 
#define BMODEL_FULLY_CLIPPED   0x10
 
#define XCENTERING   (1.0 / 2.0)
 
#define YCENTERING   (1.0 / 2.0)
 
#define CLIP_EPSILON   0.001
 
#define BACKFACE_EPSILON   0.01
 
#define NEAR_CLIP   0.01
 
#define MAXALIASVERTS   2000
 
#define ALIAS_Z_CLIP_PLANE   4
 
#define AMP   8*0x10000
 
#define AMP2   3
 
#define SPEED   20
 
#define LIGHT_MIN   5
 
#define SMALL_FINALVERT   0
 
#define FINALVERT_V0   0
 
#define FINALVERT_V1   4
 
#define FINALVERT_V2   8
 
#define FINALVERT_V3   12
 
#define FINALVERT_V4   16
 
#define FINALVERT_V5   20
 
#define FINALVERT_FLAGS   24
 
#define FINALVERT_X   28
 
#define FINALVERT_Y   32
 
#define FINALVERT_Z   36
 
#define FINALVERT_LR   40
 
#define FINALVERT_LG   44
 
#define FINALVERT_LB   48
 
#define FINALVERT_SIZE   52
 

Typedefs

typedef struct image_s image_t
 
typedef unsigned char pixel_t
 
typedef struct vrect_s vrect_t
 
typedef struct finalvert_s finalvert_t
 
typedef struct bedge_s bedge_t
 
typedef struct clipplane_s clipplane_t
 
typedef struct surfcache_s surfcache_t
 
typedef struct espan_s espan_t
 
typedef struct surf_s surf_t
 
typedef struct edge_s edge_t
 
typedef struct swstate_s swstate_t
 

Enumerations

enum  imagetype_t {
  it_skin, it_sprite, it_wall, it_pic,
  it_sky, it_skin, it_sprite, it_wall,
  it_pic, it_sky, it_skin, it_sprite,
  it_wall, it_pic, it_sky
}
 
enum  rserr_t {
  rserr_ok, rserr_invalid_fullscreen, rserr_invalid_mode, rserr_unknown,
  rserr_ok, rserr_invalid_fullscreen, rserr_invalid_mode, rserr_unknown,
  rserr_ok, rserr_invalid_fullscreen, rserr_invalid_mode, rserr_unknown
}
 

Functions

void D_DrawSurfaces (void)
 
void R_DrawParticle (void)
 
void D_ViewChanged (void)
 
void D_WarpScreen (void)
 
void R_PolysetUpdateTables (void)
 
void R_AliasClipTriangleRGB (finalvert_t *index0, finalvert_t *index1, finalvert_t *index2)
 
void R_DrawSurface (void)
 
void D_DrawSpans16 (espan_t *pspans)
 
void D_DrawZSpans (espan_t *pspans)
 
void Turbulent8 (espan_t *pspan)
 
void NonTurbulent8 (espan_t *pspan)
 
surfcache_tD_CacheSurface (msurface_t *surface, int miplevel)
 
void TransformVector (vec3_t in, vec3_t out)
 
void SetUpForLineScan (fixed8_t startvertu, fixed8_t startvertv, fixed8_t endvertu, fixed8_t endvertv)
 
void R_RenderWorld (void)
 
void R_ClearPolyList (void)
 
void R_DrawPolyList (void)
 
void R_DrawAlphaSurfaces (void)
 
void R_DrawSprite (void)
 
void R_DrawBeam (entity_t *e)
 
void R_RenderFace (msurface_t *fa, int clipflags)
 
void R_RenderBmodelFace (bedge_t *pedges, msurface_t *psurf)
 
void R_TransformPlane (mplane_t *p, float *normal, float *dist)
 
void R_TransformFrustum (void)
 
void R_DrawSurfaceBlock16 (void)
 
void R_DrawSurfaceBlock8 (void)
 
void R_DrawSurfaceBlock8RGB_mip0 (void)
 
void R_DrawSurfaceBlock8RGB_mip1 (void)
 
void R_DrawSurfaceBlock8RGB_mip2 (void)
 
void R_DrawSurfaceBlock8RGB_mip3 (void)
 
void R_GenSkyTile (void *pdest)
 
void R_GenSkyTile16 (void *pdest)
 
void R_Surf8Patch (void)
 
void R_Surf16Patch (void)
 
void R_DrawSubmodelPolygons (model_t *pmodel, int clipflags, mnode_t *topnode)
 
void R_DrawSolidClippedSubmodelPolygons (model_t *pmodel, mnode_t *topnode)
 
void R_AddPolygonEdges (emitpoint_t *pverts, int numverts, int miplevel)
 
surf_tR_GetSurf (void)
 
void R_AliasDrawModel (void)
 
void R_BeginEdgeFrame (void)
 
void R_ScanEdges (void)
 
void R_InsertNewEdges (edge_t *edgestoadd, edge_t *edgelist)
 
void R_StepActiveU (edge_t *pedge)
 
void R_RemoveEdges (edge_t *pedge)
 
void R_PushDlights (model_t *model)
 
void R_LightPointColor (vec3_t p, vec3_t color)
 
byte BestColor (int r, int g, int b, int start, int stop)
 
int FindColor (int r, int g, int b)
 
void Draw_InitRGBMap (void)
 
void R_Surf8Start (void)
 
void R_Surf8End (void)
 
void R_Surf16Start (void)
 
void R_Surf16End (void)
 
void R_EdgeCodeStart (void)
 
void R_EdgeCodeEnd (void)
 
void R_RotateBmodel (void)
 
void R_InitTurb (void)
 
void R_DrawParticles (void)
 
void R_SurfacePatch (void)
 
void R_DrawTriangle (void)
 
void R_AliasClipTriangle (finalvert_t *index0, finalvert_t *index1, finalvert_t *index2)
 
void R_PrintAliasStats (void)
 
void R_PrintTimes (void)
 
void R_PrintDSpeeds (void)
 
void R_AnimateLight (void)
 
void R_LightPoint (vec3_t p, vec3_t color)
 
void R_SetupFrame (void)
 
void R_cshift_f (void)
 
void R_EmitEdge (mvertex_t *pv0, mvertex_t *pv1)
 
void R_ClipEdge (mvertex_t *pv0, mvertex_t *pv1, clipplane_t *clip)
 
void R_SplitEntityOnNode2 (mnode_t *node)
 
float R_DLightPoint (vec3_t p)
 
void R_NewMap (void)
 
void R_Register (void)
 
void R_UnRegister (void)
 
void Draw_InitLocal (void)
 
qboolean R_Init (void *hInstance, void *wndProc)
 
void R_Shutdown (void)
 
void R_InitCaches (void)
 
void D_FlushCaches (void)
 
void R_ScreenShot_f (void)
 
void R_BeginRegistration (char *map)
 
struct model_sR_RegisterModel (char *name)
 
void R_EndRegistration (void)
 
void R_RenderFrame (refdef_t *fd)
 
struct image_sDraw_FindPic (char *name)
 
void Draw_GetPicSize (int *w, int *h, char *name)
 
void Draw_Pic (int x, int y, char *name)
 
void Draw_StretchPic (int x, int y, int w, int h, char *name)
 
void Draw_StretchRaw (int x, int y, int w, int h, int cols, int rows, byte *data)
 
void Draw_Char (int x, int y, int c)
 
void Draw_TileClear (int x, int y, int w, int h, char *name)
 
void Draw_Fill (int x, int y, int w, int h, int c)
 
void Draw_FadeScreen (void)
 
void Draw_GetPalette (void)
 
void R_BeginFrame (float camera_separation)
 
void R_CinematicSetPalette (const unsigned char *palette)
 
void Sys_MakeCodeWriteable (unsigned long startaddr, unsigned long length)
 
void Sys_SetFPCW (void)
 
void LoadPCX (char *filename, byte **pic, byte **palette, int *width, int *height)
 
void R_InitImages (void)
 
void R_ShutdownImages (void)
 
image_tR_FindImage (char *name, imagetype_t type)
 
void R_FreeUnusedImages (void)
 
void R_GammaCorrectAndSetPalette (const unsigned char *pal)
 
void R_InitSkyBox (void)
 
void R_IMFlatShadedQuad (vec3_t a, vec3_t b, vec3_t c, vec3_t d, int color, float alpha)
 
void SWimp_BeginFrame (float camera_separation)
 
void SWimp_EndFrame (void)
 
int SWimp_Init (void *hInstance, void *wndProc)
 
void SWimp_SetPalette (const unsigned char *palette)
 
void SWimp_Shutdown (void)
 
rserr_t SWimp_SetMode (int *pwidth, int *pheight, int mode, qboolean fullscreen)
 
void SWimp_AppActivate (qboolean active)
 

Variables

viddef_t vid
 
oldrefdef_t r_refdef
 
int d_spanpixcount
 
int r_framecount
 
float r_aliasuvscale
 
qboolean r_dowarp
 
affinetridesc_t r_affinetridesc
 
vec3_t r_pright
 
vec3_t r_pup
 
vec3_t r_ppn
 
voidacolormap
 
byte palmap2 [64][64][64]
 
drawsurf_t r_drawsurf
 
int c_surf
 
byter_warpbuffer
 
int r_warpwidth
 
int r_warpheight
 
float scale_for_mip
 
qboolean d_roverwrapped
 
surfcache_tsc_rover
 
surfcache_td_initial_rover
 
float d_sdivzstepu
 
float d_tdivzstepu
 
float d_zistepu
 
float d_sdivzstepv
 
float d_tdivzstepv
 
float d_zistepv
 
float d_sdivzorigin
 
float d_tdivzorigin
 
float d_ziorigin
 
fixed16_t sadjust
 
fixed16_t tadjust
 
fixed16_t bbextents
 
fixed16_t bbextentt
 
int d_vrectx
 
int d_vrecty
 
int d_vrectright_particle
 
int d_vrectbottom_particle
 
int d_pix_min
 
int d_pix_max
 
int d_pix_shift
 
pixel_td_viewbuffer
 
short * d_pzbuffer
 
unsigned int d_zrowbytes
 
unsigned int d_zwidth
 
short * zspantable [MAXHEIGHT]
 
int d_scantable [MAXHEIGHT]
 
int d_minmip
 
float d_scalemip [3]
 
int cachewidth
 
pixel_tcacheblock
 
int r_screenwidth
 
int r_drawnpolycount
 
int sintable [4200]
 
int intsintable [4200]
 
int blanktable [4200]
 
vec3_t vup
 
vec3_t base_vup
 
vec3_t vpn
 
vec3_t base_vpn
 
vec3_t vright
 
vec3_t base_vright
 
surf_tsurfaces
 
surf_tsurface_p
 
surf_tsurf_max
 
vec3_t sxformaxis [4]
 
vec3_t txformaxis [4]
 
float xcenter
 
float ycenter
 
float xscale
 
float yscale
 
float xscaleinv
 
float yscaleinv
 
float xscaleshrink
 
float yscaleshrink
 
int ubasestep
 
int errorterm
 
int erroradjustup
 
int erroradjustdown
 
cvar_tsw_aliasstats
 
cvar_tsw_clearcolor
 
cvar_tsw_drawflat
 
cvar_tsw_draworder
 
cvar_tsw_maxedges
 
cvar_tsw_maxsurfs
 
cvar_tsw_mipcap
 
cvar_tsw_mipscale
 
cvar_tsw_mode
 
cvar_tsw_reportsurfout
 
cvar_tsw_reportedgeout
 
cvar_tsw_stipplealpha
 
cvar_tsw_surfcacheoverride
 
cvar_tsw_waterwarp
 
cvar_tsw_transmooth
 
cvar_tr_fullbright
 
cvar_tr_lefthand
 
cvar_tr_drawentities
 
cvar_tr_drawworld
 
cvar_tr_dspeeds
 
cvar_tr_lerpmodels
 
cvar_tr_speeds
 
cvar_tr_lightlevel
 
cvar_tvid_fullscreen
 
cvar_tvid_gamma
 
cvar_tr_customwidth
 
cvar_tr_customheight
 
cvar_tr_coloredlights
 
cvar_tr_lightsaturation
 
clipplane_t view_clipplanes [4]
 
intpfrustum_indexes [4]
 
bytethepalette
 
mplane_t screenedge [4]
 
vec3_t r_origin
 
entity_t r_worldentity
 
model_tcurrentmodel
 
entity_tcurrententity
 
vec3_t modelorg
 
vec3_t r_entorigin
 
float shadelight [3]
 
float verticalFieldOfView
 
float xOrigin
 
float yOrigin
 
int r_visframecount
 
msurface_tr_alpha_surfaces
 
int coloredlights
 
qboolean insubmodel
 
int c_faceclip
 
int r_polycount
 
int r_wholepolycount
 
mvertex_tr_ptverts
 
mvertex_tr_ptvertsmax
 
float entity_rotation [3][3]
 
int r_currentkey
 
int r_currentbkey
 
int r_amodels_drawn
 
edge_tauxedges
 
int r_numallocatededges
 
edge_tr_edges
 
edge_tedge_p
 
edge_tedge_max
 
edge_tnewedges [MAXHEIGHT]
 
edge_tremoveedges [MAXHEIGHT]
 
edge_t edge_head
 
edge_t edge_tail
 
edge_t edge_aftertail
 
int r_aliasblendcolor
 
float aliasxscale
 
float aliasyscale
 
float aliasxcenter
 
float aliasycenter
 
int r_outofsurfaces
 
int r_outofedges
 
mvertex_tr_pcurrentvertbase
 
int r_maxvalidedgeoffset
 
aliastriangleparms_t aliastriangleparms
 
float r_time1
 
float da_time1
 
float da_time2
 
float dp_time1
 
float dp_time2
 
float db_time1
 
float db_time2
 
float rw_time1
 
float rw_time2
 
float se_time1
 
float se_time2
 
float de_time1
 
float de_time2
 
float dv_time1
 
float dv_time2
 
int r_frustum_indexes [4 *6]
 
int r_maxsurfsseen
 
int r_maxedgesseen
 
int r_cnumsurfs
 
qboolean r_surfsonstack
 
mleaf_tr_viewleaf
 
int r_viewcluster
 
int r_oldviewcluster
 
int r_clipflags
 
int r_dlightframecount
 
qboolean r_fov_greater_than_90
 
image_tr_notexture_mip
 
model_tr_worldmodel
 
refdef_t r_newrefdef
 
surfcache_tsc_base
 
voidcolormap
 
unsigned d_8to24table [256]
 
unsigned d_8to24tabble [256]
 
mtexinfo_tsky_texinfo [6]
 
swstate_t sw_state
 
refimport_t ri
 

Macro Definition Documentation

◆ ALIAS_BOTTOM_CLIP

#define ALIAS_BOTTOM_CLIP   0x0008

Definition at line 214 of file r_local.h.

◆ ALIAS_LEFT_CLIP

#define ALIAS_LEFT_CLIP   0x0001

Definition at line 211 of file r_local.h.

◆ ALIAS_RIGHT_CLIP

#define ALIAS_RIGHT_CLIP   0x0004

Definition at line 213 of file r_local.h.

◆ ALIAS_TOP_CLIP

#define ALIAS_TOP_CLIP   0x0002

Definition at line 212 of file r_local.h.

◆ ALIAS_XY_CLIP_MASK

#define ALIAS_XY_CLIP_MASK   0x000F

Definition at line 216 of file r_local.h.

◆ ALIAS_Z_CLIP

#define ALIAS_Z_CLIP   0x0010

Definition at line 215 of file r_local.h.

◆ ALIAS_Z_CLIP_PLANE

#define ALIAS_Z_CLIP_PLANE   4

Definition at line 235 of file r_local.h.

◆ AMP

#define AMP   8*0x10000

Definition at line 239 of file r_local.h.

◆ AMP2

#define AMP2   3

Definition at line 240 of file r_local.h.

◆ BACKFACE_EPSILON

#define BACKFACE_EPSILON   0.01

Definition at line 228 of file r_local.h.

◆ BMODEL_FULLY_CLIPPED

#define BMODEL_FULLY_CLIPPED   0x10

Definition at line 220 of file r_local.h.

◆ CACHE_SIZE

#define CACHE_SIZE   32

Definition at line 148 of file r_local.h.

◆ CLAMP

#define CLAMP (   x,
  low,
  high 
)    (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x)))

Definition at line 47 of file r_local.h.

◆ CLIP_EPSILON

#define CLIP_EPSILON   0.001

Definition at line 226 of file r_local.h.

◆ COLMODEL

#define COLMODEL

Definition at line 35 of file r_local.h.

◆ CYCLE

#define CYCLE   128

Definition at line 197 of file r_local.h.

◆ DS_SPAN_LIST_END

#define DS_SPAN_LIST_END   -128

Definition at line 201 of file r_local.h.

◆ FINALVERT_FLAGS

#define FINALVERT_FLAGS   24

Definition at line 310 of file r_local.h.

◆ FINALVERT_LB

#define FINALVERT_LB   48

Definition at line 318 of file r_local.h.

◆ FINALVERT_LG

#define FINALVERT_LG   44

Definition at line 317 of file r_local.h.

◆ FINALVERT_LR

#define FINALVERT_LR   40

Definition at line 316 of file r_local.h.

◆ FINALVERT_SIZE

#define FINALVERT_SIZE   52

Definition at line 319 of file r_local.h.

◆ FINALVERT_V0

#define FINALVERT_V0   0

Definition at line 304 of file r_local.h.

◆ FINALVERT_V1

#define FINALVERT_V1   4

Definition at line 305 of file r_local.h.

◆ FINALVERT_V2

#define FINALVERT_V2   8

Definition at line 306 of file r_local.h.

◆ FINALVERT_V3

#define FINALVERT_V3   12

Definition at line 307 of file r_local.h.

◆ FINALVERT_V4

#define FINALVERT_V4   16

Definition at line 308 of file r_local.h.

◆ FINALVERT_V5

#define FINALVERT_V5   20

Definition at line 309 of file r_local.h.

◆ FINALVERT_X

#define FINALVERT_X   28

Definition at line 311 of file r_local.h.

◆ FINALVERT_Y

#define FINALVERT_Y   32

Definition at line 312 of file r_local.h.

◆ FINALVERT_Z

#define FINALVERT_Z   36

Definition at line 313 of file r_local.h.

◆ id386

#define id386   0

Definition at line 31 of file r_local.h.

◆ INFINITE_DISTANCE

#define INFINITE_DISTANCE   0x10000

Definition at line 173 of file r_local.h.

◆ LIGHT_MIN

#define LIGHT_MIN   5

Definition at line 243 of file r_local.h.

◆ MAX_LBM_HEIGHT

#define MAX_LBM_HEIGHT   480

Definition at line 184 of file r_local.h.

◆ MAXALIASVERTS

#define MAXALIASVERTS   2000

Definition at line 234 of file r_local.h.

◆ MAXHEIGHT

#define MAXHEIGHT   1200

Definition at line 170 of file r_local.h.

◆ MAXSPANS

#define MAXSPANS   8192

Definition at line 208 of file r_local.h.

◆ MAXVERTS

#define MAXVERTS   64

Definition at line 166 of file r_local.h.

◆ MAXWIDTH

#define MAXWIDTH   1600

Definition at line 171 of file r_local.h.

◆ MAXWORKINGVERTS

#define MAXWORKINGVERTS   (MAXVERTS+4)

Definition at line 167 of file r_local.h.

◆ MINEDGES

#define MINEDGES   NUMSTACKEDGES

Definition at line 205 of file r_local.h.

◆ MINSURFACES

#define MINSURFACES   NUMSTACKSURFACES

Definition at line 207 of file r_local.h.

◆ NEAR_CLIP

#define NEAR_CLIP   0.01

Definition at line 231 of file r_local.h.

◆ NUMSTACKEDGES

#define NUMSTACKEDGES   8192

Definition at line 204 of file r_local.h.

◆ NUMSTACKSURFACES

#define NUMSTACKSURFACES   8192

Definition at line 206 of file r_local.h.

◆ PARTICLE_Z_CLIP

#define PARTICLE_Z_CLIP   8.0

Definition at line 187 of file r_local.h.

◆ PITCH

#define PITCH   0

Definition at line 39 of file r_local.h.

◆ REF_VERSION

#define REF_VERSION   "KolorSoft 1.1"

Definition at line 36 of file r_local.h.

◆ ROLL

#define ROLL   2

Definition at line 45 of file r_local.h.

◆ SCANBUFFERPAD

#define SCANBUFFERPAD   0x1000

Definition at line 199 of file r_local.h.

◆ SMALL_FINALVERT

#define SMALL_FINALVERT   0

Definition at line 266 of file r_local.h.

◆ SPEED

#define SPEED   20

Definition at line 241 of file r_local.h.

◆ SURFCACHE_SIZE_AT_320X240

#define SURFCACHE_SIZE_AT_320X240   1024*768

Definition at line 218 of file r_local.h.

◆ TRANSPARENT_COLOR

#define TRANSPARENT_COLOR   0xFF

Definition at line 190 of file r_local.h.

◆ TURB_TEX_SIZE

#define TURB_TEX_SIZE   64

Definition at line 194 of file r_local.h.

◆ VID_CBITS

#define VID_CBITS   6

Definition at line 158 of file r_local.h.

◆ VID_GRADES

#define VID_GRADES   (1 << VID_CBITS)

Definition at line 159 of file r_local.h.

◆ WARP_HEIGHT

#define WARP_HEIGHT   240

Definition at line 181 of file r_local.h.

◆ WARP_WIDTH

#define WARP_WIDTH   320

Definition at line 180 of file r_local.h.

◆ XCENTERING

#define XCENTERING   (1.0 / 2.0)

Definition at line 223 of file r_local.h.

◆ YAW

#define YAW   1

Definition at line 42 of file r_local.h.

◆ YCENTERING

#define YCENTERING   (1.0 / 2.0)

Definition at line 224 of file r_local.h.

Typedef Documentation

◆ bedge_t

typedef struct bedge_s bedge_t

◆ clipplane_t

typedef struct clipplane_s clipplane_t

◆ edge_t

typedef struct edge_s edge_t

◆ espan_t

typedef struct espan_s espan_t

◆ finalvert_t

typedef struct finalvert_s finalvert_t

◆ image_t

typedef struct image_s image_t

◆ pixel_t

typedef unsigned char pixel_t

Definition at line 84 of file r_local.h.

◆ surf_t

typedef struct surf_s surf_t

◆ surfcache_t

typedef struct surfcache_s surfcache_t

◆ swstate_t

typedef struct swstate_s swstate_t

◆ vrect_t

typedef struct vrect_s vrect_t

Enumeration Type Documentation

◆ imagetype_t

Enumerator
it_skin 
it_sprite 
it_wall 
it_pic 
it_sky 
it_skin 
it_sprite 
it_wall 
it_pic 
it_sky 
it_skin 
it_sprite 
it_wall 
it_pic 
it_sky 

Definition at line 62 of file r_local.h.

63 {
64  it_skin,
65  it_sprite,
66  it_wall,
67  it_pic,
68  it_sky
69 } imagetype_t;

◆ rserr_t

enum rserr_t
Enumerator
rserr_ok 
rserr_invalid_fullscreen 
rserr_invalid_mode 
rserr_unknown 
rserr_ok 
rserr_invalid_fullscreen 
rserr_invalid_mode 
rserr_unknown 
rserr_ok 
rserr_invalid_fullscreen 
rserr_invalid_mode 
rserr_unknown 

Definition at line 103 of file r_local.h.

104 {
105  rserr_ok,
106 
109 
111 } rserr_t;

Function Documentation

◆ BestColor()

byte BestColor ( int  r,
int  g,
int  b,
int  start,
int  stop 
)

Definition at line 135 of file r_draw.c.

136 {
137  int i;
138  int dr, dg, db;
139  int bestdistortion, distortion;
140  int berstcolor;
141  byte *pal;
142 
143  //
144  // let any color go to 0 as a last resort
145  //
146  // R_GetPalette();
147  bestdistortion = 256 * 256 * 4;
148  berstcolor = 0;
149 
150  if (r > 255) r = 255;
151  if (g > 255) g = 255;
152  if (b > 255) b = 255;
153 
154  pal = (byte *)d_8to24table + start * 4;
155  for (i = start; i <= stop; i++)
156  {
157  dr = r - (int)pal[0];
158  dg = g - (int)pal[1];
159  db = b - (int)pal[2];
160  pal += 4;
161  distortion = dr*dr + dg*dg + db*db + dr * 5 + dg * 5 + db * 5; //qb: this will increase color sensitity at low brightness. Added + dr + dg + db
162  if (distortion < bestdistortion)
163  {
164  if (!distortion)
165  return i; // perfect match
166 
167  bestdistortion = distortion;
168  berstcolor = i;
169  }
170  }
171  return berstcolor;
172 }

Referenced by Draw_InitRGBMap().

◆ D_CacheSurface()

surfcache_t* D_CacheSurface ( msurface_t surface,
int  miplevel 
)

Definition at line 638 of file r_surf.c.

639 {
640  surfcache_t *cache;
641 
642 //
643 // if the surface is animating or flashing, flush the cache
644 //
646  r_drawsurf.lightadj[0] = r_newrefdef.lightstyles[surface->styles[0]].white*128;
647  r_drawsurf.lightadj[1] = r_newrefdef.lightstyles[surface->styles[1]].white*128;
648  r_drawsurf.lightadj[2] = r_newrefdef.lightstyles[surface->styles[2]].white*128;
649  r_drawsurf.lightadj[3] = r_newrefdef.lightstyles[surface->styles[3]].white*128;
650 
651 //
652 // see if the cache holds apropriate data
653 //
654  cache = surface->cachespots[miplevel];
655 
656  if (cache && !cache->dlight && surface->dlightframe != r_framecount
657  && cache->image == r_drawsurf.image
658  && cache->lightadj[0] == r_drawsurf.lightadj[0]
659  && cache->lightadj[1] == r_drawsurf.lightadj[1]
660  && cache->lightadj[2] == r_drawsurf.lightadj[2]
661  && cache->lightadj[3] == r_drawsurf.lightadj[3] )
662  return cache;
663 
664 //
665 // determine shape of surface
666 //
667  surfscale = 1.0 / (1<<miplevel);
669  r_drawsurf.surfwidth = surface->extents[0] >> miplevel;
671  r_drawsurf.surfheight = surface->extents[1] >> miplevel;
672 
673 //
674 // allocate memory if needed
675 //
676  if (!cache) // if a texture just animated, don't reallocate it
677  {
678  cache = D_SCAlloc (r_drawsurf.surfwidth,
680  surface->cachespots[miplevel] = cache;
681  cache->owner = &surface->cachespots[miplevel];
682  cache->mipscale = surfscale;
683  }
684 
685  if (surface->dlightframe == r_framecount)
686  cache->dlight = 1;
687  else
688  cache->dlight = 0;
689 
690  r_drawsurf.surfdat = (pixel_t *)cache->data;
691 
692  cache->image = r_drawsurf.image;
693  cache->lightadj[0] = r_drawsurf.lightadj[0];
694  cache->lightadj[1] = r_drawsurf.lightadj[1];
695  cache->lightadj[2] = r_drawsurf.lightadj[2];
696  cache->lightadj[3] = r_drawsurf.lightadj[3];
697 
698 //
699 // draw and light the surface texture
700 //
701  r_drawsurf.surf = surface;
702 
703  c_surf++;
704 
705  // calculate the lightings
706  if (coloredlights)
707  R_BuildLightMapRGB(); // leilei - colored lights
708  else
709  R_BuildLightMap();
710 
711  // rasterize the surface into the cache
712  R_DrawSurface ();
713 
714  return cache;
715 }

Referenced by D_SolidSurf(), and R_BuildPolygonFromSurface().

◆ D_DrawSpans16()

void D_DrawSpans16 ( espan_t pspans)

Definition at line 429 of file r_scan.c.

430 {
431  sstep = 0; // keep compiler happy
432  tstep = 0; // ditto
433 
434  pbase = (byte *)cacheblock;
435  sdivzstepu = d_sdivzstepu * 16;
436  tdivzstepu = d_tdivzstepu * 16;
437  zistepu = d_zistepu * 16;
438 
439  do
440  {
441  pdest = (byte *)((byte *)d_viewbuffer + (r_screenwidth * pspan->v) + pspan->u);
442  count = pspan->count >> 4;
443 
444  spancount = pspan->count % 16;
445 
446  // calculate the initial s/z, t/z, 1/z, s, and t and clamp
447  du = (float)pspan->u;
448  dv = (float)pspan->v;
449 
453  z = (float)0x10000 / zi; // prescale to 16.16 fixed-point
454 
455  s = (int)(sdivz * z) + sadjust;
456  if (s < 0) s = 0;
457  else if (s > bbextents) s = bbextents;
458 
459  t = (int)(tdivz * z) + tadjust;
460  if (t < 0) t = 0;
461  else if (t > bbextentt) t = bbextentt;
462 
463  while (count-- > 0) // Manoel Kasimier
464  {
465  sdivz += sdivzstepu;
466  tdivz += tdivzstepu;
467  zi += zistepu;
468  z = (float)0x10000 / zi; // prescale to 16.16 fixed-point
469 
470  snext = (int)(sdivz * z) + sadjust;
471  if (snext < 16) snext = 16;
472  else if (snext > bbextents) snext = bbextents;
473 
474  tnext = (int)(tdivz * z) + tadjust;
475  if (tnext < 16) tnext = 16;
476  else if (tnext > bbextentt) tnext = bbextentt;
477 
478  sstep = (snext - s) >> 4;
479  tstep = (tnext - t) >> 4;
480  pdest += 16;
481  WRITEPDEST(-16);
482  WRITEPDEST(-15);
483  WRITEPDEST(-14);
484  WRITEPDEST(-13);
485  WRITEPDEST(-12);
486  WRITEPDEST(-11);
487  WRITEPDEST(-10);
488  WRITEPDEST(-9);
489  WRITEPDEST(-8);
490  WRITEPDEST(-7);
491  WRITEPDEST(-6);
492  WRITEPDEST(-5);
493  WRITEPDEST(-4);
494  WRITEPDEST(-3);
495  WRITEPDEST(-2);
496  WRITEPDEST(-1);
497  s = snext;
498  t = tnext;
499  }
500  if (spancount > 0)
501  {
502  spancountminus1 = (float)(spancount - 1);
506  z = (float)0x10000 / zi; // prescale to 16.16 fixed-point
507 
508  snext = (int)(sdivz * z) + sadjust;
509  if (snext < 16) snext = 16;
510  else if (snext > bbextents) snext = bbextents;
511 
512  tnext = (int)(tdivz * z) + tadjust;
513  if (tnext < 16) tnext = 16;
514  else if (tnext > bbextentt) tnext = bbextentt;
515 
516  if (spancount > 1)
517  {
518  sstep = (snext - s) / (spancount - 1);
519  tstep = (tnext - t) / (spancount - 1);
520  }
521 
522  pdest += spancount;
523 
524  switch (spancount)
525  {
526  case 16:
527  WRITEPDEST(-16);
528  case 15:
529  WRITEPDEST(-15);
530  case 14:
531  WRITEPDEST(-14);
532  case 13:
533  WRITEPDEST(-13);
534  case 12:
535  WRITEPDEST(-12);
536  case 11:
537  WRITEPDEST(-11);
538  case 10:
539  WRITEPDEST(-10);
540  case 9:
541  WRITEPDEST(-9);
542  case 8:
543  WRITEPDEST(-8);
544  case 7:
545  WRITEPDEST(-7);
546  case 6:
547  WRITEPDEST(-6);
548  case 5:
549  WRITEPDEST(-5);
550  case 4:
551  WRITEPDEST(-4);
552  case 3:
553  WRITEPDEST(-3);
554  case 2:
555  WRITEPDEST(-2);
556  case 1:
557  WRITEPDEST(-1);
558  break;
559  }
560  }
561  } while ((pspan = pspan->pnext) != NULL);
562 }

Referenced by D_SkySurf(), and D_SolidSurf().

◆ D_DrawSurfaces()

void D_DrawSurfaces ( void  )

Definition at line 1088 of file r_edge.c.

1089 {
1090  surf_t *s;
1091 
1092 // currententity = NULL; //&r_worldentity;
1096 
1097  if (!sw_drawflat->value)
1098  {
1099  for (s = &surfaces[1] ; s<surface_p ; s++)
1100  {
1101  if (!s->spans)
1102  continue;
1103 
1104  r_drawnpolycount++;
1105 
1106  if (! (s->flags & (SURF_DRAWSKYBOX|SURF_DRAWBACKGROUND|SURF_DRAWTURB) ) )
1107  D_SolidSurf (s);
1108  else if (s->flags & SURF_DRAWSKYBOX)
1109  D_SkySurf (s);
1110  else if (s->flags & SURF_DRAWBACKGROUND)
1111  D_BackgroundSurf (s);
1112  else if (s->flags & SURF_DRAWTURB)
1113  D_TurbulentSurf (s);
1114  }
1115  }
1116  else
1117  D_DrawflatSurfaces ();
1118 
1119  currententity = NULL; //&r_worldentity;
1121  R_TransformFrustum ();
1122 }

Referenced by R_ScanEdges().

◆ D_DrawZSpans()

void D_DrawZSpans ( espan_t pspans)

Definition at line 574 of file r_scan.c.

575 {
576  short *pdest;
577  unsigned ltemp;
578 
579  // FIXME: check for clamping/range problems
580  // we count on FP exceptions being turned off to avoid range problems
581  izistep = (int)(d_zistepu * 0x8000 * 0x10000);
582 
583  do
584  {
585  pdest = d_pzbuffer + (d_zwidth * pspan->v) + pspan->u;
586 
587  count = pspan->count;
588 
589  // calculate the initial 1/z
590  du = (float)pspan->u;
591  dv = (float)pspan->v;
592 
594  // we count on FP exceptions being turned off to avoid range problems
595  izi = (int)(zi * 0x8000 * 0x10000);
596 
597  if ((intptr_t)pdest & 0x02)
598  {
599  *pdest++ = (short)(izi >> 16);
600  izi += izistep;
601  count--;
602  }
603 
604  if ((spancount = count >> 1) > 0)
605  {
606  do
607  {
608  ltemp = izi >> 16;
609  izi += izistep;
610  ltemp |= izi & 0xFFFF0000;
611  izi += izistep;
612  *(int *)pdest = ltemp;
613  pdest += 2;
614  } while (--spancount > 0);
615  }
616 
617  if (count & 1)
618  *pdest = (short)(izi >> 16);
619 
620  } while ((pspan = pspan->pnext) != NULL);
621 }

Referenced by D_BackgroundSurf(), D_DrawflatSurfaces(), D_SkySurf(), D_SolidSurf(), and D_TurbulentSurf().

◆ D_FlushCaches()

void D_FlushCaches ( void  )

Definition at line 481 of file r_surf.c.

482 {
483  surfcache_t *c;
484 
485  if (!sc_base)
486  return;
487 
488  for (c = sc_base ; c ; c = c->next)
489  {
490  if (c->owner)
491  *c->owner = NULL;
492  }
493 
494  sc_rover = sc_base;
495  sc_base->next = NULL;
496  sc_base->owner = NULL;
497  sc_base->size = sc_size;
498 }

Referenced by R_BeginRegistration(), R_InitGraphics(), R_SetupFrame(), and R_Shutdown().

◆ D_ViewChanged()

void D_ViewChanged ( void  )

Definition at line 78 of file r_misc.c.

79 {
80  int i;
81 
83  if (yscale > xscale)
85 
86  d_zrowbytes = vid.width * 2;
87  d_zwidth = vid.width;
88 
89  d_pix_min = r_refdef.vrect.width / 320;
90  if (d_pix_min < 1)
91  d_pix_min = 1;
92 
93  d_pix_max = (int)((float)r_refdef.vrect.width / (800.0 / 4.0) + 0.5); //qb: smaller particles. was 320.0
94  d_pix_shift = 8 - (int)((float)r_refdef.vrect.width / 800.0 + 0.5); //qb: smaller particles. was 320.0
95  if (d_pix_max < 1)
96  d_pix_max = 1;
97 
103 
104  for (i=0 ; i<vid.height; i++)
105  {
108  }
109 
110  /*
111  ** clear Z-buffer and color-buffers if we're doing the gallery
112  */
114  {
115  memset( d_pzbuffer, 0xff, vid.width * vid.height * sizeof( d_pzbuffer[0] ) );
117  }
118 
120 
121  D_Patch ();
122 }

Referenced by R_ViewChanged().

◆ D_WarpScreen()

void D_WarpScreen ( void  )

Definition at line 52 of file r_scan.c.

53 {
54  static int w, h;
55  static int u, v, u2, v2;
56  static byte *dest;
57  static int *turb;
58  static int *col;
59  static byte **row;
60 
61  static int cached_width, cached_height;
62  static byte *rowptr[4200 + AMP2 * 2]; //qb: 4K... was 1200
63  static int column[2400 + AMP2 * 2]; //qb: 4K... was 1600
64 
65  //
66  // these are constant over resolutions, and can be saved
67  //
69  h = r_newrefdef.height;
70  if (w != cached_width || h != cached_height)
71  {
72  cached_width = w;
73  cached_height = h;
74  for (v = 0; v < h + AMP2 * 2; v++)
75  {
76  v2 = (int)((float)v / (h + AMP2 * 2) * r_refdef.vrect.height);
77  rowptr[v] = r_warpbuffer + (r_warpwidth * v2);
78  }
79 
80  for (u = 0; u < w + AMP2 * 2; u++)
81  {
82  u2 = (int)((float)u / (w + AMP2 * 2) * r_refdef.vrect.width);
83  column[u] = u2;
84  }
85  }
86 
87  turb = intsintable + ((int)(r_newrefdef.time*SPEED)&(CYCLE - 1));
89 
90  for (v = 0; v < h; v++, dest += vid.rowbytes)
91  {
92  col = &column[turb[v]];
93  row = &rowptr[v];
94  for (u = 0; u < w; u += 4)
95  {
96  dest[u + 0] = row[turb[u + 0]][col[u + 0]];
97  dest[u + 1] = row[turb[u + 1]][col[u + 1]];
98  dest[u + 2] = row[turb[u + 2]][col[u + 2]];
99  dest[u + 3] = row[turb[u + 3]][col[u + 3]];
100  }
101  }
102 }

Referenced by R_RenderFrame().

◆ Draw_Char()

void Draw_Char ( int  x,
int  y,
int  c 
)

Definition at line 242 of file r_draw.c.

243 {
244  byte *dest;
245  byte *source;
246  byte *src;
247  int drawline;
248  int row, col, f, i, v, skip = 0;
249  int fstep, tbyte, sv;
250 
251  num &= 255;
252 
253  if (num == 32 || num == 32 + 128)
254  return;
255 
256  if (y <= -8)
257  return; // totally off screen
258 
259  // if ( ( y + 8 ) >= vid.height )
260  if ((y + 8) > vid.height) // PGM - status text was missing in sw...
261  return;
262 
263  cvar_t *scale = ri.Cvar_Get("hudscale", "1", 0);
264 
265 #ifdef PARANOID
266  if (y > vid.height - 8 || x < 0 || x > vid.width - 8)
267  ri.Sys_Error(ERR_FATAL, "Con_DrawCharacter: (%i, %i)", x, y);
268  if (num < 0 || num > 255)
269  ri.Sys_Error(ERR_FATAL, "Con_DrawCharacter: char %i", num);
270 #endif
271 
272  row = num >> 4;
273  col = num & 15;
274  source = draw_chars->pixels[0] + (row << 10) + (col << 3);
275 
276  if (y < 0)
277  { // clipped
278  skip = y;
279  drawline = 8 * scale->value + y;
280  source -= 128 * y;
281  y = 0;
282  }
283  else
284  drawline = 8 * scale->value;
285 
286  dest = vid.buffer + y*vid.rowbytes + x;
287  fstep = 0x8000 / scale->value;
288 
289  for (v = 0; v < drawline; v++, dest += vid.rowbytes)
290  {
291  sv = (skip + v) / scale->value;
292  src = source + sv * draw_chars->width;
293  f = 0;
294 
295  for (i = 0; i < 8 * scale->value; i += 4)
296  {
297  if ((tbyte = src[f >> 15]) != TRANSPARENT_COLOR)
298  dest[i] = tbyte;
299  f += fstep;
300 
301  if ((tbyte = src[f >> 15]) != TRANSPARENT_COLOR)
302  dest[i + 1] = tbyte;
303  f += fstep;
304 
305  if ((tbyte = src[f >> 15]) != TRANSPARENT_COLOR)
306  dest[i + 2] = tbyte;
307  f += fstep;
308 
309  if ((tbyte = src[f >> 15]) != TRANSPARENT_COLOR)
310  dest[i + 3] = tbyte;
311  f += fstep;
312  }
313  }
314 }

◆ Draw_FadeScreen()

void Draw_FadeScreen ( void  )

Definition at line 620 of file r_draw.c.

621 {
622  int x, y;
623  byte *pbuf;
624  int t;
625 
626  for (y = 0; y < vid.height; y++)
627  {
628  pbuf = (byte *)(vid.buffer + vid.rowbytes*y);
629  t = (y & 1) << 1;
630 
631  for (x = 0; x < vid.width; x++)
632  {
633  if ((x & 3) != t)
634  pbuf[x] = 0;
635  }
636  }
637 }

◆ Draw_Fill()

void Draw_Fill ( int  x,
int  y,
int  w,
int  h,
int  c 
)

Definition at line 586 of file r_draw.c.

587 {
588  byte *dest;
589  int u, v;
590 
591  if (x + w > vid.width)
592  w = vid.width - x;
593  if (y + h > vid.height)
594  h = vid.height - y;
595  if (x < 0)
596  {
597  w += x;
598  x = 0;
599  }
600  if (y < 0)
601  {
602  h += y;
603  y = 0;
604  }
605  if (w < 0 || h < 0)
606  return;
607  dest = vid.buffer + y*vid.rowbytes + x;
608  for (v = 0; v < h; v++, dest += vid.rowbytes)
609  for (u = 0; u < w; u++)
610  dest[u] = c;
611 }

◆ Draw_FindPic()

struct image_s* Draw_FindPic ( char *  name)

Definition at line 37 of file r_draw.c.

38 {
39  image_t *image;
40  char fullname[MAX_QPATH];
41 
42  if (name[0] != '/' && name[0] != '\\')
43  {
44  Com_sprintf(fullname, sizeof(fullname), "pics/%s.pcx", name);
45  image = R_FindImage(fullname, it_pic);
46  }
47  else
48  image = R_FindImage(name + 1, it_pic);
49 
50  return image;
51 }

◆ Draw_GetPalette()

void Draw_GetPalette ( void  )

Definition at line 1423 of file r_main.c.

1424 {
1425  byte *out;
1426  int i;
1427  int r, g, b;
1428 
1429  // get the palette and colormap
1430  LoadPCX("pics/colormap.pcx", &vid.colormap, &thepalette, NULL, NULL);
1431  if (!vid.colormap)
1432  ri.Sys_Error(ERR_FATAL, "Couldn't load pics/colormap.pcx");
1433  vid.alphamap = vid.colormap + 64 * 256;
1434  out = (byte *)d_8to24table;
1435  for (i=0 ; i<256 ; i++, out+=4)
1436  {
1437  r = thepalette[i*3+0];
1438  g = thepalette[i*3+1];
1439  b = thepalette[i*3+2];
1440 
1441  out[0] = r;
1442  out[1] = g;
1443  out[2] = b;
1444  }
1445 }

Referenced by R_Init().

◆ Draw_GetPicSize()

void Draw_GetPicSize ( int w,
int h,
char *  name 
)

Definition at line 321 of file r_draw.c.

322 {
323  image_t *gl;
324 
325  gl = Draw_FindPic(pic);
326  if (!gl)
327  {
328  *w = *h = -1;
329  return;
330  }
331  cvar_t *scale = ri.Cvar_Get("hudscale", "1", 0);
332 
333  *w = gl->width*scale->value;
334  *h = gl->height*scale->value;
335 }

◆ Draw_InitLocal()

void Draw_InitLocal ( void  )

Definition at line 222 of file r_draw.c.

223 {
224  draw_chars = Draw_FindPic("conchars");
225  // Knightmare- error out instead of crashing if we can't load this
226  if (!draw_chars)
227  ri.Sys_Error(ERR_FATAL, "Couldn't load pics/conchars.pcx");
228  // end Knightmare
229 }

◆ Draw_InitRGBMap()

void Draw_InitRGBMap ( void  )

Definition at line 174 of file r_draw.c.

175 {
176  int r, g, b;
177  float ra, ga, ba, ia;
178  int beastcolor;
179  float mypow = 1 / 1.3;
180  float mydiv = 200;
181  float mysat = r_lightsaturation->value; // was 1.6;
182 
183  // Make the 18-bit lookup table here
184  // This is a HUGE 256kb table, the biggest there is here
185  // TODO: Option to enable this
186 
187  {
188  Draw_8to24((byte *)d_8to24table);
189  for (r = 0; r < 256; r += 4)
190  {
191  for (g = 0; g < 256; g += 4)
192  {
193  for (b = 0; b < 256; b += 4)
194  {
195  // 3dfx gamma hack, trying to match the saturation and gamma of the refgl+3dfxgl combo so many q2 players are familiar with
196 
197  ra = pow(r / mydiv, mypow) * mydiv;
198  ga = pow(g / mydiv, mypow) * mydiv;
199  ba = pow(b / mydiv, mypow) * mydiv;
200 
201  ia = (ra * 0.333) + (ga * 0.333) + (ba * 0.333);
202  ra = ia + (ra - ia) * mysat;
203  ga = ia + (ga - ia) * mysat;
204  ba = ia + (ba - ia) * mysat;
205  //beastcolor = BestColor (pow(ra / mydiv, mypow) * mydiv, pow(ga / mydiv, mypow) * mydiv, pow(ba / mydiv, mypow) * mydiv, 1, 254);
206  beastcolor = BestColor((int)ra, (int)ga, (int)ba, 1, 254);
207  //beastcolor = BestColor (ra, ga, ba, 1, 254);
208  palmap2[r >> 2][g >> 2][b >> 2] = beastcolor;
209 
210  }
211  }
212  }
213  }
214 }

Referenced by R_Init().

◆ Draw_Pic()

void Draw_Pic ( int  x,
int  y,
char *  name 
)

Definition at line 438 of file r_draw.c.

439 {
440  image_t *pic;
441  byte *dest, *source;
442  int v, u;
443  int tbyte;
444  int height;
445 
446  pic = Draw_FindPic(name);
447  if (!pic)
448  {
449  ri.Con_Printf(PRINT_ALL, "Can't find pic: %s\n", name);
450  return;
451  }
452 
453  cvar_t *scale = ri.Cvar_Get("hudscale", "1", 0);
454  if (scale->value > 1.f)
455  {
456  Draw_StretchPicImplementation(x, y, pic->width*scale->value, pic->height*scale->value, pic);
457  return;
458  }
459 
460  if ((x < 0) ||
461  (x + pic->width > vid.width) ||
462  (y + pic->height > vid.height))
463  return; // ri.Sys_Error (ERR_FATAL,"Draw_Pic: bad coordinates");
464 
465  height = pic->height;
466  source = pic->pixels[0];
467  if (y < 0)
468  {
469  height += y;
470  source += pic->width*-y;
471  y = 0;
472  }
473 
474  dest = vid.buffer + y * vid.rowbytes + x;
475 
476  if (!pic->transparent)
477  {
478  for (v = 0; v < height; v++)
479  {
480  memcpy(dest, source, pic->width);
481  dest += vid.rowbytes;
482  source += pic->width;
483  }
484  }
485  else
486  {
487  if (pic->width & 7)
488  { // general
489  for (v = 0; v < height; v++)
490  {
491  for (u = 0; u < pic->width; u++)
492  if ((tbyte = source[u]) != TRANSPARENT_COLOR)
493  dest[u] = tbyte;
494 
495  dest += vid.rowbytes;
496  source += pic->width;
497  }
498  }
499  else
500  { // unwound
501  for (v = 0; v < height; v++)
502  {
503  for (u = 0; u < pic->width; u += 8)
504  {
505  if ((tbyte = source[u]) != TRANSPARENT_COLOR)
506  dest[u] = tbyte;
507  if ((tbyte = source[u + 1]) != TRANSPARENT_COLOR)
508  dest[u + 1] = tbyte;
509  if ((tbyte = source[u + 2]) != TRANSPARENT_COLOR)
510  dest[u + 2] = tbyte;
511  if ((tbyte = source[u + 3]) != TRANSPARENT_COLOR)
512  dest[u + 3] = tbyte;
513  if ((tbyte = source[u + 4]) != TRANSPARENT_COLOR)
514  dest[u + 4] = tbyte;
515  if ((tbyte = source[u + 5]) != TRANSPARENT_COLOR)
516  dest[u + 5] = tbyte;
517  if ((tbyte = source[u + 6]) != TRANSPARENT_COLOR)
518  dest[u + 6] = tbyte;
519  if ((tbyte = source[u + 7]) != TRANSPARENT_COLOR)
520  dest[u + 7] = tbyte;
521  }
522  dest += vid.rowbytes;
523  source += pic->width;
524  }
525  }
526  }
527 }

◆ Draw_StretchPic()

void Draw_StretchPic ( int  x,
int  y,
int  w,
int  h,
char *  name 
)

Definition at line 405 of file r_draw.c.

406 {
407  image_t *pic;
408 
409  pic = Draw_FindPic(name);
410  if (!pic)
411  {
412  ri.Con_Printf(PRINT_ALL, "Can't find pic: %s\n", name);
413  return;
414  }
415  Draw_StretchPicImplementation(x, y, w, h, pic);
416 }

◆ Draw_StretchRaw()

void Draw_StretchRaw ( int  x,
int  y,
int  w,
int  h,
int  cols,
int  rows,
byte data 
)

Definition at line 423 of file r_draw.c.

424 {
425  image_t pic;
426 
427  pic.pixels[0] = data;
428  pic.width = cols;
429  pic.height = rows;
430  Draw_StretchPicImplementation(x, y, w, h, &pic);
431 }

◆ Draw_TileClear()

void Draw_TileClear ( int  x,
int  y,
int  w,
int  h,
char *  name 
)

Definition at line 537 of file r_draw.c.

538 {
539  int i, j;
540  byte *psrc;
541  byte *pdest;
542  image_t *pic;
543  int x2;
544 
545  if (x < 0)
546  {
547  w += x;
548  x = 0;
549  }
550  if (y < 0)
551  {
552  h += y;
553  y = 0;
554  }
555  if (x + w > vid.width)
556  w = vid.width - x;
557  if (y + h > vid.height)
558  h = vid.height - y;
559  if (w <= 0 || h <= 0)
560  return;
561 
562  pic = Draw_FindPic(name);
563  if (!pic)
564  {
565  ri.Con_Printf(PRINT_ALL, "Can't find pic: %s\n", name);
566  return;
567  }
568  x2 = x + w;
570  for (i = 0; i < h; i++, pdest += vid.rowbytes)
571  {
572  psrc = pic->pixels[0] + pic->width * ((i + y) & 63);
573  for (j = x; j < x2; j++)
574  pdest[j] = psrc[j & 63];
575  }
576 }

◆ FindColor()

int FindColor ( int  r,
int  g,
int  b 
)

Definition at line 96 of file r_draw.c.

97 {
98  int bestcolor;
99 
100  if (r > 255)r = 255; if (r < 0)r = 0;
101  if (g > 255)g = 255; if (g < 0)g = 0;
102  if (b > 255)b = 255; if (b < 0)b = 0;
103  bestcolor = palmap2[r >> 3][g >> 3][b >> 3];
104  return bestcolor;
105 }

◆ LoadPCX()

void LoadPCX ( char *  filename,
byte **  pic,
byte **  palette,
int width,
int height 
)

Definition at line 87 of file r_image.c.

88 {
89  byte *raw;
90  pcx_t *pcx;
91  int x, y;
92  int len;
93  int dataByte, runLength;
94  byte *out, *pix;
95 
96  *pic = NULL;
97 
98  //
99  // load the file
100  //
101  len = ri.FS_LoadFile (filename, (void **)&raw);
102  if (!raw)
103  {
104  ri.Con_Printf (PRINT_DEVELOPER, "Bad pcx file %s\n", filename);
105  return;
106  }
107 
108  //
109  // parse the PCX file
110  //
111  pcx = (pcx_t *)raw;
112 
113  pcx->xmin = LittleShort(pcx->xmin);
114  pcx->ymin = LittleShort(pcx->ymin);
115  pcx->xmax = LittleShort(pcx->xmax);
116  pcx->ymax = LittleShort(pcx->ymax);
117  pcx->hres = LittleShort(pcx->hres);
118  pcx->vres = LittleShort(pcx->vres);
121 
122  raw = &pcx->data;
123 
124  if (pcx->manufacturer != 0x0a
125  || pcx->version != 5
126  || pcx->encoding != 1
127  || pcx->bits_per_pixel != 8
128  || pcx->xmax >= 640
129  || pcx->ymax >= 480)
130  {
131  ri.Con_Printf (PRINT_ALL, "Bad pcx file %s\n", filename);
132  return;
133  }
134 
135  out = malloc ( (pcx->ymax+1) * (pcx->xmax+1) );
136 
137  *pic = out;
138 
139  pix = out;
140 
141  if (palette)
142  {
143  *palette = malloc(768);
144  memcpy (*palette, (byte *)pcx + len - 768, 768);
145  }
146 
147  if (width)
148  *width = pcx->xmax+1;
149  if (height)
150  *height = pcx->ymax+1;
151 
152  for (y=0 ; y<=pcx->ymax ; y++, pix += pcx->xmax+1)
153  {
154  for (x=0 ; x<=pcx->xmax ; )
155  {
156  dataByte = *raw++;
157 
158  if((dataByte & 0xC0) == 0xC0)
159  {
160  runLength = dataByte & 0x3F;
161  dataByte = *raw++;
162  }
163  else
164  runLength = 1;
165 
166  while(runLength-- > 0)
167  pix[x++] = dataByte;
168  }
169 
170  }
171 
172  if ( raw - (byte *)pcx > len)
173  {
174  ri.Con_Printf (PRINT_DEVELOPER, "PCX file %s was malformed", filename);
175  free (*pic);
176  *pic = NULL;
177  }
178 
179  ri.FS_FreeFile (pcx);
180 }

◆ NonTurbulent8()

void NonTurbulent8 ( espan_t pspan)

Definition at line 281 of file r_scan.c.

282 {
283 
284  // r_turb_turb = sintable + ((int)(r_newrefdef.time*SPEED)&(CYCLE-1));
286 
287  r_turb_sstep = 0; // keep compiler happy
288  r_turb_tstep = 0; // ditto
289 
290  r_turb_pbase = (unsigned char *)cacheblock;
291 
292  sdivzstepu = d_sdivzstepu * 16;
293  tdivzstepu = d_tdivzstepu * 16;
294  zistepu = d_zistepu * 16;
295 
296  do
297  {
298  r_turb_pdest = (unsigned char *)((byte *)d_viewbuffer +
299  (r_screenwidth * pspan->v) + pspan->u);
300 
301  count = pspan->count;
302 
303  // calculate the initial s/z, t/z, 1/z, s, and t and clamp
304  du = (float)pspan->u;
305  dv = (float)pspan->v;
306 
310  z = (float)0x10000 / zi; // prescale to 16.16 fixed-point
311 
312  r_turb_s = (int)(sdivz * z) + sadjust;
313  if (r_turb_s > bbextents)
315  else if (r_turb_s < 0)
316  r_turb_s = 0;
317 
318  r_turb_t = (int)(tdivz * z) + tadjust;
319  if (r_turb_t > bbextentt)
321  else if (r_turb_t < 0)
322  r_turb_t = 0;
323 
324  do
325  {
326  // calculate s and t at the far end of the span
327  if (count >= 16)
328  r_turb_spancount = 16;
329  else
331 
333 
334  if (count)
335  {
336  // calculate s/z, t/z, zi->fixed s and t at far end of span,
337  // calculate s and t steps across span by shifting
338  sdivz += sdivzstepu;
339  tdivz += tdivzstepu;
340  zi += zistepu;
341  z = (float)0x10000 / zi; // prescale to 16.16 fixed-point
342 
343  snext = (int)(sdivz * z) + sadjust;
344  if (snext > bbextents)
345  snext = bbextents;
346  else if (snext < 16)
347  snext = 16; // prevent round-off error on <0 steps from
348  // from causing overstepping & running off the
349  // edge of the texture
350 
351  tnext = (int)(tdivz * z) + tadjust;
352  if (tnext > bbextentt)
353  tnext = bbextentt;
354  else if (tnext < 16)
355  tnext = 16; // guard against round-off error on <0 steps
356 
357  r_turb_sstep = (snext - r_turb_s) >> 4;
358  r_turb_tstep = (tnext - r_turb_t) >> 4;
359  }
360  else
361  {
362  // calculate s/z, t/z, zi->fixed s and t at last pixel in span (so
363  // can't step off polygon), clamp, calculate s and t steps across
364  // span by division, biasing steps low so we don't run off the
365  // texture
366  spancountminus1 = (float)(r_turb_spancount - 1);
370  z = (float)0x10000 / zi; // prescale to 16.16 fixed-point
371  snext = (int)(sdivz * z) + sadjust;
372  if (snext > bbextents)
373  snext = bbextents;
374  else if (snext < 16)
375  snext = 16; // prevent round-off error on <0 steps from
376  // from causing overstepping & running off the
377  // edge of the texture
378 
379  tnext = (int)(tdivz * z) + tadjust;
380  if (tnext > bbextentt)
381  tnext = bbextentt;
382  else if (tnext < 16)
383  tnext = 16; // guard against round-off error on <0 steps
384 
385  if (r_turb_spancount > 1)
386  {
389  }
390  }
391 
392  r_turb_s = r_turb_s & ((CYCLE << 16) - 1);
393  r_turb_t = r_turb_t & ((CYCLE << 16) - 1);
394 
395  D_DrawTurbulent8Span(pspan);
396 
397  r_turb_s = snext;
398  r_turb_t = tnext;
399 
400  } while (count > 0);
401 
402  } while ((pspan = pspan->pnext) != NULL);
403 }

Referenced by D_TurbulentSurf().

◆ R_AddPolygonEdges()

void R_AddPolygonEdges ( emitpoint_t pverts,
int  numverts,
int  miplevel 
)

◆ R_AliasClipTriangle()

void R_AliasClipTriangle ( finalvert_t index0,
finalvert_t index1,
finalvert_t index2 
)

Definition at line 271 of file r_aclip.c.

272 {
273  int i, k, pingpong;
274  unsigned clipflags;
275 
276 // copy vertexes and fix seam texture coordinates
277  fv[0][0] = *index0;
278  fv[0][1] = *index1;
279  fv[0][2] = *index2;
280 
281 // clip
282  clipflags = fv[0][0].flags | fv[0][1].flags | fv[0][2].flags;
283 
284  if (clipflags & ALIAS_Z_CLIP)
285  {
286  k = R_AliasClip (fv[0], fv[1], ALIAS_Z_CLIP, 3, R_Alias_clip_z);
287  if (k == 0)
288  return;
289 
290  pingpong = 1;
291  clipflags = fv[1][0].flags | fv[1][1].flags | fv[1][2].flags;
292  }
293  else
294  {
295  pingpong = 0;
296  k = 3;
297  }
298 
299  if (clipflags & ALIAS_LEFT_CLIP)
300  {
301  k = R_AliasClip (fv[pingpong], fv[pingpong ^ 1],
303  if (k == 0)
304  return;
305 
306  pingpong ^= 1;
307  }
308 
309  if (clipflags & ALIAS_RIGHT_CLIP)
310  {
311  k = R_AliasClip (fv[pingpong], fv[pingpong ^ 1],
313  if (k == 0)
314  return;
315 
316  pingpong ^= 1;
317  }
318 
319  if (clipflags & ALIAS_BOTTOM_CLIP)
320  {
321  k = R_AliasClip (fv[pingpong], fv[pingpong ^ 1],
323  if (k == 0)
324  return;
325 
326  pingpong ^= 1;
327  }
328 
329  if (clipflags & ALIAS_TOP_CLIP)
330  {
331  k = R_AliasClip (fv[pingpong], fv[pingpong ^ 1],
333  if (k == 0)
334  return;
335 
336  pingpong ^= 1;
337  }
338 
339  for (i=0 ; i<k ; i++)
340  {
341  if (fv[pingpong][i].u < r_refdef.aliasvrect.x)
342  fv[pingpong][i].u = r_refdef.aliasvrect.x;
343  else if (fv[pingpong][i].u > r_refdef.aliasvrectright)
344  fv[pingpong][i].u = r_refdef.aliasvrectright;
345 
346  if (fv[pingpong][i].v < r_refdef.aliasvrect.y)
347  fv[pingpong][i].v = r_refdef.aliasvrect.y;
348  else if (fv[pingpong][i].v > r_refdef.aliasvrectbottom)
349  fv[pingpong][i].v = r_refdef.aliasvrectbottom;
350 
351  fv[pingpong][i].flags = 0;
352  }
353 
354 // draw triangles
355  for (i=1 ; i<k-1 ; i++)
356  {
357  aliastriangleparms.a = &fv[pingpong][0];
358  aliastriangleparms.b = &fv[pingpong][i];
359  aliastriangleparms.c = &fv[pingpong][i+1];
360  R_DrawTriangle();
361  }
362 }

Referenced by R_AliasPreparePoints().

◆ R_AliasClipTriangleRGB()

void R_AliasClipTriangleRGB ( finalvert_t index0,
finalvert_t index1,
finalvert_t index2 
)

Definition at line 372 of file r_aclip.c.

373 {
374  int i, k, pingpong;
375  unsigned clipflags;
376 
377 // copy vertexes and fix seam texture coordinates
378  fv[0][0] = *index0;
379  fv[0][1] = *index1;
380  fv[0][2] = *index2;
381 
382 // clip
383  clipflags = fv[0][0].flags | fv[0][1].flags | fv[0][2].flags;
384 
385  if (clipflags & ALIAS_Z_CLIP)
386  {
387  k = R_AliasClip (fv[0], fv[1], ALIAS_Z_CLIP, 3, R_Alias_clip_z);
388  if (k == 0)
389  return;
390 
391  pingpong = 1;
392  clipflags = fv[1][0].flags | fv[1][1].flags | fv[1][2].flags;
393  }
394  else
395  {
396  pingpong = 0;
397  k = 3;
398  }
399 
400  if (clipflags & ALIAS_LEFT_CLIP)
401  {
402  k = R_AliasClip (fv[pingpong], fv[pingpong ^ 1],
404  if (k == 0)
405  return;
406 
407  pingpong ^= 1;
408  }
409 
410  if (clipflags & ALIAS_RIGHT_CLIP)
411  {
412  k = R_AliasClip (fv[pingpong], fv[pingpong ^ 1],
414  if (k == 0)
415  return;
416 
417  pingpong ^= 1;
418  }
419 
420  if (clipflags & ALIAS_BOTTOM_CLIP)
421  {
422  k = R_AliasClip (fv[pingpong], fv[pingpong ^ 1],
424  if (k == 0)
425  return;
426 
427  pingpong ^= 1;
428  }
429 
430  if (clipflags & ALIAS_TOP_CLIP)
431  {
432  k = R_AliasClip (fv[pingpong], fv[pingpong ^ 1],
434  if (k == 0)
435  return;
436 
437  pingpong ^= 1;
438  }
439 
440  for (i=0 ; i<k ; i++)
441  {
442  if (fv[pingpong][i].u < r_refdef.aliasvrect.x)
443  fv[pingpong][i].u = r_refdef.aliasvrect.x;
444  else if (fv[pingpong][i].u > r_refdef.aliasvrectright)
445  fv[pingpong][i].u = r_refdef.aliasvrectright;
446 
447  if (fv[pingpong][i].v < r_refdef.aliasvrect.y)
448  fv[pingpong][i].v = r_refdef.aliasvrect.y;
449  else if (fv[pingpong][i].v > r_refdef.aliasvrectbottom)
450  fv[pingpong][i].v = r_refdef.aliasvrectbottom;
451 
452  fv[pingpong][i].flags = 0;
453  }
454 
455 // draw triangles
456  for (i=1 ; i<k-1 ; i++)
457  {
458  aliastriangleparms.a = &fv[pingpong][0];
459  aliastriangleparms.b = &fv[pingpong][i];
460  aliastriangleparms.c = &fv[pingpong][i+1];
461  R_DrawTriangle();
462  }
463 }

Referenced by R_AliasPreparePoints().

◆ R_AliasDrawModel()

void R_AliasDrawModel ( void  )

Definition at line 1068 of file r_alias.c.

1069 {
1070  extern void(*d_pdrawspans)(void *);
1071  extern void R_PolysetDrawSpans8_Opaque_Coloured(void *);
1072  extern void R_PolysetDrawSpans8_33(void *);
1073  extern void R_PolysetDrawSpans8_66(void *);
1074  extern void R_PolysetDrawSpansConstant8_33(void *);
1075  extern void R_PolysetDrawSpansConstant8_66(void *);
1076 
1078 
1079  if (r_lerpmodels->value == 0)
1080  currententity->backlerp = 0;
1081 
1083  {
1084  if (r_lefthand->value == 1.0F)
1086  else if (r_lefthand->value == 2.0F)
1087  return;
1088  }
1089 
1090  /*
1091  ** we have to set our frame pointers and transformations before
1092  ** doing any real work
1093  */
1096 
1097  // see if the bounding box lets us trivially reject, also sets
1098  // trivial accept status
1100  {
1101  if ((currententity->flags & RF_WEAPONMODEL) && (r_lefthand->value == 1.0F))
1102  {
1104  }
1105  return;
1106  }
1107 
1108  // set up the skin and verify it exists
1109  if (!R_AliasSetupSkin())
1110  {
1111  ri.Con_Printf(PRINT_ALL, "R_AliasDrawModel %s: NULL skin found\n",
1112  currentmodel->name);
1113  return;
1114  }
1115 
1116  r_amodels_drawn++;
1118 
1119  /*
1120  ** select the proper span routine based on translucency
1121  */
1122  // PMM - added double damage shell
1123  // PMM - reordered to handle blending
1125  {
1126  int color;
1127 
1128  // PMM - added double
1130  // PMM - reordered, new shells after old shells (so they get overriden)
1131 
1132  if (color == RF_SHELL_RED)
1134  else if (color == RF_SHELL_GREEN)
1136  else if (color == RF_SHELL_BLUE)
1138  else if (color == (RF_SHELL_RED | RF_SHELL_GREEN))
1140  else if (color == (RF_SHELL_RED | RF_SHELL_BLUE))
1142  else if (color == (RF_SHELL_BLUE | RF_SHELL_GREEN))
1144  // PMM - added this .. it's yellowish
1145  else if (color == (RF_SHELL_DOUBLE))
1147  else if (color == (RF_SHELL_HALF_DAM))
1149  // pmm
1150  else
1152  /* if ( color & RF_SHELL_RED )
1153  {
1154  if ( ( color & RF_SHELL_BLUE) && ( color & RF_SHELL_GREEN) )
1155  r_aliasblendcolor = SHELL_WHITE_COLOR;
1156  else if ( color & (RF_SHELL_BLUE | RF_SHELL_DOUBLE))
1157  r_aliasblendcolor = SHELL_RB_COLOR;
1158  else
1159  r_aliasblendcolor = SHELL_RED_COLOR;
1160  }
1161  else if ( color & RF_SHELL_BLUE)
1162  {
1163  if ( color & RF_SHELL_DOUBLE )
1164  r_aliasblendcolor = SHELL_CYAN_COLOR;
1165  else
1166  r_aliasblendcolor = SHELL_BLUE_COLOR;
1167  }
1168  else if ( color & (RF_SHELL_DOUBLE) )
1169  r_aliasblendcolor = SHELL_DOUBLE_COLOR;
1170  else if ( color & (RF_SHELL_HALF_DAM) )
1171  r_aliasblendcolor = SHELL_HALF_DAM_COLOR;
1172  else if ( color & RF_SHELL_GREEN )
1173  r_aliasblendcolor = SHELL_GREEN_COLOR;
1174  else
1175  r_aliasblendcolor = SHELL_WHITE_COLOR;
1176  */
1177 
1178  if (currententity->alpha > 0.33)
1180  else
1182  }
1183  else if (currententity->flags & RF_TRANSLUCENT)
1184  {
1185  if (currententity->alpha > 0.66)
1187  else if (currententity->alpha > 0.33)
1189  else
1191  }
1192  else
1193  {
1195  }
1196 
1197  /*
1198  ** compute this_frame and old_frame addresses
1199  */
1201 
1203  s_ziscale = (float)0x8000 * (float)0x10000 * 3.0;
1204  else
1205  s_ziscale = (float)0x8000 * (float)0x10000;
1206 
1208 
1209  if ((currententity->flags & RF_WEAPONMODEL) && (r_lefthand->value == 1.0F))
1210  {
1212  }
1213 }

Referenced by R_DrawEntitiesOnList().

◆ R_AnimateLight()

void R_AnimateLight ( void  )

◆ R_BeginEdgeFrame()

void R_BeginEdgeFrame ( void  )

Definition at line 109 of file r_edge.c.

110 {
111  int v;
112 
113  edge_p = r_edges;
115 
116  surface_p = &surfaces[2]; // background is surface 1,
117  // surface 0 is a dummy
118  surfaces[1].spans = NULL; // no background spans yet
120 
121 // put the background behind everything in the world
122  if (sw_draworder->value)
123  {
125  surfaces[1].key = 0;
126  r_currentkey = 1;
127  }
128  else
129  {
131  surfaces[1].key = 0x7FFfFFFF;
132  r_currentkey = 0;
133  }
134 
135 // FIXME: set with memset
136  for (v=r_refdef.vrect.y ; v<r_refdef.vrectbottom ; v++)
137  {
138  newedges[v] = removeedges[v] = NULL;
139  }
140 }

Referenced by R_EdgeDrawing().

◆ R_BeginFrame()

void R_BeginFrame ( float  camera_separation)

Definition at line 1177 of file r_main.c.

1178 {
1179  extern void Draw_BuildGammaTable(void);
1180 #ifdef REDBLUE
1181  SetStereoBuffer((camera_separation <= 0.0) ? 0 : 1);
1182 #endif
1183  /*
1184  ** rebuild the gamma correction palette if necessary
1185  */
1186  if (vid_gamma->modified)
1187  {
1189  R_GammaCorrectAndSetPalette((const unsigned char *)d_8to24table);
1190 
1191  vid_gamma->modified = false;
1192  }
1193 
1195  {
1196  rserr_t err;
1197 
1198  /* a bit hackish approach to enable custom resolutions:
1199  * SWimp_SetMode needs these values set for mode -1 */
1202 
1203  /*
1204  ** if this returns rserr_invalid_fullscreen then it set the mode but not as a
1205  ** fullscreen mode, e.g. 320x200 on a system that doesn't support that res
1206  */
1208  {
1210 
1211  if (sw_mode->value == -1)
1212  {
1213  sw_state.prev_mode = 4; /* safe default for custom mode */
1214  }
1215  else
1216  {
1218  }
1219 
1220  vid_fullscreen->modified = false;
1221  sw_mode->modified = false;
1222  }
1223  else
1224  {
1225  if (err == rserr_invalid_mode)
1226  {
1227  ri.Cvar_SetValue("sw_mode", sw_state.prev_mode);
1228  ri.Con_Printf(PRINT_ALL, "ref_soft::R_BeginFrame() - could not set mode\n");
1229  }
1230  else if (err == rserr_invalid_fullscreen)
1231  {
1233  ri.Con_Printf(PRINT_ALL, "ref_soft::R_BeginFrame() - fullscreen unavailable in this mode\n");
1235  // vid_fullscreen->modified = false;
1236  // sw_mode->modified = false;
1237  }
1238  else
1239  {
1240  ri.Sys_Error(ERR_FATAL, "ref_soft::R_BeginFrame() - catastrophic mode change failure\n");
1241  }
1242  }
1243  }
1244 }

◆ R_BeginRegistration()

void R_BeginRegistration ( char *  map)

Definition at line 1213 of file r_model.c.

1214 {
1215  char fullname[MAX_QPATH];
1216  cvar_t *flushmap;
1217 
1219  r_oldviewcluster = -1; // force markleafs
1220  Com_sprintf(fullname, sizeof(fullname), "maps/%s.bsp", model);
1221 
1222  D_FlushCaches();
1223  // explicitly free the old map if different
1224  // this guarantees that mod_known[0] is the world map
1225  flushmap = ri.Cvar_Get("flushmap", "0", 0);
1226  if (strcmp(mod_known[0].name, fullname) || flushmap->value)
1227  Mod_Free(&mod_known[0]);
1228  r_worldmodel = R_RegisterModel(fullname);
1229  R_NewMap();
1230 }

Referenced by GetRefAPI().

◆ R_CinematicSetPalette()

void R_CinematicSetPalette ( const unsigned char *  palette)

Definition at line 1274 of file r_main.c.

1275 {
1276  byte palette32[1024];
1277  int i, j, w;
1278  int *d;
1279 
1280  // clear screen to black to avoid any palette flash
1281  w = abs(vid.rowbytes) >> 2; // stupid negative pitch win32 stuff...
1282  for (i = 0; i < vid.height; i++, d += w)
1283  {
1284  d = (int *)(vid.buffer + i*vid.rowbytes);
1285  for (j = 0; j < w; j++)
1286  d[j] = 0;
1287  }
1288  // flush it to the screen
1289  SWimp_EndFrame();
1290 
1291  if (palette)
1292  {
1293  for (i = 0; i < 256; i++)
1294  {
1295  palette32[i * 4 + 0] = palette[i * 3 + 0];
1296  palette32[i * 4 + 1] = palette[i * 3 + 1];
1297  palette32[i * 4 + 2] = palette[i * 3 + 2];
1298  palette32[i * 4 + 3] = 0xFF;
1299  }
1300 
1301  R_GammaCorrectAndSetPalette(palette32);
1302  }
1303  else
1304  {
1305  R_GammaCorrectAndSetPalette((const unsigned char *)d_8to24table);
1306  }
1307 }

Referenced by GetRefAPI().

◆ R_ClearPolyList()

void R_ClearPolyList ( void  )

◆ R_ClipEdge()

void R_ClipEdge ( mvertex_t pv0,
mvertex_t pv1,
clipplane_t clip 
)

Definition at line 398 of file r_rast.c.

399 {
400  float d0, d1, f;
401  mvertex_t clipvert;
402 
403  if (clip)
404  {
405  do
406  {
407  d0 = DotProduct (pv0->position, clip->normal) - clip->dist;
408  d1 = DotProduct (pv1->position, clip->normal) - clip->dist;
409 
410  if (d0 >= 0)
411  {
412  // point 0 is unclipped
413  if (d1 >= 0)
414  {
415  // both points are unclipped
416  continue;
417  }
418 
419  // only point 1 is clipped
420 
421  // we don't cache clipped edges
422  cacheoffset = 0x7FFFFFFF;
423 
424  f = d0 / (d0 - d1);
425  clipvert.position[0] = pv0->position[0] +
426  f * (pv1->position[0] - pv0->position[0]);
427  clipvert.position[1] = pv0->position[1] +
428  f * (pv1->position[1] - pv0->position[1]);
429  clipvert.position[2] = pv0->position[2] +
430  f * (pv1->position[2] - pv0->position[2]);
431 
432  if (clip->leftedge)
433  {
434  r_leftclipped = true;
435  r_leftexit = clipvert;
436  }
437  else if (clip->rightedge)
438  {
439  r_rightclipped = true;
440  r_rightexit = clipvert;
441  }
442 
443  R_ClipEdge (pv0, &clipvert, clip->next);
444  return;
445  }
446  else
447  {
448  // point 0 is clipped
449  if (d1 < 0)
450  {
451  // both points are clipped
452  // we do cache fully clipped edges
453  if (!r_leftclipped)
456  return;
457  }
458 
459  // only point 0 is clipped
460  r_lastvertvalid = false;
461 
462  // we don't cache partially clipped edges
463  cacheoffset = 0x7FFFFFFF;
464 
465  f = d0 / (d0 - d1);
466  clipvert.position[0] = pv0->position[0] +
467  f * (pv1->position[0] - pv0->position[0]);
468  clipvert.position[1] = pv0->position[1] +
469  f * (pv1->position[1] - pv0->position[1]);
470  clipvert.position[2] = pv0->position[2] +
471  f * (pv1->position[2] - pv0->position[2]);
472 
473  if (clip->leftedge)
474  {
475  r_leftclipped = true;
476  r_leftenter = clipvert;
477  }
478  else if (clip->rightedge)
479  {
480  r_rightclipped = true;
481  r_rightenter = clipvert;
482  }
483 
484  R_ClipEdge (&clipvert, pv1, clip->next);
485  return;
486  }
487  } while ((clip = clip->next) != NULL);
488  }
489 
490 // add the edge
491  R_EmitEdge (pv0, pv1);
492 }

Referenced by R_RenderBmodelFace(), and R_RenderFace().

◆ R_cshift_f()

void R_cshift_f ( void  )

◆ R_DLightPoint()

float R_DLightPoint ( vec3_t  p)

◆ R_DrawAlphaSurfaces()

void R_DrawAlphaSurfaces ( void  )

Definition at line 1342 of file r_poly.c.

1343 {
1345 
1347 
1348  modelorg[0] = -r_origin[0];
1349  modelorg[1] = -r_origin[1];
1350  modelorg[2] = -r_origin[2];
1351 
1352  while (s)
1353  {
1355 
1356  //=======
1357  //PGM
1358  // if (s->texinfo->flags & SURF_TRANS66)
1359  // R_ClipAndDrawPoly( 0.60f, ( s->texinfo->flags & SURF_WARP) != 0, true );
1360  // else
1361  // R_ClipAndDrawPoly( 0.30f, ( s->texinfo->flags & SURF_WARP) != 0, true );
1362 
1363  // PGM - pass down all the texinfo flags, not just SURF_WARP.
1364  if (s->texinfo->flags & SURF_TRANS66)
1365  R_ClipAndDrawPoly(0.60f, (s->texinfo->flags & (SURF_WARP | SURF_FLOWING)), true);
1366  else
1367  R_ClipAndDrawPoly(0.30f, (s->texinfo->flags & (SURF_WARP | SURF_FLOWING)), true);
1368 
1369  //PGM
1370  //=======
1371 
1372  s = s->nextalphasurface;
1373  }
1374 
1376 }

Referenced by R_RenderFrame(), and R_RenderView().

◆ R_DrawBeam()

void R_DrawBeam ( entity_t e)

Definition at line 1342 of file r_main.c.

1343 {
1344 #define NUM_BEAM_SEGS 6
1345 
1346  int i;
1347 
1348  vec3_t perpvec;
1349  vec3_t direction, normalized_direction;
1350  vec3_t start_points[NUM_BEAM_SEGS], end_points[NUM_BEAM_SEGS];
1351  vec3_t oldorigin, origin;
1352 
1353  oldorigin[0] = e->oldorigin[0];
1354  oldorigin[1] = e->oldorigin[1];
1355  oldorigin[2] = e->oldorigin[2];
1356 
1357  origin[0] = e->origin[0];
1358  origin[1] = e->origin[1];
1359  origin[2] = e->origin[2];
1360 
1361  normalized_direction[0] = direction[0] = oldorigin[0] - origin[0];
1362  normalized_direction[1] = direction[1] = oldorigin[1] - origin[1];
1363  normalized_direction[2] = direction[2] = oldorigin[2] - origin[2];
1364 
1365  if (VectorNormalize(normalized_direction) == 0)
1366  return;
1367 
1368  PerpendicularVector(perpvec, normalized_direction);
1369  VectorScale(perpvec, e->frame / 2, perpvec);
1370 
1371  for (i = 0; i < NUM_BEAM_SEGS; i++)
1372  {
1373  RotatePointAroundVector(start_points[i], normalized_direction, perpvec, (360.0 / NUM_BEAM_SEGS)*i);
1374  VectorAdd(start_points[i], origin, start_points[i]);
1375  VectorAdd(start_points[i], direction, end_points[i]);
1376  }
1377 
1378  for (i = 0; i < NUM_BEAM_SEGS; i++)
1379  {
1380  R_IMFlatShadedQuad(start_points[i],
1381  end_points[i],
1382  end_points[(i + 1) % NUM_BEAM_SEGS],
1383  start_points[(i + 1) % NUM_BEAM_SEGS],
1384  e->skinnum & 0xFF,
1385  e->alpha);
1386  }
1387 }

◆ R_DrawParticle()

void R_DrawParticle ( void  )

Definition at line 475 of file r_part.c.

476 {
477  particle_t *pparticle = partparms.particle;
478  int level = partparms.level;
479  int color = pparticle->color;
480 
481  /*
482  ** transform the particle
483  */
484  VectorSubtract (pparticle->origin, r_origin, local);
485 
489 
490  if (transformed[2] < PARTICLE_Z_CLIP)
491  return;
492 
493  /*
494  ** bind the blend function pointer to the appropriate blender
495  */
496  if ( level == PARTICLE_33 )
498  else if ( level == PARTICLE_66 )
500  else
502 
503  /*
504  ** project the point
505  */
506  // FIXME: preadjust xcenter and ycenter
507  zi = 1.0 / transformed[2];
508  u = (int)(xcenter + zi * transformed[0] + 0.5);
509  v = (int)(ycenter - zi * transformed[1] + 0.5);
510 
511  if ((v > d_vrectbottom_particle) ||
512  (u > d_vrectright_particle) ||
513  (v < d_vrecty) ||
514  (u < d_vrectx))
515  {
516  return;
517  }
518 
519  /*
520  ** compute addresses of zbuffer, framebuffer, and
521  ** compute the Z-buffer reference value.
522  */
523  pz = d_pzbuffer + (d_zwidth * v) + u;
525  izi = (int)(zi * 0x8000);
526 
527  /*
528  ** determine the screen area covered by the particle,
529  ** which also means clamping to a min and max
530  */
531  pix = izi >> d_pix_shift;
532  if (pix < d_pix_min)
533  pix = d_pix_min;
534  else if (pix > d_pix_max)
535  pix = d_pix_max;
536 
537  /*
538  ** render the appropriate pixels
539  */
540  count = pix;
541 
542  switch (level) {
543  case PARTICLE_33 :
544  for ( ; count ; count--, pz += d_zwidth, pdest += r_screenwidth)
545  {
546 //FIXME--do it in blocks of 8?
547  for (i=0 ; i<pix ; i++)
548  {
549  if (pz[i] <= izi)
550  {
551  pz[i] = izi;
552  pdest[i] = vid.alphamap[color + ((int)pdest[i]<<8)];
553  }
554  }
555  }
556  break;
557 
558  case PARTICLE_66 :
559  for ( ; count ; count--, pz += d_zwidth, pdest += r_screenwidth)
560  {
561  for (i=0 ; i<pix ; i++)
562  {
563  if (pz[i] <= izi)
564  {
565  pz[i] = izi;
566  pdest[i] = vid.alphamap[(color<<8) + (int)pdest[i]];
567  }
568  }
569  }
570  break;
571 
572  default: //100
573  for ( ; count ; count--, pz += d_zwidth, pdest += r_screenwidth)
574  {
575  for (i=0 ; i<pix ; i++)
576  {
577  if (pz[i] <= izi)
578  {
579  pz[i] = izi;
580  pdest[i] = color;
581  }
582  }
583  }
584  break;
585  }
586 }

Referenced by R_DrawParticles().

◆ R_DrawParticles()

void R_DrawParticles ( void  )

Definition at line 598 of file r_part.c.

599 {
600  particle_t *p;
601  int i;
602 
603 #if !defined __linux__ && !defined __FreeBSD__
604  extern unsigned long fpu_sp24_cw, fpu_chop_cw;
605 #endif
606 
609  VectorCopy( vpn, r_ppn );
610 
611 #if id386 && !defined __linux__ && !defined __FreeBSD__
612  __asm fldcw word ptr [fpu_sp24_cw]
613 #endif
614 
615  for (p=r_newrefdef.particles, i=0 ; i<r_newrefdef.num_particles ; i++,p++)
616  {
617 
618  if ( p->alpha > 0.66 )
620  else if ( p->alpha > 0.33 )
622  else
624 
625  partparms.particle = p;
626  partparms.color = p->color;
627 
628 #if id386 && !defined __linux__ && !defined __FreeBSD__
629  if ( i < r_newrefdef.num_particles-1 )
630  s_prefetch_address = ( unsigned int ) ( p + 1 );
631  else
632  s_prefetch_address = ( unsigned int ) r_newrefdef.particles;
633 #endif
634 
635  R_DrawParticle();
636  }
637 
638 #if id386 && !defined __linux__ && !defined __FreeBSD__
639  __asm fldcw word ptr [fpu_chop_cw]
640 #endif
641 
642 }

Referenced by R_RenderFrame(), and R_RenderView().

◆ R_DrawPolyList()

void R_DrawPolyList ( void  )

◆ R_DrawSolidClippedSubmodelPolygons()

void R_DrawSolidClippedSubmodelPolygons ( model_t pmodel,
mnode_t topnode 
)

Definition at line 336 of file r_bsp.c.

337 {
338  int i, j, lindex;
339  vec_t dot;
340  msurface_t *psurf;
341  int numsurfaces;
342  mplane_t *pplane;
343  mvertex_t bverts[MAX_BMODEL_VERTS];
344  bedge_t bedges[MAX_BMODEL_EDGES], *pbedge;
345  medge_t *pedge, *pedges;
346 
347 // FIXME: use bounding-box-based frustum clipping info?
348 
349  psurf = &pmodel->surfaces[pmodel->firstmodelsurface];
350  numsurfaces = pmodel->nummodelsurfaces;
351  pedges = pmodel->edges;
352 
353  for (i=0 ; i<numsurfaces ; i++, psurf++)
354  {
355  // find which side of the node we are on
356  pplane = psurf->plane;
357 
358  dot = DotProduct (modelorg, pplane->normal) - pplane->dist;
359 
360  // draw the polygon
361  if (( !(psurf->flags & SURF_PLANEBACK) && (dot < -BACKFACE_EPSILON)) ||
362  ((psurf->flags & SURF_PLANEBACK) && (dot > BACKFACE_EPSILON)))
363  continue;
364 
365  // FIXME: use bounding-box-based frustum clipping info?
366 
367  // copy the edges to bedges, flipping if necessary so always
368  // clockwise winding
369  // FIXME: if edges and vertices get caches, these assignments must move
370  // outside the loop, and overflow checking must be done here
371  pbverts = bverts;
372  pbedges = bedges;
373  numbverts = numbedges = 0;
374  pbedge = &bedges[numbedges];
375  numbedges += psurf->numedges;
376 
377  for (j=0 ; j<psurf->numedges ; j++)
378  {
379  lindex = pmodel->surfedges[psurf->firstedge+j];
380 
381  if (lindex > 0)
382  {
383  pedge = &pedges[lindex];
384  pbedge[j].v[0] = &r_pcurrentvertbase[pedge->v[0]];
385  pbedge[j].v[1] = &r_pcurrentvertbase[pedge->v[1]];
386  }
387  else
388  {
389  lindex = -lindex;
390  pedge = &pedges[lindex];
391  pbedge[j].v[0] = &r_pcurrentvertbase[pedge->v[1]];
392  pbedge[j].v[1] = &r_pcurrentvertbase[pedge->v[0]];
393  }
394 
395  pbedge[j].pnext = &pbedge[j+1];
396  }
397 
398  pbedge[j-1].pnext = NULL; // mark end of edges
399 
400  if ( !( psurf->texinfo->flags & ( SURF_TRANS66 | SURF_TRANS33 ) ) )
401  R_RecursiveClipBPoly (pbedge, topnode, psurf);
402  else
403  R_RenderBmodelFace( pbedge, psurf );
404  }
405 }

Referenced by R_DrawBEntitiesOnList().

◆ R_DrawSprite()

void R_DrawSprite ( void  )

Definition at line 40 of file r_sprite.c.

41 {
42  vec5_t *pverts;
43  vec3_t left, up, right, down;
44  dsprite_t *s_psprite;
45  dsprframe_t *s_psprframe;
46 
47 
48  s_psprite = (dsprite_t *)currentmodel->extradata;
49 #if 0
50  if (currententity->frame >= s_psprite->numframes
51  || currententity->frame < 0)
52  {
53  ri.Con_Printf (PRINT_ALL, "No such sprite frame %i\n",
55  currententity->frame = 0;
56  }
57 #endif
58  currententity->frame %= s_psprite->numframes;
59 
60  s_psprframe = &s_psprite->frames[currententity->frame];
61 
63  r_polydesc.pixel_width = s_psprframe->width;
64  r_polydesc.pixel_height = s_psprframe->height;
65  r_polydesc.dist = 0;
66 
67  // generate the sprite's axes, completely parallel to the viewplane.
71 
72 // build the sprite poster in worldspace
74  s_psprframe->width - s_psprframe->origin_x, right);
76  s_psprframe->height - s_psprframe->origin_y, up);
78  -s_psprframe->origin_x, left);
80  -s_psprframe->origin_y, down);
81 
82  // invert UP vector for sprites
84 
85  pverts = r_clip_verts[0];
86 
87  pverts[0][0] = r_entorigin[0] + up[0] + left[0];
88  pverts[0][1] = r_entorigin[1] + up[1] + left[1];
89  pverts[0][2] = r_entorigin[2] + up[2] + left[2];
90  pverts[0][3] = 0;
91  pverts[0][4] = 0;
92 
93  pverts[1][0] = r_entorigin[0] + up[0] + right[0];
94  pverts[1][1] = r_entorigin[1] + up[1] + right[1];
95  pverts[1][2] = r_entorigin[2] + up[2] + right[2];
96  pverts[1][3] = s_psprframe->width;
97  pverts[1][4] = 0;
98 
99  pverts[2][0] = r_entorigin[0] + down[0] + right[0];
100  pverts[2][1] = r_entorigin[1] + down[1] + right[1];
101  pverts[2][2] = r_entorigin[2] + down[2] + right[2];
102  pverts[2][3] = s_psprframe->width;
103  pverts[2][4] = s_psprframe->height;
104 
105  pverts[3][0] = r_entorigin[0] + down[0] + left[0];
106  pverts[3][1] = r_entorigin[1] + down[1] + left[1];
107  pverts[3][2] = r_entorigin[2] + down[2] + left[2];
108  pverts[3][3] = 0;
109  pverts[3][4] = s_psprframe->height;
110 
111  r_polydesc.nump = 4;
115 
118  R_ClipAndDrawPoly ( currententity->alpha, false, true );
119  else
120  R_ClipAndDrawPoly ( 1.0F, false, true );
122 }

Referenced by R_DrawEntitiesOnList().

◆ R_DrawSubmodelPolygons()

void R_DrawSubmodelPolygons ( model_t pmodel,
int  clipflags,
mnode_t topnode 
)

Definition at line 415 of file r_bsp.c.

416 {
417  int i;
418  vec_t dot;
419  msurface_t *psurf;
420  int numsurfaces;
421  mplane_t *pplane;
422 
423 // FIXME: use bounding-box-based frustum clipping info?
424 
425  psurf = &pmodel->surfaces[pmodel->firstmodelsurface];
426  numsurfaces = pmodel->nummodelsurfaces;
427 
428  for (i=0 ; i<numsurfaces ; i++, psurf++)
429  {
430  // find which side of the node we are on
431  pplane = psurf->plane;
432 
433  dot = DotProduct (modelorg, pplane->normal) - pplane->dist;
434 
435  // draw the polygon
436  if (((psurf->flags & SURF_PLANEBACK) && (dot < -BACKFACE_EPSILON)) ||
437  (!(psurf->flags & SURF_PLANEBACK) && (dot > BACKFACE_EPSILON)))
438  {
439  r_currentkey = ((mleaf_t *)topnode)->key;
440 
441  // FIXME: use bounding-box-based frustum clipping info?
442  R_RenderFace (psurf, clipflags);
443  }
444  }
445 }

Referenced by R_DrawBEntitiesOnList().

◆ R_DrawSurface()

void R_DrawSurface ( void  )

Definition at line 145 of file r_surf.c.

146 {
147  unsigned char *basetptr;
148  int smax, tmax, twidth;
149  int u;
150  int soffset, basetoffset, texwidth;
151  int horzblockstep;
152  unsigned char *pcolumndest;
153  void (*pblockdrawer)(void);
154  image_t *mt;
155 
157 
158  mt = r_drawsurf.image;
159 
161 
162 // the fractional light values should range from 0 to (VID_GRADES - 1) << 16
163 // from a source range of 0 - 255
164 
165  texwidth = mt->width >> r_drawsurf.surfmip;
166 
167  blocksize = 16 >> r_drawsurf.surfmip;
169  blockdivmask = (1 << blockdivshift) - 1;
170 
171  r_lightwidth = (r_drawsurf.surf->extents[0]>>4)+1;
172 
175 
176 //==============================
177  if (coloredlights)
178  pblockdrawer = surfmiptable8RGB[r_drawsurf.surfmip]; // leilei - colored lights
179  else
180  pblockdrawer = surfmiptable[r_drawsurf.surfmip];
181 
182 // TODO: only needs to be set when there is a display settings change
183  horzblockstep = blocksize;
184 
185  smax = mt->width >> r_drawsurf.surfmip;
186  twidth = texwidth;
187  tmax = mt->height >> r_drawsurf.surfmip;
188  sourcetstep = texwidth;
189  r_stepback = tmax * twidth;
190 
191  r_sourcemax = r_source + (tmax * smax);
192 
193  soffset = r_drawsurf.surf->texturemins[0];
194  basetoffset = r_drawsurf.surf->texturemins[1];
195 
196 // << 16 components are to guarantee positive values for %
197  soffset = ((soffset >> r_drawsurf.surfmip) + (smax << 16)) % smax;
198  basetptr = &r_source[((((basetoffset >> r_drawsurf.surfmip)
199  + (tmax << 16)) % tmax) * twidth)];
200 
201  pcolumndest = r_drawsurf.surfdat;
202 
203  for (u=0 ; u<r_numhblocks; u++)
204  {
205  // leilei - colored lights
206  if (coloredlights)
207  r_lightptr = (int*)blocklights + u * 3;
208  else
209  // o^_^o
210  r_lightptr = (int*)blocklights + u;
211 
212  prowdestbase = pcolumndest;
213 
214  pbasesource = basetptr + soffset;
215 
216  (*pblockdrawer)();
217 
218  soffset = soffset + blocksize;
219  if (soffset >= smax)
220  soffset = 0;
221 
222  pcolumndest += horzblockstep;
223  }
224 }

Referenced by D_CacheSurface().

◆ R_DrawSurfaceBlock16()

void R_DrawSurfaceBlock16 ( void  )

◆ R_DrawSurfaceBlock8()

void R_DrawSurfaceBlock8 ( void  )

◆ R_DrawSurfaceBlock8RGB_mip0()

void R_DrawSurfaceBlock8RGB_mip0 ( void  )

◆ R_DrawSurfaceBlock8RGB_mip1()

void R_DrawSurfaceBlock8RGB_mip1 ( void  )

◆ R_DrawSurfaceBlock8RGB_mip2()

void R_DrawSurfaceBlock8RGB_mip2 ( void  )

◆ R_DrawSurfaceBlock8RGB_mip3()

void R_DrawSurfaceBlock8RGB_mip3 ( void  )

◆ R_DrawTriangle()

void R_DrawTriangle ( void  )

Definition at line 218 of file r_polyse.c.

219 {
221 
222  int dv1_ab, dv0_ac;
223  int dv0_ab, dv1_ac;
224 
225  /*
226  d_xdenom = ( aliastriangleparms.a->v[1] - aliastriangleparms.b->v[1] ) * ( aliastriangleparms.a->v[0] - aliastriangleparms.c->v[0] ) -
227  ( aliastriangleparms.a->v[0] - aliastriangleparms.b->v[0] ) * ( aliastriangleparms.a->v[1] - aliastriangleparms.c->v[1] );
228  */
229 
232 
233  if (!(dv0_ab | dv1_ab))
234  return;
235 
238 
239  if (!(dv0_ac | dv1_ac))
240  return;
241 
242  d_xdenom = (dv0_ac * dv1_ab) - (dv0_ab * dv1_ac);
243 
244  if (d_xdenom < 0)
245  {
246  a_spans = spans;
247 
248  r_p0[0] = aliastriangleparms.a->u; // u
249  r_p0[1] = aliastriangleparms.a->v; // v
250  r_p0[2] = aliastriangleparms.a->s; // s
251  r_p0[3] = aliastriangleparms.a->t; // t
252  r_p0[4] = aliastriangleparms.a->l; // light
253  r_p0[5] = aliastriangleparms.a->zi; // iz
254 
255  r_p1[0] = aliastriangleparms.b->u;
256  r_p1[1] = aliastriangleparms.b->v;
257  r_p1[2] = aliastriangleparms.b->s;
258  r_p1[3] = aliastriangleparms.b->t;
259  r_p1[4] = aliastriangleparms.b->l;
260  r_p1[5] = aliastriangleparms.b->zi;
261 
262  r_p2[0] = aliastriangleparms.c->u;
263  r_p2[1] = aliastriangleparms.c->v;
264  r_p2[2] = aliastriangleparms.c->s;
265  r_p2[3] = aliastriangleparms.c->t;
266  r_p2[4] = aliastriangleparms.c->l;
267  r_p2[5] = aliastriangleparms.c->zi;
268 
269  // i crash fixme //...qb: increased array sizes
270  r_p0[6] = aliastriangleparms.a->l; // lightr
271  r_p0[7] = aliastriangleparms.a->l; // lightg
272  r_p0[8] = aliastriangleparms.a->l; // lightb
273  r_p1[6] = aliastriangleparms.b->l; // lightr
274  r_p1[7] = aliastriangleparms.b->l; // lightg
275  r_p1[8] = aliastriangleparms.b->l; // lightb
276  r_p2[6] = aliastriangleparms.c->l; // lightr
277  r_p2[7] = aliastriangleparms.c->l; // lightg
278  r_p2[8] = aliastriangleparms.c->l; // lightb
279 
282  }
283 }

Referenced by R_AliasClipTriangle(), R_AliasClipTriangleRGB(), and R_AliasPreparePoints().

◆ R_EdgeCodeEnd()

void R_EdgeCodeEnd ( void  )

Referenced by R_Init().

◆ R_EdgeCodeStart()

void R_EdgeCodeStart ( void  )

Referenced by R_Init().

◆ R_EmitEdge()

void R_EmitEdge ( mvertex_t pv0,
mvertex_t pv1 
)

Definition at line 219 of file r_rast.c.

220 {
221  edge_t *edge, *pcheck;
222  int u_check;
223  float u, u_step;
225  float *world;
226  int v, v2, ceilv0;
227  float scale, lzi0, u0, v0;
228  int side;
229 
230  if (r_lastvertvalid)
231  {
232  u0 = r_u1;
233  v0 = r_v1;
234  lzi0 = r_lzi1;
235  ceilv0 = r_ceilv1;
236  }
237  else
238  {
239  world = &pv0->position[0];
240 
241  // transform and project
244 
245  if (transformed[2] < NEAR_CLIP)
246  transformed[2] = NEAR_CLIP;
247 
248  lzi0 = 1.0 / transformed[2];
249 
250  // FIXME: build x/yscale into transform?
251  scale = xscale * lzi0;
252  u0 = (xcenter + scale*transformed[0]);
253  if (u0 < r_refdef.fvrectx_adj)
254  u0 = r_refdef.fvrectx_adj;
255  if (u0 > r_refdef.fvrectright_adj)
257 
258  scale = yscale * lzi0;
259  v0 = (ycenter - scale*transformed[1]);
260  if (v0 < r_refdef.fvrecty_adj)
261  v0 = r_refdef.fvrecty_adj;
262  if (v0 > r_refdef.fvrectbottom_adj)
264 
265  ceilv0 = (int) ceil(v0);
266  }
267 
268  world = &pv1->position[0];
269 
270 // transform and project
273 
274  if (transformed[2] < NEAR_CLIP)
275  transformed[2] = NEAR_CLIP;
276 
277  r_lzi1 = 1.0 / transformed[2];
278 
279  scale = xscale * r_lzi1;
280  r_u1 = (xcenter + scale*transformed[0]);
281  if (r_u1 < r_refdef.fvrectx_adj)
285 
286  scale = yscale * r_lzi1;
287  r_v1 = (ycenter - scale*transformed[1]);
288  if (r_v1 < r_refdef.fvrecty_adj)
292 
293  if (r_lzi1 > lzi0)
294  lzi0 = r_lzi1;
295 
296  if (lzi0 > r_nearzi) // for mipmap finding
297  r_nearzi = lzi0;
298 
299 // for right edges, all we want is the effect on 1/z
300  if (r_nearzionly)
301  return;
302 
303  r_emitted = 1;
304 
305  r_ceilv1 = (int) ceil(r_v1);
306 
307 
308 // create the edge
309  if (ceilv0 == r_ceilv1)
310  {
311  // we cache unclipped horizontal edges as fully clipped
312  if (cacheoffset != 0x7FFFFFFF)
313  {
316  }
317 
318  return; // horizontal edge
319  }
320 
321  side = ceilv0 > r_ceilv1;
322 
323  edge = edge_p++;
324 
325  edge->owner = r_pedge;
326 
327  edge->nearzi = lzi0;
328 
329  if (side == 0)
330  {
331  // trailing edge (go from p1 to p2)
332  v = ceilv0;
333  v2 = r_ceilv1 - 1;
334 
335  edge->surfs[0] = surface_p - surfaces;
336  edge->surfs[1] = 0;
337 
338  u_step = ((r_u1 - u0) / (r_v1 - v0));
339  u = u0 + ((float)v - v0) * u_step;
340  }
341  else
342  {
343  // leading edge (go from p2 to p1)
344  v2 = ceilv0 - 1;
345  v = r_ceilv1;
346 
347  edge->surfs[0] = 0;
348  edge->surfs[1] = surface_p - surfaces;
349 
350  u_step = ((u0 - r_u1) / (v0 - r_v1));
351  u = r_u1 + ((float)v - r_v1) * u_step;
352  }
353 
354  edge->u_step = u_step*0x100000;
355  edge->u = u*0x100000 + 0xFFFFF;
356 
357 // we need to do this to avoid stepping off the edges if a very nearly
358 // horizontal edge is less than epsilon above a scan, and numeric error causes
359 // it to incorrectly extend to the scan, and the extension of the line goes off
360 // the edge of the screen
361 // FIXME: is this actually needed?
362  if (edge->u < r_refdef.vrect_x_adj_shift20)
364  if (edge->u > r_refdef.vrectright_adj_shift20)
366 
367 //
368 // sort the edge in normally
369 //
370  u_check = edge->u;
371  if (edge->surfs[0])
372  u_check++; // sort trailers after leaders
373 
374  if (!newedges[v] || newedges[v]->u >= u_check)
375  {
376  edge->next = newedges[v];
377  newedges[v] = edge;
378  }
379  else
380  {
381  pcheck = newedges[v];
382  while (pcheck->next && pcheck->next->u < u_check)
383  pcheck = pcheck->next;
384  edge->next = pcheck->next;
385  pcheck->next = edge;
386  }
387 
388  edge->nextremove = removeedges[v2];
389  removeedges[v2] = edge;
390 }

Referenced by R_ClipEdge().

◆ R_EndRegistration()

void R_EndRegistration ( void  )

Definition at line 1282 of file r_model.c.

1283 {
1284  int i;
1285  model_t *mod;
1286 
1287  for (i = 0, mod = mod_known; i < mod_numknown; i++, mod++)
1288  {
1289  if (!mod->name[0])
1290  continue;
1292  { // don't need this model
1293  Hunk_Free(mod->extradata);
1294  memset(mod, 0, sizeof(*mod));
1295  }
1296  else
1297  { // make sure it is paged in
1299  }
1300  }
1301 
1303 }

Referenced by GetRefAPI().

◆ R_FindImage()

image_t* R_FindImage ( char *  name,
imagetype_t  type 
)

Definition at line 491 of file r_image.c.

492 {
493  image_t *image;
494  int i, len;
495  byte *pic, *palette;
496  int width, height;
497 
498  if (!name)
499  return NULL; // ri.Sys_Error (ERR_DROP, "R_FindImage: NULL name");
500  len = (int)strlen(name);
501  if (len<5)
502  return NULL; // ri.Sys_Error (ERR_DROP, "R_FindImage: bad name: %s", name);
503 
504  // look for it
505  for (i=0, image=r_images ; i<numr_images ; i++,image++)
506  {
507  if (!strcmp(name, image->name))
508  {
510  return image;
511  }
512  }
513 
514  //
515  // load the pic from disk
516  //
517  pic = NULL;
518  palette = NULL;
519  if (!strcmp(name+len-4, ".pcx"))
520  {
521  LoadPCX (name, &pic, &palette, &width, &height);
522  if (!pic)
523  return NULL; // ri.Sys_Error (ERR_DROP, "R_FindImage: can't load %s", name);
524  image = GL_LoadPic (name, pic, width, height, type);
525  }
526  else if (!strcmp(name+len-4, ".wal"))
527  {
528  image = R_LoadWal (name);
529  }
530  else if (!strcmp(name+len-4, ".tga"))
531  return NULL; // ri.Sys_Error (ERR_DROP, "R_FindImage: can't load %s in software renderer", name);
532  else
533  return NULL; // ri.Sys_Error (ERR_DROP, "R_FindImage: bad extension on: %s", name);
534 
535  if (pic)
536  free(pic);
537  if (palette)
538  free(palette);
539 
540  return image;
541 }

Referenced by Draw_FindPic(), Mod_LoadAliasModel(), Mod_LoadSpriteModel(), Mod_LoadTexinfo(), R_RegisterModel(), R_RegisterSkin(), and R_SetSky().

◆ R_FreeUnusedImages()

void R_FreeUnusedImages ( void  )

Definition at line 564 of file r_image.c.

565 {
566  int i;
567  image_t *image;
568 
569  for (i=0, image=r_images ; i<numr_images ; i++, image++)
570  {
572  {
573  Com_PageInMemory ((byte *)image->pixels[0], image->width*image->height);
574  continue; // used this sequence
575  }
576  if (!image->registration_sequence)
577  continue; // free texture
578  if (image->type == it_pic)
579  continue; // don't free pics
580  // free it
581  free (image->pixels[0]); // the other mip levels just follow
582  memset (image, 0, sizeof(*image));
583  }
584 }

Referenced by R_EndRegistration().

◆ R_GammaCorrectAndSetPalette()

void R_GammaCorrectAndSetPalette ( const unsigned char *  pal)

Definition at line 1257 of file r_main.c.

1258 {
1259  int i;
1260 
1261  for (i = 0; i < 256; i++)
1262  {
1263  sw_state.currentpalette[i * 4 + 0] = sw_state.gammatable[palette[i * 4 + 0]];
1264  sw_state.currentpalette[i * 4 + 1] = sw_state.gammatable[palette[i * 4 + 1]];
1265  sw_state.currentpalette[i * 4 + 2] = sw_state.gammatable[palette[i * 4 + 2]];
1266  }
1267 
1269 }

Referenced by R_BeginFrame(), R_CalcPalette(), R_CinematicSetPalette(), R_InitGraphics(), and SWimp_SetMode().

◆ R_GenSkyTile()

void R_GenSkyTile ( void pdest)

◆ R_GenSkyTile16()

void R_GenSkyTile16 ( void pdest)

◆ R_GetSurf()

surf_t* R_GetSurf ( void  )

◆ R_IMFlatShadedQuad()

void R_IMFlatShadedQuad ( vec3_t  a,
vec3_t  b,
vec3_t  c,
vec3_t  d,
int  color,
float  alpha 
)

Definition at line 1381 of file r_poly.c.

1382 {
1383  vec3_t s0, s1;
1384 
1385  r_polydesc.nump = 4;
1387 
1388  VectorCopy(a, r_clip_verts[0][0]);
1389  VectorCopy(b, r_clip_verts[0][1]);
1390  VectorCopy(c, r_clip_verts[0][2]);
1391  VectorCopy(d, r_clip_verts[0][3]);
1392 
1393  r_clip_verts[0][0][3] = 0;
1394  r_clip_verts[0][1][3] = 0;
1395  r_clip_verts[0][2][3] = 0;
1396  r_clip_verts[0][3][3] = 0;
1397 
1398  r_clip_verts[0][0][4] = 0;
1399  r_clip_verts[0][1][4] = 0;
1400  r_clip_verts[0][2][4] = 0;
1401  r_clip_verts[0][3][4] = 0;
1402 
1403  VectorSubtract(d, c, s0);
1404  VectorSubtract(c, b, s1);
1405  CrossProduct(s0, s1, r_polydesc.vpn);
1407 
1409 
1410  r_polyblendcolor = color;
1411 
1412  R_ClipAndDrawPoly(alpha, false, false);
1413 }

Referenced by R_DrawBeam().

◆ R_Init()

qboolean R_Init ( void hInstance,
void wndProc 
)

Definition at line 326 of file r_main.c.

327 {
328 
329  R_InitImages();
330  Mod_Init();
331  Draw_InitLocal();
332  R_InitTextures();
333 
334  R_InitTurb();
335 
336  view_clipplanes[0].leftedge = true;
337  view_clipplanes[1].rightedge = true;
339  view_clipplanes[3].leftedge = false;
341  view_clipplanes[3].rightedge = false;
342 
345 
346  // TODO: collect 386-specific code in one place
347 #if id386
349  (long)R_EdgeCodeEnd - (long)R_EdgeCodeStart);
350  Sys_SetFPCW(); // get bit masks for FPCW (FIXME: is this id386?)
351 #endif // id386
352 
353  r_aliasuvscale = 1.0;
354 
355  R_Register();
356  Draw_GetPalette();
357  Draw_InitRGBMap(); // leilei - colored lights
358 
359  if (SWimp_Init(hInstance, wndProc) == false)
360  return -1;
361 
362  // create the window
363  R_BeginFrame(0);
364 
365  ri.Con_Printf(PRINT_ALL, "ref_soft version: "REF_VERSION"\n");
366 
367  return true;
368 }

◆ R_InitCaches()

void R_InitCaches ( void  )

Definition at line 442 of file r_surf.c.

443 {
444  int size;
445  int pix;
446 
447  // calculate size to allocate
449  {
450  size = sw_surfcacheoverride->value;
451  }
452  else
453  {
455 
456  pix = vid.width*vid.height;
457  if (pix > 64000)
458  size += (pix-64000)*3;
459  }
460 
461  // round up to page size
462  size = (size + 8191) & ~8191;
463 
464  ri.Con_Printf (PRINT_ALL,"%ik surface cache\n", size/1024);
465 
466  sc_size = size;
467  sc_base = (surfcache_t *)malloc(size);
468  sc_rover = sc_base;
469 
470  sc_base->next = NULL;
471  sc_base->owner = NULL;
472  sc_base->size = sc_size;
473 }

Referenced by R_InitGraphics().

◆ R_InitImages()

void R_InitImages ( void  )

Definition at line 593 of file r_image.c.

594 {
596 }

Referenced by R_Init().

◆ R_InitSkyBox()

void R_InitSkyBox ( void  )

Definition at line 113 of file r_rast.c.

114 {
115  int i;
116  extern model_t *loadmodel;
117 
119  loadmodel->numsurfaces += 6;
121  loadmodel->numvertexes += 8;
123  loadmodel->numedges += 12;
125  loadmodel->numsurfedges += 24;
129  ri.Sys_Error (ERR_DROP, "InitSkyBox: map overflow");
130 
131  memset (r_skyfaces, 0, 6*sizeof(*r_skyfaces));
132  for (i=0 ; i<6 ; i++)
133  {
135  r_skyplanes[i].dist = skybox_planes[i*2+1];
136 
137  VectorCopy (box_vecs[i][0], r_skytexinfo[i].vecs[0]);
138  VectorCopy (box_vecs[i][1], r_skytexinfo[i].vecs[1]);
139 
141  r_skyfaces[i].numedges = 4;
145  r_skyfaces[i].texturemins[0] = -128;
146  r_skyfaces[i].texturemins[1] = -128;
147  r_skyfaces[i].extents[0] = 256;
148  r_skyfaces[i].extents[1] = 256;
149  }
150 
151  for (i=0 ; i<24 ; i++)
152  if (box_surfedges[i] > 0)
154  else
156 
157  for(i=0 ; i<12 ; i++)
158  {
159  r_skyedges[i].v[0] = loadmodel->numvertexes-9+box_edges[i*2+0];
160  r_skyedges[i].v[1] = loadmodel->numvertexes-9+box_edges[i*2+1];
162  }
163 }

Referenced by Mod_LoadBrushModel().

◆ R_InitTurb()

void R_InitTurb ( void  )

Definition at line 246 of file r_main.c.

247 {
248  int i;
249 
250  for (i = 0; i < 4200; i++) //qb: 4k screens
251  {
252  sintable[i] = AMP + sin(i*3.14159 * 2 / CYCLE)*AMP;
253  intsintable[i] = AMP2 + sin(i*3.14159 * 2 / CYCLE)*AMP2; // AMP2, not 20
254  blanktable[i] = 0; //PGM
255  }
256 }

Referenced by R_Init().

◆ R_InsertNewEdges()

void R_InsertNewEdges ( edge_t edgestoadd,
edge_t edgelist 
)

Definition at line 155 of file r_edge.c.

156 {
157  edge_t *next_edge;
158 
159  do
160  {
161  next_edge = edgestoadd->next;
162 edgesearch:
163  if (edgelist->u >= edgestoadd->u)
164  goto addedge;
165  edgelist=edgelist->next;
166  if (edgelist->u >= edgestoadd->u)
167  goto addedge;
168  edgelist=edgelist->next;
169  if (edgelist->u >= edgestoadd->u)
170  goto addedge;
171  edgelist=edgelist->next;
172  if (edgelist->u >= edgestoadd->u)
173  goto addedge;
174  edgelist=edgelist->next;
175  goto edgesearch;
176 
177  // insert edgestoadd before edgelist
178 addedge:
179  edgestoadd->next = edgelist;
180  edgestoadd->prev = edgelist->prev;
181  edgelist->prev->next = edgestoadd;
182  edgelist->prev = edgestoadd;
183  } while ((edgestoadd = next_edge) != NULL);
184 }

Referenced by R_ScanEdges().

◆ R_LightPoint()

void R_LightPoint ( vec3_t  p,
vec3_t  color 
)

Definition at line 226 of file r_light.c.

227 {
228  vec3_t end;
229  float r;
230  int lnum;
231  dlight_t *dl;
232  vec3_t dist;
233  float add;
234 
235  if (!r_worldmodel->lightdata)
236  {
237  color[0] = color[1] = color[2] = 1.0;
238  return;
239  }
240 
241  end[0] = p[0];
242  end[1] = p[1];
243  end[2] = p[2] - 2048;
244 
246 
247  if (r == -1)
248  {
249  VectorCopy(vec3_origin, color);
250  }
251  else
252  {
253  VectorCopy(pointcolor, color);
254  }
255 
256  //
257  // add dynamic lights
258  //
259  for (lnum = 0; lnum<r_newrefdef.num_dlights; lnum++)
260  {
261  dl = &r_newrefdef.dlights[lnum];
263  dl->origin,
264  dist);
265  add = dl->intensity - VectorLength(dist);
266  add *= (1.0 / 256);
267  if (add > 0)
268  {
269  VectorMA(color, add, dl->color, color);
270  }
271  }
272 }

◆ R_LightPointColor()

void R_LightPointColor ( vec3_t  p,
vec3_t  color 
)

Definition at line 387 of file r_light.c.

388 {
389  vec3_t end;
390  float r;
391  int lnum;
392  dlight_t *dl;
393  float light;
394  vec3_t dist;
395  float add;
396 
397  if (!r_worldmodel->lightdata)
398  {
399  color[0] = color[1] = color[2] = 1.0;
400  return;
401  }
402 
403  end[0] = p[0];
404  end[1] = p[1];
405  end[2] = p[2] - 2048;
406 
408 
409  if (r == -1)
410  {
411  VectorCopy(vec3_origin, color);
412  }
413  else
414  {
415  VectorCopy(pointcolor, color);
416  }
417 
418  //
419  // add dynamic lights
420  //
421  light = 0;
422  dl = r_newrefdef.dlights;
423  for (lnum = 0; lnum<r_newrefdef.num_dlights; lnum++, dl++)
424  {
426  dl->origin,
427  dist);
428  add = dl->intensity - VectorLength(dist);
429  add *= (1.0 / 256);
430  if (add > 0)
431  {
432  VectorMA(color, add, dl->color, color);
433  }
434  }
435 
436  VectorScale(color, 1, color);
437 }

Referenced by R_AliasSetupLighting().

◆ R_NewMap()

void R_NewMap ( void  )

Definition at line 415 of file r_main.c.

416 {
417  r_viewcluster = -1;
418 
420 
421  if (r_cnumsurfs <= MINSURFACES)
423 
425  {
426  surfaces = malloc(r_cnumsurfs * sizeof(surf_t));
429  r_surfsonstack = false;
430  // surface 0 doesn't really exist; it's just a dummy because index 0
431  // is used to indicate no edge attached to surface
432  surfaces--;
433  R_SurfacePatch();
434  }
435  else
436  {
437  r_surfsonstack = true;
438  }
439 
440  r_maxedgesseen = 0;
441  r_maxsurfsseen = 0;
442 
444 
447 
449  {
450  auxedges = NULL;
451  }
452  else
453  {
454  auxedges = malloc(r_numallocatededges * sizeof(edge_t));
455  }
456 }

Referenced by R_BeginRegistration().

◆ R_PolysetUpdateTables()

void R_PolysetUpdateTables ( void  )

Definition at line 196 of file r_polyse.c.

197 {
198  int i;
199  byte *s;
200 
203  {
206  s = skinstart;
207  for (i = 0; i < MAX_LBM_HEIGHT; i++, s += skinwidth)
208  skintable[i] = s;
209  }
210 }

Referenced by R_AliasSetupSkin().

◆ R_PrintAliasStats()

void R_PrintAliasStats ( void  )

Definition at line 175 of file r_misc.c.

176 {
177  ri.Con_Printf (PRINT_ALL,"%3i polygon model drawn\n", r_amodels_drawn);
178 }

Referenced by R_RenderFrame().

◆ R_PrintDSpeeds()

void R_PrintDSpeeds ( void  )

Definition at line 151 of file r_misc.c.

152 {
153  int ms, dp_time, r_time2, rw_time, db_time, se_time, de_time, da_time;
154 
155  r_time2 = Sys_Milliseconds ();
156 
157  da_time = (da_time2 - da_time1);
158  dp_time = (dp_time2 - dp_time1);
159  rw_time = (rw_time2 - rw_time1);
160  db_time = (db_time2 - db_time1);
161  se_time = (se_time2 - se_time1);
162  de_time = (de_time2 - de_time1);
163  ms = (r_time2 - r_time1);
164 
165  ri.Con_Printf (PRINT_ALL,"%3i %2ip %2iw %2ib %2is %2ie %2ia\n",
166  ms, dp_time, rw_time, db_time, se_time, de_time, da_time);
167 }

Referenced by R_RenderFrame().

◆ R_PrintTimes()

void R_PrintTimes ( void  )

Definition at line 131 of file r_misc.c.

132 {
133  int r_time2;
134  int ms;
135 
136  r_time2 = Sys_Milliseconds ();
137 
138  ms = r_time2 - r_time1;
139 
140  ri.Con_Printf (PRINT_ALL,"%5i ms %3i/%3i/%3i poly %3i surf\n",
142  c_surf = 0;
143 }

Referenced by R_RenderFrame().

◆ R_PushDlights()

void R_PushDlights ( model_t model)

Definition at line 94 of file r_light.c.

95 {
96  int i;
97  dlight_t *l;
98 
100  for (i = 0, l = r_newrefdef.dlights; i < r_newrefdef.num_dlights; i++, l++)
101  {
102  R_MarkLights(l, 1 << i,
103  model->nodes + model->firstnode);
104  }
105 }

Referenced by R_DrawBEntitiesOnList(), R_RenderFrame(), and R_RenderView().

◆ R_Register()

void R_Register ( void  )

Definition at line 260 of file r_main.c.

261 {
262  sw_aliasstats = ri.Cvar_Get("sw_polymodelstats", "0", 0);
263  sw_allow_modex = ri.Cvar_Get( "sw_allow_modex", "1", CVAR_ARCHIVE );
264  sw_clearcolor = ri.Cvar_Get("sw_clearcolor", "2", 0);
265  sw_drawflat = ri.Cvar_Get("sw_drawflat", "0", 0);
266  sw_draworder = ri.Cvar_Get("sw_draworder", "0", 0);
267  sw_maxedges = ri.Cvar_Get("sw_maxedges", STRINGER(MAXSTACKSURFACES), 0);
268  sw_maxsurfs = ri.Cvar_Get("sw_maxsurfs", "0", 0);
269  sw_mipcap = ri.Cvar_Get("sw_mipcap", "0", 0);
270  sw_mipscale = ri.Cvar_Get("sw_mipscale", "1", 0);
271  sw_reportedgeout = ri.Cvar_Get("sw_reportedgeout", "0", 0);
272  sw_reportsurfout = ri.Cvar_Get("sw_reportsurfout", "0", 0);
273  sw_stipplealpha = ri.Cvar_Get("sw_stipplealpha", "0", CVAR_ARCHIVE);
274  sw_surfcacheoverride = ri.Cvar_Get("sw_surfcacheoverride", "0", 0);
275  sw_waterwarp = ri.Cvar_Get("sw_waterwarp", "1", 0);
276  sw_mode = ri.Cvar_Get("sw_mode", "4", CVAR_ARCHIVE);
277  sw_transmooth = ri.Cvar_Get("sw_transmooth", "0", CVAR_ARCHIVE);
278  //sw_transquality = ri.Cvar_Get("sw_transquality", "1", CVAR_ARCHIVE);
279 
280  r_lefthand = ri.Cvar_Get("hand", "0", CVAR_USERINFO | CVAR_ARCHIVE);
281  r_speeds = ri.Cvar_Get("r_speeds", "0", 0);
282  r_fullbright = ri.Cvar_Get("r_fullbright", "0", 0);
283  r_drawentities = ri.Cvar_Get("r_drawentities", "1", 0);
284  r_drawworld = ri.Cvar_Get("r_drawworld", "1", 0);
285  r_dspeeds = ri.Cvar_Get("r_dspeeds", "0", 0);
286  r_lightlevel = ri.Cvar_Get("r_lightlevel", "0", 0);
287  r_lerpmodels = ri.Cvar_Get("r_lerpmodels", "1", 0);
288  r_novis = ri.Cvar_Get("r_novis", "0", 0);
289 
290  vid_fullscreen = ri.Cvar_Get("vid_fullscreen", "0", CVAR_ARCHIVE);
291  vid_gamma = ri.Cvar_Get("vid_gamma", "1.0", CVAR_ARCHIVE);
292 
293  ri.Cmd_AddCommand("modellist", Mod_Modellist_f);
294  ri.Cmd_AddCommand("screenshot", R_ScreenShot_f);
295  ri.Cmd_AddCommand("imagelist", R_ImageList_f);
296 
297  sw_mode->modified = true; // force us to do mode specific stuff later
298  vid_gamma->modified = true; // force us to rebuild the gamma table later
299 
300  //PGM
301  sw_lockpvs = ri.Cvar_Get("sw_lockpvs", "0", 0);
302  //PGM
303 
304  r_customwidth = ri.Cvar_Get("r_customwidth", "1024", CVAR_ARCHIVE);
305  r_customheight = ri.Cvar_Get("r_customheight", "768", CVAR_ARCHIVE);
306  // leilei - colored lights
307 
308  r_coloredlights = ri.Cvar_Get("r_coloredlights", "2", CVAR_ARCHIVE);
309  r_lightsaturation = ri.Cvar_Get("r_lightsaturation", "1", CVAR_ARCHIVE);
310 
311  // o^_^o
312 }

Referenced by R_Init().

◆ R_RegisterModel()

struct model_s* R_RegisterModel ( char *  name)

Definition at line 1239 of file r_model.c.

1240 {
1241  model_t *mod;
1242  int i;
1243  dsprite_t *sprout;
1244  dmdl_t *pheader;
1245 
1246  mod = Mod_ForName(name, false);
1247  if (mod)
1248  {
1250 
1251  // register any images used by the models
1252  if (mod->type == mod_sprite)
1253  {
1254  sprout = (dsprite_t *)mod->extradata;
1255  for (i = 0; i < sprout->numframes; i++)
1256  mod->skins[i] = R_FindImage(sprout->frames[i].name, it_sprite);
1257  }
1258  else if (mod->type == mod_alias)
1259  {
1260  pheader = (dmdl_t *)mod->extradata;
1261  for (i = 0; i < pheader->num_skins; i++)
1262  mod->skins[i] = R_FindImage((char *)pheader + pheader->ofs_skins + i*MAX_SKINNAME, it_skin);
1263  //PGM
1264  mod->numframes = pheader->num_frames;
1265  //PGM
1266  }
1267  else if (mod->type == mod_brush)
1268  {
1269  for (i = 0; i < mod->numtexinfo; i++)
1271  }
1272  }
1273  return mod;
1274 }

Referenced by GetRefAPI().

◆ R_RemoveEdges()

void R_RemoveEdges ( edge_t pedge)

Definition at line 196 of file r_edge.c.

197 {
198 
199  do
200  {
201  pedge->next->prev = pedge->prev;
202  pedge->prev->next = pedge->next;
203  } while ((pedge = pedge->nextremove) != NULL);
204 }

Referenced by R_ScanEdges().

◆ R_RenderBmodelFace()

void R_RenderBmodelFace ( bedge_t pedges,
msurface_t psurf 
)

Definition at line 738 of file r_rast.c.

739 {
740  int i;
741  unsigned mask;
742  mplane_t *pplane;
743  float distinv;
744  vec3_t p_normal;
745  medge_t tedge;
746  clipplane_t *pclip;
747 
748  if (psurf->texinfo->flags & (SURF_TRANS33|SURF_TRANS66))
749  {
751  r_alpha_surfaces = psurf;
752  return;
753  }
754 
755 // skip out if no more surfs
756  if (surface_p >= surf_max)
757  {
758  r_outofsurfaces++;
759  return;
760  }
761 
762 // ditto if not enough edges left, or switch to auxedges if possible
763  if ((edge_p + psurf->numedges + 4) >= edge_max)
764  {
765  r_outofedges += psurf->numedges;
766  return;
767  }
768 
769  c_faceclip++;
770 
771 // this is a dummy to give the caching mechanism someplace to write to
772  r_pedge = &tedge;
773 
774 // set up clip planes
775  pclip = NULL;
776 
777  for (i=3, mask = 0x08 ; i>=0 ; i--, mask >>= 1)
778  {
779  if (r_clipflags & mask)
780  {
781  view_clipplanes[i].next = pclip;
782  pclip = &view_clipplanes[i];
783  }
784  }
785 
786 // push the edges through
787  r_emitted = 0;
788  r_nearzi = 0;
789  r_nearzionly = false;
790  makeleftedge = makerightedge = false;
791 // FIXME: keep clipped bmodel edges in clockwise order so last vertex caching
792 // can be used?
793  r_lastvertvalid = false;
794 
795  for ( ; pedges ; pedges = pedges->pnext)
796  {
797  r_leftclipped = r_rightclipped = false;
798  R_ClipEdge (pedges->v[0], pedges->v[1], pclip);
799 
800  if (r_leftclipped)
801  makeleftedge = true;
802  if (r_rightclipped)
803  makerightedge = true;
804  }
805 
806 // if there was a clip off the left edge, add that edge too
807 // FIXME: faster to do in screen space?
808 // FIXME: share clipped edges?
809  if (makeleftedge)
810  {
811  r_pedge = &tedge;
812  R_ClipEdge (&r_leftexit, &r_leftenter, pclip->next);
813  }
814 
815 // if there was a clip off the right edge, get the right r_nearzi
816  if (makerightedge)
817  {
818  r_pedge = &tedge;
819  r_nearzionly = true;
821  }
822 
823 // if no edges made it out, return without posting the surface
824  if (!r_emitted)
825  return;
826 
827  r_polycount++;
828 
829  surface_p->msurf = psurf;
831  surface_p->flags = psurf->flags;
832  surface_p->insubmodel = true;
833  surface_p->spanstate = 0;
836  surface_p->spans = NULL;
837 
838  pplane = psurf->plane;
839 // FIXME: cache this?
840  TransformVector (pplane->normal, p_normal);
841 // FIXME: cache this?
842  distinv = 1.0 / (pplane->dist - DotProduct (modelorg, pplane->normal));
843 
844  surface_p->d_zistepu = p_normal[0] * xscaleinv * distinv;
845  surface_p->d_zistepv = -p_normal[1] * yscaleinv * distinv;
846  surface_p->d_ziorigin = p_normal[2] * distinv -
849 
850  surface_p++;
851 }

Referenced by R_DrawSolidClippedSubmodelPolygons(), and R_RecursiveClipBPoly().

◆ R_RenderFace()

void R_RenderFace ( msurface_t fa,
int  clipflags 
)

Definition at line 525 of file r_rast.c.

526 {
527  int i, lindex;
528  unsigned mask;
529  mplane_t *pplane;
530  float distinv;
531  vec3_t p_normal;
532  medge_t *pedges, tedge;
533  clipplane_t *pclip;
534 
535  // translucent surfaces are not drawn by the edge renderer
536  if (fa->texinfo->flags & (SURF_TRANS33|SURF_TRANS66))
537  {
539  r_alpha_surfaces = fa;
540  return;
541  }
542 
543  // sky surfaces encountered in the world will cause the
544  // environment box surfaces to be emited
545  if ( fa->texinfo->flags & SURF_SKY )
546  {
547  R_EmitSkyBox ();
548  return;
549  }
550 
551 // skip out if no more surfs
552  if ((surface_p) >= surf_max)
553  {
554  r_outofsurfaces++;
555  return;
556  }
557 
558 // ditto if not enough edges left, or switch to auxedges if possible
559  if ((edge_p + fa->numedges + 4) >= edge_max)
560  {
561  r_outofedges += fa->numedges;
562  return;
563  }
564 
565  c_faceclip++;
566 
567 // set up clip planes
568  pclip = NULL;
569 
570  for (i=3, mask = 0x08 ; i>=0 ; i--, mask >>= 1)
571  {
572  if (clipflags & mask)
573  {
574  view_clipplanes[i].next = pclip;
575  pclip = &view_clipplanes[i];
576  }
577  }
578 
579 // push the edges through
580  r_emitted = 0;
581  r_nearzi = 0;
582  r_nearzionly = false;
583  makeleftedge = makerightedge = false;
584  pedges = currentmodel->edges;
585  r_lastvertvalid = false;
586 
587  for (i=0 ; i<fa->numedges ; i++)
588  {
589  lindex = currentmodel->surfedges[fa->firstedge + i];
590 
591  if (lindex > 0)
592  {
593  r_pedge = &pedges[lindex];
594 
595  // if the edge is cached, we can just reuse the edge
596  if (!insubmodel)
597  {
599  {
601  r_framecount)
602  {
603  r_lastvertvalid = false;
604  continue;
605  }
606  }
607  else
608  {
609  if ((((intptr_t)edge_p - (intptr_t)r_edges) >
611  (((edge_t *)((intptr_t)r_edges +
612  r_pedge->cachededgeoffset))->owner == r_pedge))
613  {
614  R_EmitCachedEdge ();
615  r_lastvertvalid = false;
616  continue;
617  }
618  }
619  }
620 
621  // assume it's cacheable
622  cacheoffset = (byte *)edge_p - (byte *)r_edges;
623  r_leftclipped = r_rightclipped = false;
626  pclip);
628 
629  if (r_leftclipped)
630  makeleftedge = true;
631  if (r_rightclipped)
632  makerightedge = true;
633  r_lastvertvalid = true;
634  }
635  else
636  {
637  lindex = -lindex;
638  r_pedge = &pedges[lindex];
639  // if the edge is cached, we can just reuse the edge
640  if (!insubmodel)
641  {
643  {
645  r_framecount)
646  {
647  r_lastvertvalid = false;
648  continue;
649  }
650  }
651  else
652  {
653  // it's cached if the cached edge is valid and is owned
654  // by this medge_t
655  if ((((intptr_t)edge_p - (intptr_t)r_edges) >
657  (((edge_t *)((intptr_t)r_edges +
658  r_pedge->cachededgeoffset))->owner == r_pedge))
659  {
660  R_EmitCachedEdge ();
661  r_lastvertvalid = false;
662  continue;
663  }
664  }
665  }
666 
667  // assume it's cacheable
668  cacheoffset = (byte *)edge_p - (byte *)r_edges;
669  r_leftclipped = r_rightclipped = false;
672  pclip);
674 
675  if (r_leftclipped)
676  makeleftedge = true;
677  if (r_rightclipped)
678  makerightedge = true;
679  r_lastvertvalid = true;
680  }
681  }
682 
683 // if there was a clip off the left edge, add that edge too
684 // FIXME: faster to do in screen space?
685 // FIXME: share clipped edges?
686  if (makeleftedge)
687  {
688  r_pedge = &tedge;
689  r_lastvertvalid = false;
690  R_ClipEdge (&r_leftexit, &r_leftenter, pclip->next);
691  }
692 
693 // if there was a clip off the right edge, get the right r_nearzi
694  if (makerightedge)
695  {
696  r_pedge = &tedge;
697  r_lastvertvalid = false;
698  r_nearzionly = true;
700  }
701 
702 // if no edges made it out, return without posting the surface
703  if (!r_emitted)
704  return;
705 
706  r_polycount++;
707 
708  surface_p->msurf = fa;
710  surface_p->flags = fa->flags;
712  surface_p->spanstate = 0;
715  surface_p->spans = NULL;
716 
717  pplane = fa->plane;
718 // FIXME: cache this?
719  TransformVector (pplane->normal, p_normal);
720 // FIXME: cache this?
721  distinv = 1.0 / (pplane->dist - DotProduct (modelorg, pplane->normal));
722 
723  surface_p->d_zistepu = p_normal[0] * xscaleinv * distinv;
724  surface_p->d_zistepv = -p_normal[1] * yscaleinv * distinv;
725  surface_p->d_ziorigin = p_normal[2] * distinv -
728 
729  surface_p++;
730 }

Referenced by R_DrawSubmodelPolygons(), R_EmitSkyBox(), and R_RecursiveWorldNode().

◆ R_RenderFrame()

void R_RenderFrame ( refdef_t fd)

Definition at line 1033 of file r_main.c.

1034 {
1035  r_newrefdef = *fd;
1036 
1038  ri.Sys_Error(ERR_FATAL, "R_RenderView: NULL worldmodel");
1039 
1042 
1043  if (r_speeds->value || r_dspeeds->value)
1045 
1046  R_SetupFrame();
1047 
1048  R_MarkLeaves(); // done here so we know if we're in water
1049 
1051 
1052  R_EdgeDrawing();
1053 
1054  if (r_dspeeds->value)
1055  {
1057  de_time1 = se_time2;
1058  }
1059 
1061 
1062  if (r_dspeeds->value)
1063  {
1066  }
1067 
1068  R_DrawParticles();
1069 
1070  if (r_dspeeds->value)
1072 
1074 
1075  R_SetLightLevel();
1076 
1077  // if (r_dowarp)
1078  if (r_dowarp && r_warpbuffer)
1079  D_WarpScreen();
1080 
1081  if (r_dspeeds->value)
1083 
1084  if (r_dspeeds->value)
1086 
1087  R_CalcPalette();
1088 
1089  if (sw_aliasstats->value)
1091 
1092  if (r_speeds->value)
1093  R_PrintTimes();
1094 
1095  if (r_dspeeds->value)
1096  R_PrintDSpeeds();
1097 
1099  ri.Con_Printf(PRINT_ALL, "Short %d surfaces\n", r_outofsurfaces);
1100 
1102  ri.Con_Printf(PRINT_ALL, "Short roughly %d edges\n", r_outofedges * 2 / 3);
1103 }

Referenced by GetRefAPI().

◆ R_RenderWorld()

void R_RenderWorld ( void  )

Definition at line 616 of file r_bsp.c.

617 {
618 
619  if (!r_drawworld->value)
620  return;
622  return;
623 
624  c_drawnode=0;
625 
626  // auto cycle the world frame for texture animation
629 
633 
635 }

Referenced by R_EdgeDrawing().

◆ R_RotateBmodel()

void R_RotateBmodel ( void  )

Definition at line 75 of file r_bsp.c.

76 {
77  float angle, s, c, temp1[3][3], temp2[3][3], temp3[3][3];
78 
79 // TODO: should use a look-up table
80 // TODO: should really be stored with the entity instead of being reconstructed
81 // TODO: could cache lazily, stored in the entity
82 // TODO: share work with R_SetUpAliasTransform
83 
84 // yaw
85  angle = currententity->angles[YAW];
86  angle = angle * M_PI*2 / 360;
87  s = sin(angle);
88  c = cos(angle);
89 
90  temp1[0][0] = c;
91  temp1[0][1] = s;
92  temp1[0][2] = 0;
93  temp1[1][0] = -s;
94  temp1[1][1] = c;
95  temp1[1][2] = 0;
96  temp1[2][0] = 0;
97  temp1[2][1] = 0;
98  temp1[2][2] = 1;
99 
100 
101 // pitch
102  angle = currententity->angles[PITCH];
103  angle = angle * M_PI*2 / 360;
104  s = sin(angle);
105  c = cos(angle);
106 
107  temp2[0][0] = c;
108  temp2[0][1] = 0;
109  temp2[0][2] = -s;
110  temp2[1][0] = 0;
111  temp2[1][1] = 1;
112  temp2[1][2] = 0;
113  temp2[2][0] = s;
114  temp2[2][1] = 0;
115  temp2[2][2] = c;
116 
117  R_ConcatRotations (temp2, temp1, temp3);
118 
119 // roll
120  angle = currententity->angles[ROLL];
121  angle = angle * M_PI*2 / 360;
122  s = sin(angle);
123  c = cos(angle);
124 
125  temp1[0][0] = 1;
126  temp1[0][1] = 0;
127  temp1[0][2] = 0;
128  temp1[1][0] = 0;
129  temp1[1][1] = c;
130  temp1[1][2] = s;
131  temp1[2][0] = 0;
132  temp1[2][1] = -s;
133  temp1[2][2] = c;
134 
135  R_ConcatRotations (temp1, temp3, entity_rotation);
136 
137 //
138 // rotate modelorg and the transformation matrix
139 //
144 
146 }

Referenced by R_DrawBEntitiesOnList().

◆ R_ScanEdges()

void R_ScanEdges ( void  )

Definition at line 635 of file r_edge.c.

636 {
637  int iv, bottom;
638  byte basespans[MAXSPANS*sizeof(espan_t)+CACHE_SIZE];
639  espan_t *basespan_p;
640  surf_t *s;
641 
642  basespan_p = (espan_t *)
643  ((intptr_t)(basespans + CACHE_SIZE - 1) & ~(CACHE_SIZE - 1));
644  max_span_p = &basespan_p[MAXSPANS - r_refdef.vrect.width];
645 
646  span_p = basespan_p;
647 
648 // clear active edges to just the background edges around the whole screen
649 // FIXME: most of this only needs to be set up once
650  edge_head.u = r_refdef.vrect.x << 20;
652  edge_head.u_step = 0;
653  edge_head.prev = NULL;
655  edge_head.surfs[0] = 0;
656  edge_head.surfs[1] = 1;
657 
658  edge_tail.u = (r_refdef.vrectright << 20) + 0xFFFFF;
660  edge_tail.u_step = 0;
663  edge_tail.surfs[0] = 1;
664  edge_tail.surfs[1] = 0;
665 
666  edge_aftertail.u = -1; // force a move
670 
671 // FIXME: do we need this now that we clamp x in r_draw.c?
672 // edge_sentinel.u = 2000 << 24; // make sure nothing sorts past this
673  edge_sentinel.u = 32767 << 16; // qb: FS: Sezero - integer shift overflow fix
675 
676 //
677 // process all scan lines
678 //
680 
681  for (iv=r_refdef.vrect.y ; iv<bottom ; iv++)
682  {
683  current_iv = iv;
684  fv = (float)iv;
685 
686  // mark that the head (background start) span is pre-included
687  surfaces[1].spanstate = 1;
688 
689  if (newedges[iv])
690  {
692  }
693 
694  (*pdrawfunc) ();
695 
696  // flush the span list if we can't be sure we have enough spans left for
697  // the next scan
698  if (span_p > max_span_p)
699  {
700  D_DrawSurfaces ();
701 
702  // clear the surface span pointers
703  for (s = &surfaces[1] ; s<surface_p ; s++)
704  s->spans = NULL;
705 
706  span_p = basespan_p;
707  }
708 
709  if (removeedges[iv])
711 
712  if (edge_head.next != &edge_tail)
714  }
715 
716 // do the last scan (no need to step or sort or remove on the last scan)
717 
718  current_iv = iv;
719  fv = (float)iv;
720 
721 // mark that the head (background start) span is pre-included
722  surfaces[1].spanstate = 1;
723 
724  if (newedges[iv])
726 
727  (*pdrawfunc) ();
728 
729 // draw whatever's left in the span list
730  D_DrawSurfaces ();
731 }

Referenced by R_EdgeDrawing().

◆ R_ScreenShot_f()

void R_ScreenShot_f ( void  )

Definition at line 627 of file r_misc.c.

628 {
629  int i;
630  char pcxname[80];
631  char checkname[MAX_OSPATH];
632  FILE *f;
633 
634  // create the scrnshots directory if it doesn't exist
635  Com_sprintf (checkname, sizeof(checkname), "%s/scrnshot", ri.FS_Gamedir());
636  Sys_Mkdir (checkname);
637 
638 //
639 // find a file name to save it to
640 //
641  strcpy(pcxname,"quake00.pcx");
642 
643  for (i=0 ; i<=99 ; i++)
644  {
645  pcxname[5] = i/10 + '0';
646  pcxname[6] = i%10 + '0';
647  Com_sprintf (checkname, sizeof(checkname), "%s/scrnshot/%s", ri.FS_Gamedir(), pcxname);
648  f = fopen (checkname, "r");
649  if (!f)
650  break; // file doesn't exist
651  fclose (f);
652  }
653  if (i==100)
654  {
655  ri.Con_Printf (PRINT_ALL, "R_ScreenShot_f: Couldn't create a PCX");
656  return;
657  }
658 
659 //
660 // save the pcx file
661 //
662 
664  thepalette);
665 
666  ri.Con_Printf (PRINT_ALL, "Wrote %s\n", checkname);
667 }

Referenced by R_Register().

◆ R_SetupFrame()

void R_SetupFrame ( void  )

Definition at line 426 of file r_misc.c.

427 {
428  int i;
429  vrect_t vrect;
430 
431  if (r_fullbright->modified)
432  {
433  r_fullbright->modified = false;
434  D_FlushCaches (); // so all lighting changes
435  }
436 
437  r_framecount++;
438 
439 
440 // build the transformation matrix for the given view angles
443 
445 
446 // current viewleaf
447  if ( !( r_newrefdef.rdflags & RDF_NOWORLDMODEL ) )
448  {
451  }
452 
454  r_dowarp = true;
455  else
456  r_dowarp = false;
457 
458  //if (r_dowarp)
459  if (r_dowarp && r_warpbuffer)
460  { // warp into off screen buffer
461  vrect.x = 0;
462  vrect.y = 0;
463 
464  //vrect.width = r_newrefdef.width < WARP_WIDTH ? r_newrefdef.width : WARP_WIDTH;
465  //vrect.width = r_newrefdef.width;
466  vrect.width = r_warpwidth;
467  //vrect.height = r_newrefdef.height < WARP_HEIGHT ? r_newrefdef.height : WARP_HEIGHT;
468  //vrect.height = r_newrefdef.height;
469  vrect.height = r_warpheight;
470 
472  //r_screenwidth = WARP_WIDTH;
473  //r_screenwidth = vid.rowbytes;
475  }
476  else
477  {
478  vrect.x = r_newrefdef.x;
479  vrect.y = r_newrefdef.y;
480  vrect.width = r_newrefdef.width;
481  vrect.height = r_newrefdef.height;
482 
483  d_viewbuffer = (void *)vid.buffer;
485  }
486 
487  R_ViewChanged (&vrect);
488 
489 // start off with just the four screen edge clip planes
492 
493 // save base values
497 
498 // clear frame counts
499  c_faceclip = 0;
500  d_spanpixcount = 0;
501  r_polycount = 0;
502  r_drawnpolycount = 0;
503  r_wholepolycount = 0;
504  r_amodels_drawn = 0;
505  r_outofsurfaces = 0;
506  r_outofedges = 0;
507 
508 // d_setup
509  d_roverwrapped = false;
511 
513  if (d_minmip > 3)
514  d_minmip = 3;
515  else if (d_minmip < 0)
516  d_minmip = 0;
517 
518  for (i=0 ; i<(NUM_MIPS-1) ; i++)
520 
521  d_aflatcolor = 0;
522 }

Referenced by R_RenderFrame(), and R_RenderView().

◆ R_Shutdown()

void R_Shutdown ( void  )

Definition at line 375 of file r_main.c.

376 {
377  // free z buffer
378  if (d_pzbuffer)
379  {
380  free(d_pzbuffer);
381  d_pzbuffer = NULL;
382  }
383  // free surface cache
384  if (sc_base)
385  {
386  D_FlushCaches();
387  free(sc_base);
388  sc_base = NULL;
389  }
390 
391  if (r_warpbuffer)
392  {
393  free(r_warpbuffer);
394  r_warpbuffer = NULL;
395  }
396 
397  // free colormap
398  if (vid.colormap)
399  {
400  free(vid.colormap);
401  vid.colormap = NULL;
402  }
403  R_UnRegister();
404  Mod_FreeAll();
406 
407  SWimp_Shutdown();
408 }

◆ R_ShutdownImages()

void R_ShutdownImages ( void  )

Definition at line 603 of file r_image.c.

604 {
605  int i;
606  image_t *image;
607 
608  for (i=0, image=r_images ; i<numr_images ; i++, image++)
609  {
610  if (!image->registration_sequence)
611  continue; // free texture
612  // free it
613  free (image->pixels[0]); // the other mip levels just follow
614  memset (image, 0, sizeof(*image));
615  }
616 }

Referenced by R_Shutdown().

◆ R_SplitEntityOnNode2()

void R_SplitEntityOnNode2 ( mnode_t node)

◆ R_StepActiveU()

void R_StepActiveU ( edge_t pedge)

Definition at line 216 of file r_edge.c.

217 {
218  edge_t *pnext_edge, *pwedge;
219 
220  while (1)
221  {
222 nextedge:
223  pedge->u += pedge->u_step;
224  if (pedge->u < pedge->prev->u)
225  goto pushback;
226  pedge = pedge->next;
227 
228  pedge->u += pedge->u_step;
229  if (pedge->u < pedge->prev->u)
230  goto pushback;
231  pedge = pedge->next;
232 
233  pedge->u += pedge->u_step;
234  if (pedge->u < pedge->prev->u)
235  goto pushback;
236  pedge = pedge->next;
237 
238  pedge->u += pedge->u_step;
239  if (pedge->u < pedge->prev->u)
240  goto pushback;
241  pedge = pedge->next;
242 
243  goto nextedge;
244 
245 pushback:
246  if (pedge == &edge_aftertail)
247  return;
248 
249  // push it back to keep it sorted
250  pnext_edge = pedge->next;
251 
252  // pull the edge out of the edge list
253  pedge->next->prev = pedge->prev;
254  pedge->prev->next = pedge->next;
255 
256  // find out where the edge goes in the edge list
257  pwedge = pedge->prev->prev;
258 
259  while (pwedge->u > pedge->u)
260  {
261  pwedge = pwedge->prev;
262  }
263 
264  // put the edge back into the edge list
265  pedge->next = pwedge->next;
266  pedge->prev = pwedge;
267  pedge->next->prev = pedge;
268  pwedge->next = pedge;
269 
270  pedge = pnext_edge;
271  if (pedge == &edge_tail)
272  return;
273  }
274 }

Referenced by R_ScanEdges().

◆ R_Surf16End()

void R_Surf16End ( void  )

◆ R_Surf16Patch()

void R_Surf16Patch ( void  )

◆ R_Surf16Start()

void R_Surf16Start ( void  )

◆ R_Surf8End()

void R_Surf8End ( void  )

Referenced by D_Patch().

◆ R_Surf8Patch()

void R_Surf8Patch ( void  )

Referenced by D_Patch().

◆ R_Surf8Start()

void R_Surf8Start ( void  )

Referenced by D_Patch().

◆ R_SurfacePatch()

void R_SurfacePatch ( void  )

Definition at line 532 of file r_misc.c.

533 {
534  // we only patch code on Intel
535 }

Referenced by R_EdgeDrawing(), and R_NewMap().

◆ R_TransformFrustum()

void R_TransformFrustum ( void  )

Definition at line 187 of file r_misc.c.

188 {
189  int i;
190  vec3_t v, v2;
191 
192  for (i=0 ; i<4 ; i++)
193  {
194  v[0] = screenedge[i].normal[2];
195  v[1] = -screenedge[i].normal[0];
196  v[2] = screenedge[i].normal[1];
197 
198  v2[0] = v[1]*vright[0] + v[2]*vup[0] + v[0]*vpn[0];
199  v2[1] = v[1]*vright[1] + v[2]*vup[1] + v[0]*vpn[1];
200  v2[2] = v[1]*vright[2] + v[2]*vup[2] + v[0]*vpn[2];
201 
202  VectorCopy (v2, view_clipplanes[i].normal);
203 
205  }
206 }

Referenced by R_SetupFrame().

◆ R_TransformPlane()

void R_TransformPlane ( mplane_t p,
float *  normal,
float *  dist 
)

Definition at line 279 of file r_misc.c.

280 {
281  float d;
282 
283  d = DotProduct (r_origin, p->normal);
284  *dist = p->dist - d;
285 // TODO: when we have rotating entities, this will need to use the view matrix
286  TransformVector (p->normal, normal);
287 }

◆ R_UnRegister()

void R_UnRegister ( void  )

Definition at line 314 of file r_main.c.

315 {
316  ri.Cmd_RemoveCommand("screenshot");
317  ri.Cmd_RemoveCommand("modellist");
318  ri.Cmd_RemoveCommand("imagelist");
319 }

Referenced by R_Shutdown().

◆ SetUpForLineScan()

void SetUpForLineScan ( fixed8_t  startvertu,
fixed8_t  startvertv,
fixed8_t  endvertu,
fixed8_t  endvertv 
)

◆ SWimp_AppActivate()

void SWimp_AppActivate ( qboolean  active)

Definition at line 292 of file rw_imp.c.

293 {
294  if ( active )
295  {
296  if ( sww_state.hWnd )
297  {
298  SetForegroundWindow( sww_state.hWnd );
299  ShowWindow( sww_state.hWnd, SW_RESTORE );
300  }
301  }
302  else
303  {
304  if ( sww_state.hWnd )
305  {
306  if ( sww_state.initializing )
307  return;
308  if ( vid_fullscreen->value )
309  ShowWindow( sww_state.hWnd, SW_MINIMIZE );
310  }
311  }
312 }

Referenced by GetRefAPI().

◆ SWimp_BeginFrame()

void SWimp_BeginFrame ( float  camera_separation)

◆ SWimp_EndFrame()

void SWimp_EndFrame ( void  )

Definition at line 163 of file rw_imp.c.

164 {
165 
166  if (sww_state.palettized)
167  {
168  // holdpal = SelectPalette(hdcScreen, hpalDIB, FALSE);
169  // RealizePalette(hdcScreen);
170  }
171 
172  BitBlt(sww_state.hDC,
173  0, 0,
174  vid.width,
175  vid.height,
177  0, 0,
178  SRCCOPY);
179 
180  if (sww_state.palettized)
181  {
182  // SelectPalette(hdcScreen, holdpal, FALSE);
183  }
184 }

Referenced by GetRefAPI(), and R_CinematicSetPalette().

◆ SWimp_Init()

int SWimp_Init ( void hInstance,
void wndProc 
)

Definition at line 118 of file rw_imp.c.

119 {
120  sww_state.hInstance = ( HINSTANCE ) hInstance;
121  sww_state.wndproc = wndProc;
122 
123  return true;
124 }

Referenced by R_Init().

◆ SWimp_SetMode()

rserr_t SWimp_SetMode ( int pwidth,
int pheight,
int  mode,
qboolean  fullscreen 
)

Definition at line 189 of file rw_imp.c.

190 {
191  const char *win_fs[] = { "W", "FS" };
192  rserr_t retval = rserr_ok;
193 
194  ri.Con_Printf (PRINT_ALL, "setting mode %d:", mode );
195 
196  if ( !ri.Vid_GetModeInfo( pwidth, pheight, mode ) )
197  {
198  ri.Con_Printf( PRINT_ALL, " invalid mode\n" );
199  return rserr_invalid_mode;
200  }
201 
202  ri.Con_Printf(PRINT_ALL, " %d %d %s\n", *pwidth, *pheight, win_fs[fullscreen]);
203 
204  sww_state.initializing = true;
205  if (fullscreen) //qb: get rid of 'fullscreen'.
206  {
207  if (!SWimp_InitGraphics())
208  {
209  ri.Cvar_SetValue("vid_fullscreen", !fullscreen); //qb: added
210  vid_fullscreen->modified = true;
211  if (SWimp_InitGraphics())
212  {
213  // mode is legal but not as fullscreen
214  retval = rserr_invalid_fullscreen;
215  }
216  else
217  {
218  // failed to set a valid mode in windowed mode
219  retval = rserr_unknown;
220  }
221  }
222  }
223  else
224  {
225  // failure to set a valid mode in windowed mode
226  if (!SWimp_InitGraphics())
227  {
228  sww_state.initializing = true;
229  return rserr_unknown;
230  }
231  }
232 
233  sw_state.fullscreen = fullscreen;
234 #if 0
235  if ( retval != rserr_unknown )
236  {
237  if ( retval == rserr_invalid_fullscreen ||
238  ( retval == rserr_ok && !fullscreen ) )
239  {
240  SetWindowLong( sww_state.hWnd, GWL_STYLE, WINDOW_STYLE );
241  }
242  }
243 #endif
244  R_GammaCorrectAndSetPalette( ( const unsigned char * ) d_8to24table );
245  sww_state.initializing = true;
246 
247  return retval;
248 }

Referenced by R_BeginFrame().

◆ SWimp_SetPalette()

void SWimp_SetPalette ( const unsigned char *  palette)

Definition at line 257 of file rw_imp.c.

258 {
259  // MGL - what the fuck was kendall doing here?!
260  // clear screen to black and change palette
261  // for (i=0 ; i<vid.height ; i++)
262  // memset (vid.buffer + i*vid.rowbytes, 0, vid.width);
263 
264  if ( !palette )
265  palette = ( const unsigned char * ) sw_state.currentpalette;
266  DIB_SetPalette((const unsigned char *)palette);
267 }

Referenced by R_GammaCorrectAndSetPalette().

◆ SWimp_Shutdown()

void SWimp_Shutdown ( void  )

Definition at line 274 of file rw_imp.c.

275 {
276  ri.Con_Printf( PRINT_ALL, "Shutting down SW imp\n" );
277  DIB_Shutdown();
278 
279  if ( sww_state.hWnd )
280  {
281  ri.Con_Printf( PRINT_ALL, "...destroying window\n" );
282  ShowWindow( sww_state.hWnd, SW_SHOWNORMAL ); // prevents leaving empty slots in the taskbar
283  DestroyWindow (sww_state.hWnd);
284  sww_state.hWnd = NULL;
285  UnregisterClass (WINDOW_CLASS_NAME, sww_state.hInstance);
286  }
287 }

Referenced by R_Shutdown(), and SWimp_InitGraphics().

◆ Sys_MakeCodeWriteable()

void Sys_MakeCodeWriteable ( unsigned long  startaddr,
unsigned long  length 
)

Definition at line 322 of file rw_imp.c.

323 {
324  DWORD flOldProtect;
325 
326  if (!VirtualProtect((LPVOID)startaddr, length, PAGE_READWRITE, &flOldProtect))
327  ri.Sys_Error(ERR_FATAL, "Protection change failed\n");
328 }

Referenced by D_Patch(), and R_Init().

◆ Sys_SetFPCW()

void Sys_SetFPCW ( void  )

Definition at line 351 of file rw_imp.c.

352 {
353 }

Referenced by R_Init().

◆ TransformVector()

void TransformVector ( vec3_t  in,
vec3_t  out 
)

◆ Turbulent8()

void Turbulent8 ( espan_t pspan)

Definition at line 150 of file r_scan.c.

151 {
152 
154 
155  r_turb_sstep = 0; // keep compiler happy
156  r_turb_tstep = 0; // ditto
157 
158  r_turb_pbase = (unsigned char *)cacheblock;
159 
160  sdivzstepu = d_sdivzstepu * 16;
161  tdivzstepu = d_tdivzstepu * 16;
162  zistepu = d_zistepu * 16;
163 
164  do
165  {
166  r_turb_pdest = (unsigned char *)((byte *)d_viewbuffer +
167  (r_screenwidth * pspan->v) + pspan->u);
168 
169  count = pspan->count;
170 
171  // calculate the initial s/z, t/z, 1/z, s, and t and clamp
172  du = (float)pspan->u;
173  dv = (float)pspan->v;
174 
178  z = (float)0x10000 / zi; // prescale to 16.16 fixed-point
179 
180  r_turb_s = (int)(sdivz * z) + sadjust;
181  if (r_turb_s > bbextents)
183  else if (r_turb_s < 0)
184  r_turb_s = 0;
185 
186  r_turb_t = (int)(tdivz * z) + tadjust;
187  if (r_turb_t > bbextentt)
189  else if (r_turb_t < 0)
190  r_turb_t = 0;
191 
192  do
193  {
194  // calculate s and t at the far end of the span
195  if (count >= 16)
196  r_turb_spancount = 16;
197  else
199 
201 
202  if (count)
203  {
204  // calculate s/z, t/z, zi->fixed s and t at far end of span,
205  // calculate s and t steps across span by shifting
206  sdivz += sdivzstepu;
207  tdivz += tdivzstepu;
208  zi += zistepu;
209  z = (float)0x10000 / zi; // prescale to 16.16 fixed-point
210 
211  snext = (int)(sdivz * z) + sadjust;
212  if (snext > bbextents)
213  snext = bbextents;
214  else if (snext < 16)
215  snext = 16; // prevent round-off error on <0 steps from
216  // from causing overstepping & running off the
217  // edge of the texture
218 
219  tnext = (int)(tdivz * z) + tadjust;
220  if (tnext > bbextentt)
221  tnext = bbextentt;
222  else if (tnext < 16)
223  tnext = 16; // guard against round-off error on <0 steps
224 
225  r_turb_sstep = (snext - r_turb_s) >> 4;
226  r_turb_tstep = (tnext - r_turb_t) >> 4;
227  }
228  else
229  {
230  // calculate s/z, t/z, zi->fixed s and t at last pixel in span (so
231  // can't step off polygon), clamp, calculate s and t steps across
232  // span by division, biasing steps low so we don't run off the
233  // texture
234  spancountminus1 = (float)(r_turb_spancount - 1);
238  z = (float)0x10000 / zi; // prescale to 16.16 fixed-point
239  snext = (int)(sdivz * z) + sadjust;
240  if (snext > bbextents)
241  snext = bbextents;
242  else if (snext < 16)
243  snext = 16; // prevent round-off error on <0 steps from
244  // from causing overstepping & running off the
245  // edge of the texture
246 
247  tnext = (int)(tdivz * z) + tadjust;
248  if (tnext > bbextentt)
249  tnext = bbextentt;
250  else if (tnext < 16)
251  tnext = 16; // guard against round-off error on <0 steps
252 
253  if (r_turb_spancount > 1)
254  {
257  }
258  }
259 
260  r_turb_s = r_turb_s & ((CYCLE << 16) - 1);
261  r_turb_t = r_turb_t & ((CYCLE << 16) - 1);
262 
263  D_DrawTurbulent8Span(pspan);
264 
265  r_turb_s = snext;
266  r_turb_t = tnext;
267 
268  } while (count > 0);
269 
270  } while ((pspan = pspan->pnext) != NULL);
271 }

Referenced by D_TurbulentSurf().

Variable Documentation

◆ acolormap

void* acolormap

◆ aliastriangleparms

aliastriangleparms_t aliastriangleparms

◆ aliasxcenter

float aliasxcenter

Definition at line 762 of file r_local.h.

Referenced by R_AliasProjectAndClipTestFinalVert(), and R_ViewChanged().

◆ aliasxscale

float aliasxscale

Definition at line 85 of file r_main.c.

Referenced by R_AliasDrawModel(), R_AliasProjectAndClipTestFinalVert(), and R_ViewChanged().

◆ aliasycenter

float aliasycenter

Definition at line 762 of file r_local.h.

Referenced by R_AliasProjectAndClipTestFinalVert(), and R_ViewChanged().

◆ aliasyscale

float aliasyscale

Definition at line 762 of file r_local.h.

Referenced by R_AliasProjectAndClipTestFinalVert(), and R_ViewChanged().

◆ auxedges

edge_t* auxedges

Definition at line 48 of file r_edge.c.

Referenced by R_EdgeDrawing(), and R_NewMap().

◆ base_vpn

vec3_t base_vpn

Definition at line 558 of file r_local.h.

Referenced by D_SolidSurf(), D_TurbulentSurf(), and R_SetupFrame().

◆ base_vright

vec3_t base_vright

Definition at line 559 of file r_local.h.

Referenced by D_SolidSurf(), D_TurbulentSurf(), and R_SetupFrame().

◆ base_vup

vec3_t base_vup

Definition at line 557 of file r_local.h.

Referenced by D_SolidSurf(), D_TurbulentSurf(), and R_SetupFrame().

◆ bbextents

◆ bbextentt

◆ blanktable

int blanktable[4200]

Definition at line 49 of file r_rast.c.

Referenced by NonTurbulent8(), R_InitTurb(), and R_PolygonDrawSpans().

◆ c_faceclip

int c_faceclip

Definition at line 34 of file r_rast.c.

Referenced by R_PrintTimes(), R_RenderBmodelFace(), R_RenderFace(), and R_SetupFrame().

◆ c_surf

int c_surf

Definition at line 64 of file r_main.c.

Referenced by D_CacheSurface(), and R_PrintTimes().

◆ cacheblock

◆ cachewidth

◆ coloredlights

◆ colormap

void* colormap

Definition at line 51 of file r_main.c.

Referenced by D_Patch().

◆ currententity

entity_t* currententity

Definition at line 28 of file r_bsp.c.

◆ currentmodel

◆ d_8to24tabble

unsigned d_8to24tabble[256]

Definition at line 28 of file r_main.c.

Referenced by Draw_8to24().

◆ d_8to24table

◆ d_initial_rover

surfcache_t* d_initial_rover

Definition at line 29 of file r_misc.c.

Referenced by D_SCAlloc(), and R_SetupFrame().

◆ d_minmip

int d_minmip

Definition at line 31 of file r_misc.c.

Referenced by D_MipLevelForScale(), and R_SetupFrame().

◆ d_pix_max

int d_pix_max

Definition at line 534 of file r_local.h.

Referenced by R_DrawParticle().

◆ d_pix_min

int d_pix_min

Definition at line 40 of file r_misc.c.

Referenced by D_ViewChanged(), and R_DrawParticle().

◆ d_pix_shift

int d_pix_shift

Definition at line 534 of file r_local.h.

Referenced by R_DrawParticle().

◆ d_pzbuffer

◆ d_roverwrapped

qboolean d_roverwrapped

Definition at line 30 of file r_misc.c.

Referenced by D_SCAlloc(), and R_SetupFrame().

◆ d_scalemip

float d_scalemip[3]

Definition at line 32 of file r_misc.c.

Referenced by D_MipLevelForScale(), and R_SetupFrame().

◆ d_scantable

int d_scantable[MAXHEIGHT]

Definition at line 42 of file r_misc.c.

Referenced by D_ViewChanged(), R_DrawParticle(), and R_PolygonDrawSpans().

◆ d_sdivzorigin

float d_sdivzorigin

◆ d_sdivzstepu

float d_sdivzstepu

◆ d_sdivzstepv

float d_sdivzstepv

◆ d_spanpixcount

int d_spanpixcount

Definition at line 99 of file r_main.c.

Referenced by R_SetupFrame().

◆ d_tdivzorigin

float d_tdivzorigin

◆ d_tdivzstepu

float d_tdivzstepu

◆ d_tdivzstepv

float d_tdivzstepv

◆ d_viewbuffer

◆ d_vrectbottom_particle

int d_vrectbottom_particle

Definition at line 532 of file r_local.h.

Referenced by R_DrawParticle().

◆ d_vrectright_particle

int d_vrectright_particle

Definition at line 532 of file r_local.h.

Referenced by R_DrawParticle().

◆ d_vrectx

int d_vrectx

Definition at line 38 of file r_misc.c.

Referenced by D_ViewChanged(), and R_DrawParticle().

◆ d_vrecty

int d_vrecty

Definition at line 532 of file r_local.h.

Referenced by R_DrawParticle().

◆ d_ziorigin

◆ d_zistepu

◆ d_zistepv

◆ d_zrowbytes

unsigned int d_zrowbytes

Definition at line 198 of file r_main.c.

Referenced by D_ViewChanged().

◆ d_zwidth

unsigned int d_zwidth

◆ da_time1

float da_time1

Definition at line 112 of file r_main.c.

Referenced by R_PrintDSpeeds(), and R_RenderFrame().

◆ da_time2

float da_time2

Definition at line 783 of file r_local.h.

Referenced by R_PrintDSpeeds().

◆ db_time1

float db_time1

Definition at line 784 of file r_local.h.

Referenced by R_PrintDSpeeds().

◆ db_time2

float db_time2

Definition at line 784 of file r_local.h.

Referenced by R_PrintDSpeeds().

◆ de_time1

float de_time1

Definition at line 785 of file r_local.h.

Referenced by R_PrintDSpeeds().

◆ de_time2

float de_time2

Definition at line 785 of file r_local.h.

Referenced by R_PrintDSpeeds().

◆ dp_time1

float dp_time1

Definition at line 112 of file r_main.c.

Referenced by R_PrintDSpeeds(), and R_RenderFrame().

◆ dp_time2

float dp_time2

Definition at line 784 of file r_local.h.

Referenced by R_PrintDSpeeds().

◆ dv_time1

float dv_time1

Definition at line 785 of file r_local.h.

◆ dv_time2

float dv_time2

Definition at line 785 of file r_local.h.

◆ edge_aftertail

edge_t edge_aftertail

Definition at line 72 of file r_edge.c.

Referenced by R_ScanEdges(), and R_StepActiveU().

◆ edge_head

edge_t edge_head

Definition at line 70 of file r_edge.c.

Referenced by R_GenerateSpans(), R_GenerateSpansBackward(), and R_ScanEdges().

◆ edge_max

edge_t * edge_max

Definition at line 750 of file r_local.h.

◆ edge_p

edge_t * edge_p

Definition at line 750 of file r_local.h.

◆ edge_tail

edge_t edge_tail

Definition at line 71 of file r_edge.c.

Referenced by R_GenerateSpans(), R_GenerateSpansBackward(), R_ScanEdges(), and R_StepActiveU().

◆ entity_rotation

float entity_rotation[3][3]

Definition at line 34 of file r_bsp.c.

Referenced by R_EntityRotate(), R_RecursiveClipBPoly(), and R_RotateBmodel().

◆ erroradjustdown

int erroradjustdown

Definition at line 583 of file r_local.h.

◆ erroradjustup

int erroradjustup

Definition at line 583 of file r_local.h.

◆ errorterm

int errorterm

Definition at line 583 of file r_local.h.

◆ insubmodel

qboolean insubmodel

Definition at line 27 of file r_bsp.c.

Referenced by R_DrawBEntitiesOnList(), R_EmitSkyBox(), and R_RenderFace().

◆ intsintable

int intsintable[4200]

Definition at line 48 of file r_rast.c.

Referenced by D_WarpScreen(), and R_InitTurb().

◆ modelorg

◆ newedges

edge_t* newedges[MAXHEIGHT]

Definition at line 57 of file r_edge.c.

Referenced by R_BeginEdgeFrame(), R_EmitEdge(), and R_ScanEdges().

◆ palmap2

byte palmap2[64][64][64]

Definition at line 91 of file r_draw.c.

◆ pfrustum_indexes

int* pfrustum_indexes[4]

Definition at line 104 of file r_main.c.

Referenced by R_BmodelCheckBBox(), R_RecursiveWorldNode(), and R_SetUpFrustumIndexes().

◆ r_affinetridesc

◆ r_aliasblendcolor

int r_aliasblendcolor

◆ r_aliasuvscale

float r_aliasuvscale

Definition at line 56 of file r_main.c.

Referenced by R_Init(), and R_ViewChanged().

◆ r_alpha_surfaces

msurface_t* r_alpha_surfaces

◆ r_amodels_drawn

int r_amodels_drawn

Definition at line 32 of file r_alias.c.

Referenced by R_AliasDrawModel(), R_PrintAliasStats(), and R_SetupFrame().

◆ r_clipflags

int r_clipflags

Definition at line 67 of file r_main.c.

Referenced by R_DrawBEntitiesOnList(), and R_RenderBmodelFace().

◆ r_cnumsurfs

int r_cnumsurfs

Definition at line 787 of file r_local.h.

◆ r_coloredlights

cvar_t* r_coloredlights

Definition at line 154 of file r_main.c.

Referenced by Mod_LoadBrushModel(), and R_Register().

◆ r_currentbkey

int r_currentbkey

Definition at line 36 of file r_bsp.c.

Referenced by R_RecursiveClipBPoly(), and R_RenderBmodelFace().

◆ r_currentkey

int r_currentkey

◆ r_customheight

cvar_t* r_customheight

Definition at line 50 of file vid_dll.c.

Referenced by R_BeginFrame(), R_Register(), VID_GetModeInfo(), and VID_Init().

◆ r_customwidth

cvar_t* r_customwidth

Definition at line 49 of file vid_dll.c.

Referenced by R_BeginFrame(), R_Register(), VID_GetModeInfo(), and VID_Init().

◆ r_dlightframecount

int r_dlightframecount

Definition at line 24 of file r_light.c.

Referenced by R_DrawBEntitiesOnList(), R_MarkLights(), R_PushDlights(), and R_RenderDlights().

◆ r_dowarp

qboolean r_dowarp

Definition at line 60 of file r_main.c.

Referenced by R_RenderFrame(), and R_SetupFrame().

◆ r_drawentities

cvar_t* r_drawentities

Definition at line 135 of file r_main.c.

◆ r_drawnpolycount

int r_drawnpolycount

Definition at line 101 of file r_main.c.

Referenced by D_DrawSurfaces(), R_PrintTimes(), and R_SetupFrame().

◆ r_drawsurf

◆ r_drawworld

cvar_t* r_drawworld

Definition at line 134 of file r_main.c.

Referenced by R_DrawWorld(), and R_RenderWorld().

◆ r_dspeeds

cvar_t* r_dspeeds

Definition at line 136 of file r_main.c.

Referenced by R_EdgeDrawing(), R_Register(), and R_RenderFrame().

◆ r_edges

edge_t* r_edges

Definition at line 49 of file r_edge.c.

Referenced by R_BeginEdgeFrame(), R_EdgeDrawing(), R_EmitCachedEdge(), and R_RenderFace().

◆ r_entorigin

vec3_t r_entorigin

◆ r_fov_greater_than_90

qboolean r_fov_greater_than_90

◆ r_framecount

◆ r_frustum_indexes

int r_frustum_indexes[4 *6]

Definition at line 105 of file r_main.c.

Referenced by R_SetUpFrustumIndexes().

◆ r_fullbright

cvar_t* r_fullbright

Definition at line 137 of file r_main.c.

Referenced by R_BlendLightmaps(), R_BuildLightMap(), R_BuildLightMapRGB(), and R_SetupFrame().

◆ r_lefthand

cvar_t* r_lefthand

Definition at line 117 of file r_main.c.

Referenced by R_AliasDrawModel(), R_AliasPreparePoints(), and R_DrawAliasModel().

◆ r_lerpmodels

cvar_t* r_lerpmodels

Definition at line 138 of file r_main.c.

Referenced by R_AliasDrawModel(), and R_DrawAliasModel().

◆ r_lightlevel

cvar_t* r_lightlevel

Definition at line 142 of file r_main.c.

Referenced by R_AliasSetupLighting(), and R_DrawAliasModel().

◆ r_lightsaturation

cvar_t* r_lightsaturation

Definition at line 155 of file r_main.c.

Referenced by Draw_InitRGBMap(), and R_Register().

◆ r_maxedgesseen

int r_maxedgesseen

Definition at line 787 of file r_local.h.

◆ r_maxsurfsseen

int r_maxsurfsseen

Definition at line 65 of file r_main.c.

Referenced by R_NewMap().

◆ r_maxvalidedgeoffset

int r_maxvalidedgeoffset

◆ r_newrefdef

◆ r_notexture_mip

image_t* r_notexture_mip

Definition at line 110 of file r_main.c.

Referenced by Mod_LoadTexinfo(), R_InitTextures(), and R_LoadWal().

◆ r_numallocatededges

int r_numallocatededges

Definition at line 55 of file r_main.c.

Referenced by R_BeginEdgeFrame(), and R_NewMap().

◆ r_oldviewcluster

int r_oldviewcluster

Definition at line 791 of file r_local.h.

Referenced by R_BeginRegistration(), and R_MarkLeaves().

◆ r_origin

◆ r_outofedges

int r_outofedges

Definition at line 58 of file r_main.c.

Referenced by R_RenderBmodelFace(), R_RenderFace(), R_RenderFrame(), and R_SetupFrame().

◆ r_outofsurfaces

int r_outofsurfaces

Definition at line 57 of file r_main.c.

Referenced by R_RenderBmodelFace(), R_RenderFace(), R_RenderFrame(), and R_SetupFrame().

◆ r_pcurrentvertbase

mvertex_t* r_pcurrentvertbase

◆ r_polycount

int r_polycount

Definition at line 100 of file r_main.c.

Referenced by R_PrintTimes(), R_RenderBmodelFace(), R_RenderFace(), and R_SetupFrame().

◆ r_ppn

vec3_t r_ppn

Definition at line 479 of file r_local.h.

◆ r_pright

vec3_t r_pright

Definition at line 22 of file r_part.c.

Referenced by R_DrawParticle(), and R_DrawParticles().

◆ r_ptverts

mvertex_t* r_ptverts

◆ r_ptvertsmax

mvertex_t * r_ptvertsmax

Definition at line 735 of file r_local.h.

◆ r_pup

vec3_t r_pup

Definition at line 479 of file r_local.h.

◆ r_refdef

◆ r_screenwidth

◆ r_speeds

cvar_t* r_speeds

Definition at line 141 of file r_main.c.

◆ r_surfsonstack

qboolean r_surfsonstack

Definition at line 66 of file r_main.c.

Referenced by R_EdgeDrawing(), and R_NewMap().

◆ r_time1

float r_time1

Definition at line 54 of file r_main.c.

Referenced by R_PrintDSpeeds(), R_PrintTimes(), and R_RenderFrame().

◆ r_viewcluster

int r_viewcluster

Definition at line 108 of file r_main.c.

Referenced by R_BeginRegistration(), R_MarkLeaves(), and R_SetupFrame().

◆ r_viewleaf

mleaf_t* r_viewleaf

Definition at line 107 of file r_main.c.

Referenced by R_SetupFrame().

◆ r_visframecount

int r_visframecount

Definition at line 98 of file r_main.c.

Referenced by R_MarkLeaves(), R_RecursiveClipBPoly(), and R_RecursiveWorldNode().

◆ r_warpbuffer

byte* r_warpbuffer

Definition at line 45 of file r_main.c.

Referenced by D_WarpScreen(), R_InitGraphics(), R_RenderFrame(), R_SetupFrame(), and R_Shutdown().

◆ r_warpheight

int r_warpheight

Definition at line 47 of file r_main.c.

Referenced by R_InitGraphics(), and R_SetupFrame().

◆ r_warpwidth

int r_warpwidth

Definition at line 46 of file r_main.c.

Referenced by D_WarpScreen(), R_InitGraphics(), and R_SetupFrame().

◆ r_wholepolycount

int r_wholepolycount

Definition at line 102 of file r_main.c.

Referenced by R_SetupFrame().

◆ r_worldentity

entity_t r_worldentity

Definition at line 30 of file r_main.c.

Referenced by D_SolidSurf(), and R_RenderWorld().

◆ r_worldmodel

◆ removeedges

edge_t* removeedges[MAXHEIGHT]

Definition at line 58 of file r_edge.c.

Referenced by R_BeginEdgeFrame(), R_EmitEdge(), and R_ScanEdges().

◆ ri

Definition at line 25 of file r_main.c.

Referenced by CalcSurfaceExtents(), ClipSkyPolygon(), CreateDrawBuffers(), CreateFramebuffers(), CreateRenderpasses(), D_SCAlloc(), D_SCDump(), DDRAW_Init(), DDRAW_SetPalette(), DDRAW_Shutdown(), debugUtilsCallback(), DIB_Init(), DIB_SetPalette(), Draw_Char(), Draw_Fill(), Draw_GetPalette(), Draw_GetPicSize(), Draw_InitLocal(), Draw_Pic(), Draw_StretchPic(), Draw_StretchPicImplementation(), Draw_TileClear(), getSwapPresentMode(), GL_CreateSurfaceLightmap(), GL_ImageList_f(), GL_InitImages(), GL_LoadPic(), GL_LoadWal(), GL_ScreenShot_f(), GL_Strings_f(), GL_TextureAlphaMode(), GL_TextureMode(), GL_TextureSolidMode(), GL_Upload32(), GL_Upload8(), GLimp_BeginFrame(), GLimp_EnableLogging(), GLimp_EndFrame(), GLimp_Init(), GLimp_InitGL(), GLimp_SetMode(), GLimp_Shutdown(), LM_UploadBlock(), LoadPCX(), LoadTGA(), Mod_ForName(), Mod_LoadAliasModel(), Mod_LoadBrushModel(), Mod_LoadEdges(), Mod_LoadFaces(), Mod_LoadLeafs(), Mod_LoadMarksurfaces(), Mod_LoadNodes(), Mod_LoadPlanes(), Mod_LoadSpriteModel(), Mod_LoadSubmodels(), Mod_LoadSurfedges(), Mod_LoadTexinfo(), Mod_LoadVertexes(), Mod_Modellist_f(), Mod_PointInLeaf(), QGL_Init(), QVk_BeginFrame(), QVk_CreateDevice(), QVk_CreateSwapchain(), QVk_CreateValidationLayers(), QVk_EndFrame(), QVk_GetIndexBuffer(), QVk_GetTriangleFanIbo(), QVk_GetUniformBuffer(), QVk_GetVertexBuffer(), QVk_Init(), QVk_Shutdown(), R_AliasDrawModel(), R_AliasSetupFrames(), R_AliasSetupSkin(), R_BeginRegistration(), R_BlendLightmaps(), R_BuildLightMap(), R_ClipAndDrawPoly(), R_CullAliasModel(), R_DrawAliasModel(), R_DrawSprite(), R_FindFreeImage(), R_ImageList_f(), R_InitCaches(), R_InitSkyBox(), R_LoadWal(), R_PrintAliasStats(), R_PrintDSpeeds(), R_PrintTimes(), R_RecursiveClipBPoly(), R_ScreenShot_f(), selectPhysicalDevice(), SubdividePolygon(), SWimp_SetMode(), SWimp_Shutdown(), Sys_MakeCodeWriteable(), VID_CreateWindow(), VID_LoadRefresh(), Vk_CreateSurfaceLightmap(), Vk_ImageList_f(), Vk_InitImages(), Vk_LmapTextureMode(), Vk_LoadPic(), Vk_LoadWal(), Vk_Mem_f(), Vk_ScreenShot_f(), Vk_Strings_f(), Vk_TextureMode(), Vk_Upload32(), Vk_Upload8(), Vkimp_BeginFrame(), Vkimp_EnableLogging(), Vkimp_Init(), Vkimp_SetMode(), and WritePCXfile().

◆ rw_time1

float rw_time1

Definition at line 784 of file r_local.h.

Referenced by R_PrintDSpeeds().

◆ rw_time2

float rw_time2

Definition at line 784 of file r_local.h.

Referenced by R_PrintDSpeeds().

◆ sadjust

◆ sc_base

surfcache_t * sc_base

Definition at line 813 of file r_local.h.

Referenced by R_InitGraphics(), and R_Shutdown().

◆ sc_rover

surfcache_t * sc_rover

Definition at line 813 of file r_local.h.

Referenced by D_FlushCaches(), D_SCAlloc(), D_SCDump(), R_InitCaches(), and R_SetupFrame().

◆ scale_for_mip

float scale_for_mip

Definition at line 79 of file r_edge.c.

Referenced by D_SolidSurf(), and D_ViewChanged().

◆ screenedge

mplane_t screenedge[4]

Definition at line 92 of file r_main.c.

Referenced by R_TransformFrustum(), and R_ViewChanged().

◆ se_time1

float se_time1

Definition at line 113 of file r_main.c.

Referenced by R_EdgeDrawing(), and R_PrintDSpeeds().

◆ se_time2

float se_time2

Definition at line 785 of file r_local.h.

Referenced by R_PrintDSpeeds().

◆ shadelight

float shadelight[3]

◆ sintable

int sintable[4200]

Definition at line 47 of file r_rast.c.

Referenced by R_InitTurb(), R_PolygonDrawSpans(), and Turbulent8().

◆ sky_texinfo

mtexinfo_t* sky_texinfo[6]

◆ surf_max

surf_t * surf_max

Definition at line 561 of file r_local.h.

◆ surface_p

surf_t * surface_p

Definition at line 561 of file r_local.h.

◆ surfaces

◆ sw_aliasstats

cvar_t* sw_aliasstats

Definition at line 118 of file r_main.c.

Referenced by R_Register(), and R_RenderFrame().

◆ sw_clearcolor

cvar_t* sw_clearcolor

Definition at line 120 of file r_main.c.

Referenced by D_BackgroundSurf(), D_ViewChanged(), and R_Register().

◆ sw_drawflat

cvar_t* sw_drawflat

Definition at line 121 of file r_main.c.

Referenced by D_DrawSurfaces(), and R_Register().

◆ sw_draworder

cvar_t* sw_draworder

Definition at line 122 of file r_main.c.

Referenced by R_BeginEdgeFrame(), and R_Register().

◆ sw_maxedges

cvar_t* sw_maxedges

Definition at line 123 of file r_main.c.

Referenced by R_NewMap(), and R_Register().

◆ sw_maxsurfs

cvar_t* sw_maxsurfs

Definition at line 124 of file r_main.c.

Referenced by R_NewMap(), and R_Register().

◆ sw_mipcap

cvar_t* sw_mipcap

Definition at line 26 of file r_misc.c.

Referenced by R_Register(), and R_SetupFrame().

◆ sw_mipscale

cvar_t* sw_mipscale

Definition at line 27 of file r_misc.c.

Referenced by R_Register(), and R_SetupFrame().

◆ sw_mode

cvar_t* sw_mode

Definition at line 125 of file r_main.c.

Referenced by R_BeginFrame(), and R_Register().

◆ sw_reportedgeout

cvar_t* sw_reportedgeout

Definition at line 126 of file r_main.c.

Referenced by R_Register(), and R_RenderFrame().

◆ sw_reportsurfout

cvar_t* sw_reportsurfout

Definition at line 127 of file r_main.c.

Referenced by R_Register(), and R_RenderFrame().

◆ sw_state

◆ sw_stipplealpha

cvar_t* sw_stipplealpha

Definition at line 128 of file r_main.c.

Referenced by R_Register().

◆ sw_surfcacheoverride

cvar_t* sw_surfcacheoverride

Definition at line 129 of file r_main.c.

Referenced by R_InitCaches(), and R_Register().

◆ sw_transmooth

◆ sw_waterwarp

cvar_t* sw_waterwarp

Definition at line 130 of file r_main.c.

Referenced by R_Register(), and R_SetupFrame().

◆ sxformaxis

vec3_t sxformaxis[4]

◆ tadjust

◆ thepalette

byte* thepalette

Definition at line 33 of file r_main.c.

Referenced by Draw_GetPalette(), and R_ScreenShot_f().

◆ txformaxis

vec3_t txformaxis[4]

◆ ubasestep

◆ verticalFieldOfView

float verticalFieldOfView

Definition at line 89 of file r_main.c.

Referenced by R_ViewChanged().

◆ vid

◆ vid_fullscreen

cvar_t* vid_fullscreen

Definition at line 47 of file vid_dll.c.

◆ vid_gamma

cvar_t* vid_gamma

Definition at line 43 of file vid_dll.c.

◆ view_clipplanes

◆ vpn

◆ vright

◆ vup

◆ xcenter

◆ xOrigin

float xOrigin

Definition at line 90 of file r_main.c.

Referenced by R_ViewChanged().

◆ xscale

float xscale

Definition at line 82 of file r_main.c.

Referenced by D_ViewChanged(), R_ClipAndDrawPoly(), R_EmitEdge(), and R_ViewChanged().

◆ xscaleinv

float xscaleinv

◆ xscaleshrink

float xscaleshrink

Definition at line 84 of file r_main.c.

Referenced by R_DrawParticles(), and R_ViewChanged().

◆ ycenter

◆ yOrigin

float yOrigin

Definition at line 648 of file r_local.h.

Referenced by R_ViewChanged().

◆ yscale

float yscale

Definition at line 575 of file r_local.h.

Referenced by D_ViewChanged(), R_ClipAndDrawPoly(), R_EmitEdge(), and R_ViewChanged().

◆ yscaleinv

float yscaleinv

◆ yscaleshrink

float yscaleshrink

Definition at line 577 of file r_local.h.

Referenced by R_DrawParticles(), and R_ViewChanged().

◆ zspantable

short* zspantable[MAXHEIGHT]

Definition at line 43 of file r_misc.c.

Referenced by D_ViewChanged().

R_PolysetDrawSpans8_Opaque_Coloured
void R_PolysetDrawSpans8_Opaque_Coloured(spanpackage_t *pspanpackage)
Definition: r_polyse.c:1198
d_xdenom
int d_xdenom
Definition: r_polyse.c:69
vid_fullscreen
cvar_t * vid_fullscreen
Definition: vid_dll.c:47
RF_TRANSLUCENT
#define RF_TRANSLUCENT
Definition: q_shared.h:604
edge_tail_u_shift20
int edge_tail_u_shift20
Definition: r_edge.c:66
R_PolysetDrawSpans8_33
void R_PolysetDrawSpans8_33(spanpackage_t *pspanpackage)
Definition: r_polyse.c:1005
box_faces
int box_faces[6]
Definition: r_rast.c:82
R_Alias_clip_bottom
void R_Alias_clip_bottom(finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out)
Definition: r_aclip.c:186
model_s::numvertexes
int numvertexes
Definition: r_model.h:207
drawsurf_t::image
image_t * image
Definition: r_local.h:348
box_surfedges
int box_surfedges[24]
Definition: r_rast.c:78
d_vrecty
int d_vrecty
Definition: r_misc.c:38
it_sprite
@ it_sprite
Definition: r_local.h:65
dsprframe_t::name
char name[MAX_SKINNAME]
Definition: qfiles.h:178
R_BuildLightMapRGB
void R_BuildLightMapRGB(void)
Definition: r_light.c:732
sv
server_t sv
Definition: sv_init.c:24
surfcache_s::size
int size
Definition: r_local.h:395
refdef_t::vieworg
float vieworg[3]
Definition: ref.h:106
refimport_t::Cmd_RemoveCommand
void(* Cmd_RemoveCommand)(char *name)
Definition: ref.h:197
c_surf
int c_surf
Definition: r_main.c:64
sw_reportedgeout
cvar_t * sw_reportedgeout
Definition: r_main.c:126
rserr_t
rserr_t
Definition: r_local.h:103
RF_SHELL_RED
#define RF_SHELL_RED
Definition: q_shared.h:609
height
GLsizei height
Definition: qgl_win.c:69
zistepu
static float zistepu
Definition: r_scan.c:32
espan_s
Definition: r_local.h:404
currentmodel
model_t * currentmodel
Definition: r_main.c:39
WritePCXfile
void WritePCXfile(char *filename, byte *data, int width, int height, int rowbytes, byte *palette)
Definition: r_misc.c:554
r_framecount
int r_framecount
Definition: r_main.c:97
GL_LoadPic
image_t * GL_LoadPic(char *name, byte *pic, int width, int height, imagetype_t type)
Definition: r_image.c:414
msurface_s::plane
mplane_t * plane
Definition: r_model.h:100
oldrefdef_t::fvrectx_adj
float fvrectx_adj
Definition: r_local.h:126
r_numvblocks
int r_numvblocks
Definition: r_surf.c:37
msurface_s::styles
byte styles[MAXLIGHTMAPS]
Definition: r_model.h:115
r_leftexit
mvertex_t r_leftexit
Definition: r_rast.c:51
r_cnumsurfs
int r_cnumsurfs
Definition: r_main.c:65
YAW
#define YAW
Definition: q_shared.h:73
R_RecursiveWorldNode
void R_RecursiveWorldNode(mnode_t *node, int clipflags)
Definition: r_bsp.c:455
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
transformed_modelorg
vec3_t transformed_modelorg
Definition: r_edge.c:744
MAX_QPATH
#define MAX_QPATH
Definition: q_shared.h:80
entity_s::origin
float origin[3]
Definition: ref.h:57
R_Register
void R_Register(void)
Definition: r_main.c:260
DIB_SetPalette
void DIB_SetPalette(const unsigned char *_pal)
Definition: rw_dib.c:269
WINDOW_CLASS_NAME
#define WINDOW_CLASS_NAME
Definition: rw_imp.c:43
r_clip_verts
vec5_t r_clip_verts[2][MAXWORKINGVERTS+2]
Definition: r_poly.c:52
BACKFACE_EPSILON
#define BACKFACE_EPSILON
Definition: r_local.h:228
yscaleshrink
float yscaleshrink
Definition: r_local.h:577
zi
static float zi
Definition: r_scan.c:31
D_SCAlloc
surfcache_t * D_SCAlloc(int width, int size)
Definition: r_surf.c:505
MAX_BMODEL_VERTS
#define MAX_BMODEL_VERTS
Definition: r_bsp.c:40
R_InitImages
void R_InitImages(void)
Definition: r_image.c:593
r_turb_turb
int * r_turb_turb
Definition: r_scan.c:40
r_novis
cvar_t * r_novis
Definition: r_main.c:139
LittleShort
short LittleShort(short l)
Definition: q_shared.c:946
pbedges
static bedge_t * pbedges
Definition: r_bsp.c:44
oldrefdef_t::vieworg
vec3_t vieworg
Definition: r_local.h:138
int
CONST PIXELFORMATDESCRIPTOR int
Definition: qgl_win.c:35
r_rightenter
mvertex_t r_rightenter
Definition: r_rast.c:52
transformed
static vec3_t transformed
Definition: r_part.c:468
VectorSubtract
#define VectorSubtract(a, b, c)
Definition: q_shared.h:163
surfcache_s
Definition: r_local.h:389
Sys_SetFPCW
void Sys_SetFPCW(void)
Definition: rw_imp.c:351
R_ShutdownImages
void R_ShutdownImages(void)
Definition: r_image.c:603
finalvert_s::u
int u
Definition: r_local.h:293
RF_SHELL_HALF_DAM
#define RF_SHELL_HALF_DAM
Definition: q_shared.h:616
R_AliasSetupSkin
static qboolean R_AliasSetupSkin(void)
Definition: r_alias.c:844
CYCLE
#define CYCLE
Definition: asm_draw.h:16
r_maxsurfsseen
int r_maxsurfsseen
Definition: r_main.c:65
D_BackgroundSurf
void D_BackgroundSurf(surf_t *s)
Definition: r_edge.c:862
MAX_MAP_EDGES
#define MAX_MAP_EDGES
Definition: qfiles.h:245
thepalette
byte * thepalette
Definition: r_main.c:33
TransformVector
void TransformVector(vec3_t in, vec3_t out)
Definition: r_misc.c:216
WRITEPDEST
#define WRITEPDEST(i)
Definition: r_scan.c:427
mod_known
model_t mod_known[MAX_MOD_KNOWN]
Definition: r_model.c:38
sw_reportsurfout
cvar_t * sw_reportsurfout
Definition: r_main.c:127
swwstate_t::initializing
qboolean initializing
Definition: rw_win.h:52
da_time1
float da_time1
Definition: r_main.c:112
r_lerpmodels
cvar_t * r_lerpmodels
Definition: r_main.c:138
Sys_MakeCodeWriteable
void Sys_MakeCodeWriteable(unsigned long startaddr, unsigned long length)
Definition: rw_imp.c:322
viddef_t::buffer
pixel_t * buffer
Definition: r_local.h:94
imagetype_t
imagetype_t
Definition: r_local.h:62
insubmodel
qboolean insubmodel
Definition: r_bsp.c:27
mvertex_t
Definition: r_model.h:45
r_emitted
int r_emitted
Definition: r_rast.c:60
R_ScreenShot_f
void R_ScreenShot_f(void)
Definition: r_misc.c:627
c_faceclip
int c_faceclip
Definition: r_rast.c:34
model_s::nummodelsurfaces
int nummodelsurfaces
Definition: r_model.h:196
R_EmitEdge
void R_EmitEdge(mvertex_t *pv0, mvertex_t *pv1)
Definition: r_rast.c:219
skinwidth
int skinwidth
Definition: r_polyse.c:127
de_time1
float de_time1
Definition: r_local.h:785
r_outofedges
int r_outofedges
Definition: r_main.c:58
R_PushDlights
void R_PushDlights(model_t *model)
Definition: r_light.c:94
bottom
GLdouble GLdouble bottom
Definition: qgl_win.c:159
screenedge
mplane_t screenedge[4]
Definition: r_main.c:92
Hunk_Free
void Hunk_Free(void *base)
Definition: q_shwin.c:99
R_GammaCorrectAndSetPalette
void R_GammaCorrectAndSetPalette(const unsigned char *pal)
Definition: r_main.c:1257
R_ClipEdge
void R_ClipEdge(mvertex_t *pv0, mvertex_t *pv1, clipplane_t *clip)
Definition: r_rast.c:398
ri
refimport_t ri
Definition: r_main.c:25
pcx_t
Definition: qfiles.h:60
R_SurfacePatch
void R_SurfacePatch(void)
Definition: r_misc.c:532
espan_t
struct espan_s espan_t
Sys_Mkdir
void Sys_Mkdir(char *path)
Definition: q_shwin.c:135
RF_SHELL_GREEN
#define RF_SHELL_GREEN
Definition: q_shared.h:610
d_aflatcolor
int d_aflatcolor
Definition: r_polyse.c:68
PRINT_DEVELOPER
#define PRINT_DEVELOPER
Definition: qcommon.h:752
r_skyfaces
msurface_t * r_skyfaces
Definition: r_rast.c:68
aliastriangleparms_t::b
finalvert_t * b
Definition: r_local.h:772
R_Alias_clip_z
void R_Alias_clip_z(finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out)
Definition: r_aclip.c:44
oldrefdef_t::viewangles
vec3_t viewangles
Definition: r_local.h:139
r_customheight
cvar_t * r_customheight
Definition: r_main.c:152
makeleftedge
static qboolean makeleftedge
Definition: r_rast.c:44
r_coloredlights
cvar_t * r_coloredlights
Definition: r_main.c:154
v
GLdouble v
Definition: qgl_win.c:143
it_wall
@ it_wall
Definition: r_local.h:66
cvar_s::modified
qboolean modified
Definition: q_shared.h:330
R_InitGraphics
void R_InitGraphics(int width, int height)
Definition: r_main.c:1108
yscaleinv
float yscaleinv
Definition: r_local.h:576
R_CalcPalette
void R_CalcPalette(void)
Definition: r_main.c:953
d_tdivzstepv
float d_tdivzstepv
Definition: r_local.h:518
CACHE_SIZE
#define CACHE_SIZE
Definition: d_ifacea.h:22
dsprframe_t::height
int height
Definition: qfiles.h:176
d_8to24table
unsigned d_8to24table[256]
Definition: r_main.c:27
sw_drawflat
cvar_t * sw_drawflat
Definition: r_main.c:121
spancountminus1
static float spancountminus1
Definition: r_scan.c:31
R_PolysetDrawSpans8_66
void R_PolysetDrawSpans8_66(spanpackage_t *pspanpackage)
Definition: r_polyse.c:1100
r_stepback
int r_stepback
Definition: r_surf.c:35
d_vrectbottom_particle
int d_vrectbottom_particle
Definition: r_misc.c:38
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
model_s::edges
medge_t * edges
Definition: r_model.h:211
r_skytexinfo
mtexinfo_t r_skytexinfo[6]
Definition: r_rast.c:70
surf_s::flags
int flags
Definition: r_local.h:439
Mod_PointInLeaf
mleaf_t * Mod_PointInLeaf(vec3_t p, model_t *model)
Definition: r_model.c:188
x2
GLdouble GLdouble x2
Definition: qgl_win.c:301
vid
viddef_t vid
Definition: r_main.c:24
refimport_t::FS_LoadFile
int(* FS_LoadFile)(char *name, void **buf)
Definition: ref.h:209
pix
static int pix
Definition: r_part.c:472
de_time1
float de_time1
Definition: r_main.c:113
refimport_t::Cvar_Get
cvar_t *(* Cvar_Get)(char *name, char *value, int flags)
Definition: ref.h:216
sw_draworder
cvar_t * sw_draworder
Definition: r_main.c:122
VectorScale
void VectorScale(vec3_t in, vec_t scale, vec3_t out)
Definition: q_shared.c:782
pcx_t::version
char version
Definition: qfiles.h:63
pcx_t::data
unsigned char data
Definition: qfiles.h:74
pdest
static byte * pdest
Definition: r_scan.c:29
sw_surfcacheoverride
cvar_t * sw_surfcacheoverride
Definition: r_main.c:129
R_FindImage
image_t * R_FindImage(char *name, imagetype_t type)
Definition: r_image.c:491
x
GLint GLenum GLint x
Definition: qgl_win.c:116
dp_time1
float dp_time1
Definition: r_main.c:112
R_AliasClip
int R_AliasClip(finalvert_t *in, finalvert_t *out, int flag, int count, void(*clip)(finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out))
Definition: r_aclip.c:226
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
entity_s::skinnum
int skinnum
Definition: ref.h:70
i
int i
Definition: q_shared.c:305
d_viewbuffer
pixel_t * d_viewbuffer
Definition: r_main.c:196
msurface_s::numedges
int numedges
Definition: r_model.h:104
surf_max
surf_t * surf_max
Definition: r_edge.c:51
refdef_t::y
int y
Definition: ref.h:104
modelorg
vec3_t modelorg
Definition: r_bsp.c:29
msurface_s::dlightframe
int dlightframe
Definition: r_model.h:97
model_s::firstnode
int firstnode
Definition: r_model.h:214
r_p0
int r_p0[9]
Definition: r_polyse.c:64
r_currentkey
int r_currentkey
Definition: r_edge.c:62
de_time2
float de_time2
Definition: r_local.h:785
d_tdivzorigin
float d_tdivzorigin
Definition: r_local.h:519
PARTICLE_66
#define PARTICLE_66
Definition: r_part.c:25
espan_s::pnext
struct espan_s * pnext
Definition: r_local.h:407
sw_lockpvs
cvar_t * sw_lockpvs
Definition: r_main.c:148
polydesc_t::pixel_width
int pixel_width
Definition: r_local.h:416
polydesc_t::stipple_parity
int stipple_parity
Definition: r_local.h:423
count
static int count
Definition: r_scan.c:28
blockdivshift
int blockdivshift
Definition: r_surf.c:28
fv
float fv
Definition: r_edge.c:75
sourcetstep
int sourcetstep
Definition: r_surf.c:26
sw_clearcolor
cvar_t * sw_clearcolor
Definition: r_main.c:120
model_s
Definition: r_model.h:171
r_drawworld
cvar_t * r_drawworld
Definition: r_main.c:134
r_u1
float r_u1
Definition: r_rast.c:62
d_pdrawspans
void(* d_pdrawspans)(spanpackage_t *pspanpackage)
Definition: r_polyse.c:130
PITCH
#define PITCH
Definition: q_shared.h:72
r_aliasuvscale
float r_aliasuvscale
Definition: r_main.c:56
dlight_t::origin
vec3_t origin
Definition: ref.h:84
r_oldviewcluster
int r_oldviewcluster
Definition: r_local.h:791
pbasesource
unsigned char * pbasesource
Definition: r_surf.c:31
pointcolor
vec3_t pointcolor
Definition: r_light.c:116
r_origin
vec3_t r_origin
Definition: r_main.c:75
R_EmitCachedEdge
void R_EmitCachedEdge(void)
Definition: r_rast.c:502
sintable
int sintable[4200]
Definition: r_rast.c:47
r_wholepolycount
int r_wholepolycount
Definition: r_main.c:102
refdef_t::rdflags
int rdflags
Definition: ref.h:110
entity_rotation
float entity_rotation[3][3]
Definition: r_bsp.c:34
sstep
static fixed16_t sstep
Definition: r_scan.c:30
R_EmitSkyBox
void R_EmitSkyBox(void)
Definition: r_rast.c:170
SWimp_Shutdown
void SWimp_Shutdown(void)
Definition: rw_imp.c:274
oldrefdef_t::fvrectright_adj
float fvrectright_adj
Definition: r_local.h:129
SPEED
#define SPEED
Definition: r_local.h:241
r_lightwidth
int r_lightwidth
Definition: r_surf.c:36
xscaleinv
float xscaleinv
Definition: r_main.c:83
t
static fixed16_t t
Definition: r_scan.c:30
width
GLint GLsizei width
Definition: qgl_win.c:115
alias_colormap
unsigned char * alias_colormap
Definition: r_misc.c:76
r_surfsonstack
qboolean r_surfsonstack
Definition: r_main.c:66
edge_s::surfs
unsigned short surfs[2]
Definition: r_local.h:455
finalvert_s::t
int t
Definition: r_local.h:293
c_faceclip
int c_faceclip
Definition: r_rast.c:34
entity_s::flags
int flags
Definition: ref.h:76
pcx_t::hres
unsigned short hres
Definition: qfiles.h:67
r_alpha_surfaces
msurface_t * r_alpha_surfaces
Definition: r_poly.c:47
pdrawfunc
static void(* pdrawfunc)(void)
Definition: r_edge.c:68
vid_gamma
cvar_t * vid_gamma
Definition: r_main.c:145
M_PI
#define M_PI
Definition: q_shared.h:142
dp_time2
float dp_time2
Definition: r_main.c:112
image_s::registration_sequence
int registration_sequence
Definition: r_local.h:77
currententity
entity_t * currententity
Definition: r_bsp.c:28
r_time1
float r_time1
Definition: r_main.c:54
SURF_WARP
#define SURF_WARP
Definition: qfiles.h:372
PARTICLE_Z_CLIP
#define PARTICLE_Z_CLIP
Definition: d_ifacea.h:37
surfcache_s::image
image_t * image
Definition: r_local.h:399
r_pright
vec3_t r_pright
Definition: r_part.c:22
type
GLenum type
Definition: qgl_win.c:72
oldrefdef_t::yOrigin
float yOrigin
Definition: r_local.h:136
mplane_s::normal
vec3_t normal
Definition: r_model.h:59
msurface_s::extents
short extents[2]
Definition: r_model.h:110
se_time1
float se_time1
Definition: r_main.c:113
d_zrowbytes
unsigned int d_zrowbytes
Definition: r_main.c:198
polydesc_t::vpn
vec3_t vpn
Definition: r_local.h:418
r_numhblocks
int r_numhblocks
Definition: r_surf.c:37
skip
static void skip(vorb *z, int n)
Definition: stb_vorbis.c:1336
cvar_s
Definition: q_shared.h:324
SHELL_DOUBLE_COLOR
#define SHELL_DOUBLE_COLOR
Definition: ref.h:42
mod_brush
@ mod_brush
Definition: r_model.h:169
R_DrawSurface
void R_DrawSurface(void)
Definition: r_surf.c:145
box_vecs
vec3_t box_vecs[6][2]
Definition: r_rast.c:84
r_turb_t
static fixed16_t r_turb_t
Definition: r_scan.c:37
D_SkySurf
void D_SkySurf(surf_t *s)
Definition: r_edge.c:940
R_MarkLights
void R_MarkLights(dlight_t *light, int bit, mnode_t *node)
Definition: r_light.c:40
BestColor
byte BestColor(int r, int g, int b, int start, int stop)
Definition: r_draw.c:135
polydesc_t::viewer_position
float viewer_position[3]
Definition: r_local.h:421
tdivzstepu
static float tdivzstepu
Definition: r_scan.c:32
mleaf_s
Definition: r_model.h:143
intsintable
int intsintable[4200]
Definition: r_rast.c:48
D_DrawTurbulent8Span
void D_DrawTurbulent8Span(espan_t *pspan)
Definition: r_scan.c:112
R_DrawTriangle
void R_DrawTriangle(void)
Definition: r_polyse.c:218
SURF_TRANS66
#define SURF_TRANS66
Definition: qfiles.h:374
r_lefthand
cvar_t * r_lefthand
Definition: r_main.c:117
model_s::extradata
void * extradata
Definition: r_model.h:235
numbedges
static int numbedges
Definition: r_bsp.c:45
r_warpheight
int r_warpheight
Definition: r_main.c:47
dv
static float dv
Definition: r_scan.c:31
clipplane_s::normal
vec3_t normal
Definition: r_local.h:380
sw_draworder
cvar_t * sw_draworder
Definition: r_main.c:122
ALIAS_Z_CLIP
#define ALIAS_Z_CLIP
Definition: r_local.h:215
r_drawentities
cvar_t * r_drawentities
Definition: r_main.c:135
sc_rover
surfcache_t * sc_rover
Definition: r_surf.c:113
refimport_t::FS_FreeFile
void(* FS_FreeFile)(void *buf)
Definition: ref.h:210
vup
vec3_t vup
Definition: r_main.c:72
r_viewcluster
int r_viewcluster
Definition: r_main.c:108
SWimp_SetPalette
void SWimp_SetPalette(const unsigned char *palette)
Definition: rw_imp.c:257
j
GLint j
Definition: qgl_win.c:150
rserr_unknown
@ rserr_unknown
Definition: r_local.h:110
D_WarpScreen
void D_WarpScreen(void)
Definition: r_scan.c:52
r_clip_verts
vec5_t r_clip_verts[2][MAXWORKINGVERTS+2]
Definition: r_poly.c:52
Draw_GetPalette
void Draw_GetPalette(void)
Definition: r_main.c:1423
PARTICLE_OPAQUE
#define PARTICLE_OPAQUE
Definition: r_part.c:26
partparms_t::color
int color
Definition: r_part.c:32
de_time2
float de_time2
Definition: r_main.c:113
tdivz
static float tdivz
Definition: r_scan.c:31
surf_s::spans
struct espan_s * spans
Definition: r_local.h:432
r_dspeeds
cvar_t * r_dspeeds
Definition: r_main.c:136
mvertex_t::position
vec3_t position
Definition: r_model.h:47
rw_time2
float rw_time2
Definition: r_local.h:784
R_ViewChanged
void R_ViewChanged(vrect_t *vr)
Definition: r_misc.c:331
r_numallocatededges
int r_numallocatededges
Definition: r_main.c:55
Draw_8to24
void Draw_8to24(byte *palette)
Definition: r_draw.c:55
Mod_FreeAll
void Mod_FreeAll(void)
Definition: r_model.c:1324
R_RecursiveClipBPoly
void R_RecursiveClipBPoly(bedge_t *pedges, mnode_t *pnode, msurface_t *psurf)
Definition: r_bsp.c:156
refimport_t::Vid_GetModeInfo
qboolean(* Vid_GetModeInfo)(int *width, int *height, int mode)
Definition: ref.h:220
mod_numknown
int mod_numknown
Definition: r_model.c:39
c_drawnode
int c_drawnode
Definition: r_bsp.c:448
espan_s::count
int count
Definition: r_local.h:406
sw_maxedges
cvar_t * sw_maxedges
Definition: r_main.c:123
R_FreeUnusedImages
void R_FreeUnusedImages(void)
Definition: r_image.c:564
edge_p
edge_t * edge_p
Definition: r_edge.c:49
r_refdef
oldrefdef_t r_refdef
Definition: r_main.c:80
aliasxscale
float aliasxscale
Definition: r_main.c:85
r_leftclipped
qboolean r_leftclipped
Definition: r_rast.c:43
finalvert_s::v
int v
Definition: r_local.h:293
R_EdgeDrawing
void R_EdgeDrawing(void)
Definition: r_main.c:888
dsprite_t
Definition: qfiles.h:181
fv
static finalvert_t fv[2][8]
Definition: r_aclip.c:24
polydesc_t::pixels
byte * pixels
Definition: r_local.h:415
edge_s::next
struct edge_s * next
Definition: r_local.h:454
model_s::numedges
int numedges
Definition: r_model.h:210
AngleVectors
void AngleVectors(vec3_t angles, vec3_t forward, vec3_t right, vec3_t up)
Definition: q_shared.c:93
SURF_PLANEBACK
#define SURF_PLANEBACK
Definition: r_model.h:68
RF_WEAPONMODEL
#define RF_WEAPONMODEL
Definition: q_shared.h:601
snext
static fixed16_t snext
Definition: r_scan.c:30
R_Alias_clip_right
void R_Alias_clip_right(finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out)
Definition: r_aclip.c:108
r_numallocatededges
int r_numallocatededges
Definition: r_main.c:55
polydesc_t::t_offset
float t_offset
Definition: r_local.h:420
Draw_InitRGBMap
void Draw_InitRGBMap(void)
Definition: r_draw.c:174
model_s::registration_sequence
int registration_sequence
Definition: r_model.h:175
surfrowbytes
int surfrowbytes
Definition: r_surf.c:32
oldrefdef_t::fvrecty_adj
float fvrecty_adj
Definition: r_local.h:126
refimport_t::Con_Printf
void(* Con_Printf)(int print_level, char *str,...)
Definition: ref.h:202
u
static int u
Definition: r_part.c:472
PRINT_ALL
#define PRINT_ALL
Definition: qcommon.h:751
D_DrawSurfaces
void D_DrawSurfaces(void)
Definition: r_edge.c:1088
v
static int v
Definition: r_part.c:472
R_SetLightLevel
void R_SetLightLevel(void)
Definition: r_main.c:1011
bedge_s::pnext
struct bedge_s * pnext
Definition: r_local.h:373
mtexinfo_s::image
image_t * image
Definition: r_model.h:87
polydesc_t::s_offset
float s_offset
Definition: r_local.h:420
R_Alias_clip_left
void R_Alias_clip_left(finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out)
Definition: r_aclip.c:69
partparms_t::particle
particle_t * particle
Definition: r_part.c:30
pcx_t::ymin
unsigned short ymin
Definition: qfiles.h:66
R_RegisterModel
struct model_s * R_RegisterModel(char *name)
Definition: r_model.c:1239
SHELL_BLUE_COLOR
#define SHELL_BLUE_COLOR
Definition: ref.h:34
sw_transmooth
cvar_t * sw_transmooth
Definition: r_main.c:131
d_pix_max
int d_pix_max
Definition: r_local.h:534
swwstate_t::palettized
qboolean palettized
Definition: rw_win.h:49
RDF_NOWORLDMODEL
#define RDF_NOWORLDMODEL
Definition: q_shared.h:622
r_skyedges
medge_t * r_skyedges
Definition: r_rast.c:72
base_vup
vec3_t base_vup
Definition: r_local.h:557
SHELL_RED_COLOR
#define SHELL_RED_COLOR
Definition: ref.h:32
Draw_Fill
#define Draw_Fill
Definition: qmenu.c:49
da_time1
float da_time1
Definition: r_main.c:112
NUM_BEAM_SEGS
#define NUM_BEAM_SEGS
R_PolysetDrawSpansConstant8_33
void R_PolysetDrawSpansConstant8_33(spanpackage_t *pspanpackage)
Definition: r_polyse.c:1061
CrossProduct
void CrossProduct(vec3_t v1, vec3_t v2, vec3_t cross)
Definition: q_shared.c:753
d_ziorigin
float d_ziorigin
Definition: r_local.h:519
base_vpn
vec3_t base_vpn
Definition: r_local.h:558
prowdestbase
void * prowdestbase
Definition: r_surf.c:30
sw_mipcap
cvar_t * sw_mipcap
Definition: r_misc.c:26
NUM_MIPS
#define NUM_MIPS
Definition: r_misc.c:24
model_s::numframes
int numframes
Definition: r_model.h:178
R_DrawEntitiesOnList
void R_DrawEntitiesOnList(void)
Definition: r_main.c:548
r_speeds
cvar_t * r_speeds
Definition: r_main.c:141
D_FlushCaches
void D_FlushCaches(void)
Definition: r_surf.c:481
SWimp_EndFrame
void SWimp_EndFrame(void)
Definition: rw_imp.c:163
r_edges
edge_t * r_edges
Definition: r_edge.c:49
auxedges
edge_t * auxedges
Definition: r_edge.c:48
sw_drawflat
cvar_t * sw_drawflat
Definition: r_main.c:121
miplevel
static int miplevel
Definition: r_edge.c:77
Draw_InitLocal
void Draw_InitLocal(void)
Definition: r_draw.c:222
d_pix_min
int d_pix_min
Definition: r_misc.c:40
it_pic
@ it_pic
Definition: r_local.h:67
base_vright
vec3_t base_vright
Definition: r_local.h:559
MINEDGES
#define MINEDGES
Definition: r_local.h:205
model_s::texinfo
mtexinfo_t * texinfo
Definition: r_model.h:218
surf_s::entity
entity_t * entity
Definition: r_local.h:441
FRAMECOUNT_MASK
#define FRAMECOUNT_MASK
Definition: r_rast.c:30
entity_s::alpha
float alpha
Definition: ref.h:73
viddef_t::rowbytes
int rowbytes
Definition: r_local.h:97
R_LoadWal
image_t * R_LoadWal(char *name)
Definition: r_image.c:448
vid_fullscreen
cvar_t * vid_fullscreen
Definition: r_main.c:144
xscaleshrink
float xscaleshrink
Definition: r_main.c:84
Mod_ForName
model_t * Mod_ForName(char *name, qboolean crash)
Definition: r_model.c:90
r_turb_pbase
static byte * r_turb_pbase
Definition: r_scan.c:36
r
GLdouble GLdouble r
Definition: qgl_win.c:336
mplane_s::dist
float dist
Definition: r_model.h:60
medge_t
Definition: r_model.h:77
r_polycount
int r_polycount
Definition: r_main.c:100
R_BuildPolygonFromSurface
void R_BuildPolygonFromSurface(msurface_t *fa)
Definition: r_poly.c:1160
r_maxedgesseen
int r_maxedgesseen
Definition: r_main.c:65
image_s::height
int height
Definition: r_local.h:75
viddef_t::width
unsigned width
Definition: vid.h:29
d_vrectx
int d_vrectx
Definition: r_misc.c:38
Draw_StretchPicImplementation
void Draw_StretchPicImplementation(int x, int y, int w, int h, image_t *pic)
Definition: r_draw.c:342
r_lerpmodels
cvar_t * r_lerpmodels
Definition: r_main.c:138
se_time2
float se_time2
Definition: r_local.h:785
R_InitTextures
void R_InitTextures(void)
Definition: r_main.c:211
SHELL_BG_COLOR
#define SHELL_BG_COLOR
Definition: ref.h:39
ALIAS_BOTTOM_CLIP
#define ALIAS_BOTTOM_CLIP
Definition: r_local.h:214
model_s::type
modtype_t type
Definition: r_model.h:177
BlendParticle33
static byte BlendParticle33(int pcolor, int dstcolor)
Definition: r_part.c:438
clipplane_s::leftedge
byte leftedge
Definition: r_local.h:383
v2
GLdouble GLdouble GLint GLint GLdouble GLdouble v2
Definition: qgl_win.c:227
bbextentt
fixed16_t bbextentt
Definition: r_local.h:522
refdef_t::num_dlights
int num_dlights
Definition: ref.h:119
SWimp_InitGraphics
static qboolean SWimp_InitGraphics(void)
Definition: rw_imp.c:135
refimport_t::Cmd_AddCommand
void(* Cmd_AddCommand)(char *name, void(*cmd)(void))
Definition: ref.h:196
ROLL
#define ROLL
Definition: q_shared.h:74
edge_s::u_step
fixed16_t u_step
Definition: r_local.h:453
clipplane_s::rightedge
byte rightedge
Definition: r_local.h:384
sw_mipcap
cvar_t * sw_mipcap
Definition: r_misc.c:26
R_PrintTimes
void R_PrintTimes(void)
Definition: r_misc.c:131
r_skyverts
mvertex_t * r_skyverts
Definition: r_rast.c:71
D_TurbulentSurf
void D_TurbulentSurf(surf_t *s)
Definition: r_edge.c:879
R_NewMap
void R_NewMap(void)
Definition: r_main.c:415
espan_s::v
int v
Definition: r_local.h:406
R_EntityRotate
void R_EntityRotate(vec3_t vec)
Definition: r_bsp.c:59
polydesc_t::nump
int nump
Definition: r_local.h:413
izistep
static int izistep
Definition: r_scan.c:33
particle_t::alpha
float alpha
Definition: ref.h:93
RF_DEPTHHACK
#define RF_DEPTHHACK
Definition: q_shared.h:603
r_images
image_t r_images[MAX_RIMAGES]
Definition: r_image.c:25
R_GammaCorrectAndSetPalette
void R_GammaCorrectAndSetPalette(const unsigned char *palette)
Definition: r_main.c:1257
rserr_invalid_mode
@ rserr_invalid_mode
Definition: r_local.h:108
PerpendicularVector
void PerpendicularVector(vec3_t dst, const vec3_t src)
Definition: q_shared.c:152
sw_waterwarp
cvar_t * sw_waterwarp
Definition: r_main.c:130
VectorLength
vec_t VectorLength(vec3_t v)
Definition: q_shared.c:762
numbverts
static int numbverts
Definition: r_bsp.c:45
model_s::numsurfedges
int numsurfedges
Definition: r_model.h:223
oldrefdef_t::aliasvrectbottom
int aliasvrectbottom
Definition: r_local.h:122
msurface_s::texinfo
mtexinfo_t * texinfo
Definition: r_model.h:112
scale_for_mip
float scale_for_mip
Definition: r_edge.c:79
d_pix_shift
int d_pix_shift
Definition: r_local.h:534
edge_tail
edge_t edge_tail
Definition: r_edge.c:71
swwstate_t::hInstance
HINSTANCE hInstance
Definition: rw_win.h:28
drawsurf_t::surfheight
int surfheight
Definition: r_local.h:351
oldrefdef_t::fvrectbottom_adj
float fvrectbottom_adj
Definition: r_local.h:129
edge_s::owner
medge_t * owner
Definition: r_local.h:458
medge_t::cachededgeoffset
unsigned int cachededgeoffset
Definition: r_model.h:80
basemip
static float basemip[NUM_MIPS-1]
Definition: r_misc.c:34
t
GLdouble t
Definition: qgl_win.c:328
model_s::nodes
mnode_t * nodes
Definition: r_model.h:215
r_turb_s
static fixed16_t r_turb_s
Definition: r_scan.c:37
R_RasterizeAliasPolySmooth
void R_RasterizeAliasPolySmooth(void)
Definition: r_polyse.c:1314
partparms_t::level
int level
Definition: r_part.c:31
d_spanpixcount
int d_spanpixcount
Definition: r_main.c:99
r_affinetridesc
affinetridesc_t r_affinetridesc
Definition: r_alias.c:34
R_RemoveEdges
void R_RemoveEdges(edge_t *pedge)
Definition: r_edge.c:196
r_rightexit
mvertex_t r_rightexit
Definition: r_rast.c:52
R_DrawParticles
void R_DrawParticles(void)
Definition: r_part.c:598
edge_aftertail
edge_t edge_aftertail
Definition: r_edge.c:72
mleaf_s::cluster
int cluster
Definition: r_model.h:154
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
pixel_t
unsigned char pixel_t
Definition: r_local.h:84
d_pix_shift
int d_pix_shift
Definition: r_misc.c:40
refimport_t::Sys_Error
void(* Sys_Error)(int err_level, char *str,...)
Definition: ref.h:194
RecursiveLightPointColor
int RecursiveLightPointColor(mnode_t *node, vec3_t start, vec3_t end)
Definition: r_light.c:281
dmdl_t::num_skins
int num_skins
Definition: qfiles.h:146
tstep
static fixed16_t tstep
Definition: r_scan.c:30
dlight_t::color
vec3_t color
Definition: ref.h:85
polydesc_t::dist
float dist
Definition: r_local.h:419
RF_SHELL_DOUBLE
#define RF_SHELL_DOUBLE
Definition: q_shared.h:615
SURF_FLOWING
#define SURF_FLOWING
Definition: qfiles.h:375
d_pix_max
int d_pix_max
Definition: r_misc.c:40
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
edge_max
edge_t * edge_max
Definition: r_edge.c:49
DotProduct
#define DotProduct(x, y)
Definition: q_shared.h:162
palmap2
byte palmap2[64][64][64]
Definition: r_draw.c:91
CVAR_ARCHIVE
#define CVAR_ARCHIVE
Definition: q_shared.h:316
D_Patch
void D_Patch(void)
Definition: r_misc.c:50
viddef_t::height
unsigned height
Definition: vid.h:29
SURF_TRANS33
#define SURF_TRANS33
Definition: qfiles.h:373
drawsurf_t::surfmip
int surfmip
Definition: r_local.h:349
r_worldmodel
model_t * r_worldmodel
Definition: r_main.c:41
AMP
#define AMP
Definition: r_local.h:239
edge_s::nearzi
float nearzi
Definition: r_local.h:457
tnext
static fixed16_t tnext
Definition: r_scan.c:30
r_p2
int r_p2[9]
Definition: r_polyse.c:64
r_ceilv1
int r_ceilv1
Definition: r_rast.c:63
clipplane_s::next
struct clipplane_s * next
Definition: r_local.h:382
MINSURFACES
#define MINSURFACES
Definition: r_local.h:207
blocklights
unsigned blocklights[18 *18 *3]
Definition: r_light.c:444
da_time2
float da_time2
Definition: r_local.h:783
r_worldmodel
model_t * r_worldmodel
Definition: r_main.c:41
pcx_t::ymax
unsigned short ymax
Definition: qfiles.h:66
pz
static short * pz
Definition: r_part.c:471
makerightedge
static qboolean makerightedge
Definition: r_rast.c:44
surfcache_s::owner
struct surfcache_s ** owner
Definition: r_local.h:392
edge_head
edge_t edge_head
Definition: r_edge.c:70
cvar_s::value
float value
Definition: q_shared.h:331
r_pup
vec3_t r_pup
Definition: r_part.c:22
skinstart
byte * skinstart
Definition: r_polyse.c:128
D_DrawflatSurfaces
void D_DrawflatSurfaces(void)
Definition: r_edge.c:1060
r_currentbkey
int r_currentbkey
Definition: r_bsp.c:36
entity_s::backlerp
float backlerp
Definition: ref.h:69
xscale
float xscale
Definition: r_main.c:82
r_skysurfedges
int * r_skysurfedges
Definition: r_rast.c:73
r_p1
int r_p1[9]
Definition: r_polyse.c:64
MAX_OSPATH
#define MAX_OSPATH
Definition: q_shared.h:81
R_UnRegister
void R_UnRegister(void)
Definition: r_main.c:314
NUMSTACKEDGES
#define NUMSTACKEDGES
Definition: r_local.h:204
XCENTERING
#define XCENTERING
Definition: r_local.h:223
model_s::lightdata
byte * lightdata
Definition: r_model.h:231
R_ClipAndDrawPoly
void R_ClipAndDrawPoly(float alpha, int isturbulent, qboolean textured)
Definition: r_poly.c:1048
r_nearzionly
qboolean r_nearzionly
Definition: r_rast.c:45
sc_base
surfcache_t * sc_base
Definition: r_surf.c:113
r_outofsurfaces
int r_outofsurfaces
Definition: r_main.c:57
image_s::type
imagetype_t type
Definition: r_local.h:74
Mod_Init
void Mod_Init(void)
Definition: r_model.c:78
clipplane_s
Definition: r_local.h:378
r_polydesc
polydesc_t r_polydesc
Definition: r_poly.c:45
espan_s::u
int u
Definition: r_local.h:406
refimport_t::FS_Gamedir
char *(* FS_Gamedir)(void)
Definition: ref.h:214
SURF_DRAWTURB
#define SURF_DRAWTURB
Definition: r_model.h:70
drawsurf_t::surfdat
byte * surfdat
Definition: r_local.h:343
du
static float du
Definition: r_scan.c:31
edge_s::u
fixed16_t u
Definition: r_local.h:452
VectorNormalize
vec_t VectorNormalize(vec3_t v)
Definition: q_shared.c:681
F
#define F(X, Y, Z)
Definition: md4.c:13
blocksize
int blocksize
Definition: r_surf.c:26
pcx_t::encoding
char encoding
Definition: qfiles.h:64
NULL
#define NULL
Definition: q_shared.h:67
r_drawnpolycount
int r_drawnpolycount
Definition: r_main.c:101
bbextents
fixed16_t bbextents
Definition: r_local.h:733
MAX_MAP_FACES
#define MAX_MAP_FACES
Definition: qfiles.h:241
DIB_Shutdown
void DIB_Shutdown(void)
Definition: rw_dib.c:374
refdef_t::time
float time
Definition: ref.h:109
pbverts
static mvertex_t * pbverts
Definition: r_bsp.c:43
d_scantable
int d_scantable[MAXHEIGHT]
Definition: r_misc.c:42
r_viewcluster
int r_viewcluster
Definition: r_main.c:108
edge_s::nextremove
struct edge_s * nextremove
Definition: r_local.h:456
vrect_s::x
int x
Definition: vid.h:24
SHELL_HALF_DAM_COLOR
#define SHELL_HALF_DAM_COLOR
Definition: ref.h:43
d_zistepv
float d_zistepv
Definition: r_local.h:518
SWimp_SetMode
rserr_t SWimp_SetMode(int *pwidth, int *pheight, int mode, qboolean fullscreen)
Definition: rw_imp.c:189
zspantable
short * zspantable[MAXHEIGHT]
Definition: r_misc.c:43
surfmiptable
static void(* surfmiptable[4])(void)
Definition: r_surf.c:45
model_s::surfedges
int * surfedges
Definition: r_model.h:224
r_alpha_surfaces
msurface_t * r_alpha_surfaces
Definition: r_poly.c:47
R_TextureAnimation
image_t * R_TextureAnimation(mtexinfo_t *tex)
Definition: r_surf.c:122
R_GenerateSpansBackward
void R_GenerateSpansBackward(void)
Definition: r_edge.c:601
finalvert_s::zi
int zi
Definition: r_local.h:295
surface_p
surf_t * surface_p
Definition: r_edge.c:51
image_s::pixels
byte * pixels[4]
Definition: r_local.h:78
se_time2
float se_time2
Definition: r_main.c:113
image_s::width
int width
Definition: r_local.h:75
r_turb_tstep
static fixed16_t r_turb_tstep
Definition: r_scan.c:37
FULLY_CLIPPED_CACHED
#define FULLY_CLIPPED_CACHED
Definition: r_rast.c:29
VectorInverse
void VectorInverse(vec3_t v)
Definition: q_shared.c:775
thepalette
byte * thepalette
Definition: r_main.c:33
dp_time1
float dp_time1
Definition: r_main.c:112
bedge_s
Definition: r_local.h:370
particle_t
Definition: ref.h:89
numr_images
int numr_images
Definition: r_image.c:26
r_viewleaf
mleaf_t * r_viewleaf
Definition: r_main.c:107
pcx_t::palette_type
unsigned short palette_type
Definition: qfiles.h:72
alpha
GLfloat GLfloat GLfloat alpha
Definition: qgl_win.c:74
refdef_t::num_particles
int num_particles
Definition: ref.h:122
surfmiptable8RGB
static void(* surfmiptable8RGB[4])(void)
Definition: r_surf.c:88
refdef_t::height
int height
Definition: ref.h:104
R_InsertNewEdges
void R_InsertNewEdges(edge_t *edgestoadd, edge_t *edgelist)
Definition: r_edge.c:155
r_screenwidth
int r_screenwidth
Definition: r_main.c:87
d_zistepu
float d_zistepu
Definition: r_local.h:517
edge_sentinel
edge_t edge_sentinel
Definition: r_edge.c:73
image_s::name
char name[MAX_QPATH]
Definition: r_local.h:73
image_s::transparent
qboolean transparent
Definition: r_local.h:76
r_sourcemax
unsigned char * r_sourcemax
Definition: r_surf.c:38
ycenter
float ycenter
Definition: r_local.h:574
ERR_DROP
#define ERR_DROP
Definition: qcommon.h:744
SURF_DRAWSKYBOX
#define SURF_DRAWSKYBOX
Definition: r_model.h:72
dsprite_t::frames
dsprframe_t frames[1]
Definition: qfiles.h:185
RecursiveLightPoint
int RecursiveLightPoint(mnode_t *node, vec3_t start, vec3_t end)
Definition: r_light.c:120
d_vrectright_particle
int d_vrectright_particle
Definition: r_misc.c:38
it_skin
@ it_skin
Definition: r_local.h:64
AMP2
#define AMP2
Definition: r_local.h:240
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
d_pzbuffer
short * d_pzbuffer
Definition: r_main.c:197
pcx_t::bits_per_pixel
char bits_per_pixel
Definition: qfiles.h:65
r_dowarp
qboolean r_dowarp
Definition: r_main.c:60
dsprframe_t::width
int width
Definition: qfiles.h:176
particle_t::origin
vec3_t origin
Definition: ref.h:91
name
cvar_t * name
Definition: cl_main.c:79
REF_VERSION
#define REF_VERSION
Definition: r_local.h:36
cacheoffset
unsigned int cacheoffset
Definition: r_rast.c:32
r_v1
float r_v1
Definition: r_rast.c:62
SHELL_GREEN_COLOR
#define SHELL_GREEN_COLOR
Definition: ref.h:33
ERR_FATAL
#define ERR_FATAL
Definition: qcommon.h:743
R_PolysetDrawSpansConstant8_66
void R_PolysetDrawSpansConstant8_66(spanpackage_t *pspanpackage)
Definition: r_polyse.c:1156
msurface_s::flags
int flags
Definition: r_model.h:101
mod_sprite
@ mod_sprite
Definition: r_model.h:169
R_GenerateSpans
void R_GenerateSpans(void)
Definition: r_edge.c:564
affinetridesc_t::skinwidth
int skinwidth
Definition: r_local.h:330
MAX_LBM_HEIGHT
#define MAX_LBM_HEIGHT
Definition: r_local.h:184
spanpackage_t
Definition: r_polyse.c:39
pcx_t::xmin
unsigned short xmin
Definition: qfiles.h:66
swstate_s::prev_mode
int prev_mode
Definition: r_local.h:881
surf_s::d_zistepv
float d_zistepv
Definition: r_local.h:444
VectorAdd
#define VectorAdd(a, b, c)
Definition: q_shared.h:164
surf_s::d_zistepu
float d_zistepu
Definition: r_local.h:444
r_lightptr
int * r_lightptr
Definition: r_surf.c:34
SHELL_RG_COLOR
#define SHELL_RG_COLOR
Definition: ref.h:36
s
static fixed16_t s
Definition: r_scan.c:30
r_amodels_drawn
int r_amodels_drawn
Definition: r_alias.c:32
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
surfscale
float surfscale
Definition: r_surf.c:109
sdivz
static float sdivz
Definition: r_scan.c:31
a_spans
spanpackage_t * a_spans
Definition: r_polyse.c:97
sw_mode
cvar_t * sw_mode
Definition: r_main.c:125
r_pedge
medge_t * r_pedge
Definition: r_rast.c:41
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
span_p
espan_t * span_p
Definition: r_edge.c:60
RDF_UNDERWATER
#define RDF_UNDERWATER
Definition: q_shared.h:621
r_polydesc
polydesc_t r_polydesc
Definition: r_poly.c:45
aliastriangleparms_t::a
finalvert_t * a
Definition: r_local.h:772
entity_s::frame
int frame
Definition: ref.h:58
R_AliasSetUpTransform
void R_AliasSetUpTransform(void)
Definition: r_alias.c:362
r_rightclipped
qboolean r_rightclipped
Definition: r_rast.c:43
d_initial_rover
surfcache_t * d_initial_rover
Definition: r_misc.c:29
Draw_BuildGammaTable
void Draw_BuildGammaTable(void)
Definition: r_main.c:1314
VectorCopy
#define VectorCopy(a, b)
Definition: q_shared.h:165
oldrefdef_t::aliasvrectright
int aliasvrectright
Definition: r_local.h:122
R_EdgeCodeStart
void R_EdgeCodeStart(void)
vec_t
float vec_t
Definition: q_shared.h:133
msurface_s::cachespots
struct surfcache_s * cachespots[MIPLEVELS]
Definition: r_model.h:107
model_s::skins
image_t * skins[MAX_MD2SKINS]
Definition: r_model.h:234
surf_s::d_ziorigin
float d_ziorigin
Definition: r_local.h:444
WINDOW_STYLE
#define WINDOW_STYLE
Definition: winquake.h:28
R_AliasSetupFrames
void R_AliasSetupFrames(dmdl_t *pmdl)
Definition: r_alias.c:994
refdef_t::lightstyles
lightstyle_t * lightstyles
Definition: ref.h:114
d_roverwrapped
qboolean d_roverwrapped
Definition: r_misc.c:30
R_Alias_clip_top
void R_Alias_clip_top(finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out)
Definition: r_aclip.c:147
SHELL_RB_COLOR
#define SHELL_RB_COLOR
Definition: ref.h:38
sw_stipplealpha
cvar_t * sw_stipplealpha
Definition: r_main.c:128
oldrefdef_t::vrect
vrect_t vrect
Definition: r_local.h:118
R_InitTurb
void R_InitTurb(void)
Definition: r_main.c:246
R_StepActiveU
void R_StepActiveU(edge_t *pedge)
Definition: r_edge.c:216
refdef_t::particles
particle_t * particles
Definition: ref.h:123
removeedges
edge_t * removeedges[MAXHEIGHT]
Definition: r_edge.c:58
sc_base
surfcache_t * sc_base
Definition: r_local.h:813
drawsurf_t::surf
msurface_t * surf
Definition: r_local.h:345
MAX_MAP_VERTS
#define MAX_MAP_VERTS
Definition: qfiles.h:240
r_lzi1
float r_lzi1
Definition: r_rast.c:62
d_8to24table
unsigned d_8to24table[256]
Definition: r_main.c:27
ALIAS_LEFT_CLIP
#define ALIAS_LEFT_CLIP
Definition: r_local.h:211
d_vrectbottom_particle
int d_vrectbottom_particle
Definition: r_local.h:532
R_AliasCheckBBox
qboolean R_AliasCheckBBox(void)
Definition: r_alias.c:182
vec3_origin
vec3_t vec3_origin
Definition: q_shared.c:24
sw_allow_modex
cvar_t * sw_allow_modex
Definition: r_main.c:119
vrect_s::width
int width
Definition: vid.h:24
model_s::name
char name[MAX_QPATH]
Definition: r_model.h:173
r_newrefdef
refdef_t r_newrefdef
Definition: r_main.c:38
MAXSPANS
#define MAXSPANS
Definition: r_local.h:208
model_s::numtexinfo
int numtexinfo
Definition: r_model.h:217
current_iv
int current_iv
Definition: r_edge.c:64
R_AliasSetUpLerpData
void R_AliasSetUpLerpData(dmdl_t *pmdl, float backlerp)
Definition: r_alias.c:1024
SHELL_WHITE_COLOR
#define SHELL_WHITE_COLOR
Definition: ref.h:47
r_turb_pdest
static byte * r_turb_pdest
Definition: r_scan.c:36
world
#define world
Definition: g_local.h:556
up
static vec3_t up
Definition: p_view.c:29
r_warpbuffer
byte * r_warpbuffer
Definition: r_main.c:45
dsprite_t::numframes
int numframes
Definition: qfiles.h:184
edge_s::prev
struct edge_s * prev
Definition: r_local.h:454
finalvert_s::s
int s
Definition: r_local.h:293
R_SetUpFrustumIndexes
void R_SetUpFrustumIndexes(void)
Definition: r_misc.c:295
D_SolidSurf
void D_SolidSurf(surf_t *s)
Definition: r_edge.c:973
ALIAS_TOP_CLIP
#define ALIAS_TOP_CLIP
Definition: r_local.h:212
rserr_ok
@ rserr_ok
Definition: r_local.h:105
R_RenderFace
void R_RenderFace(msurface_t *fa, int clipflags)
Definition: r_rast.c:525
R_BuildLightMap
void R_BuildLightMap(void)
Definition: r_light.c:551
r_lightlevel
cvar_t * r_lightlevel
Definition: r_main.c:142
u2
GLdouble GLdouble u2
Definition: qgl_win.c:225
pdest
static byte * pdest
Definition: r_part.c:470
level
GLint level
Definition: qgl_win.c:116
dlight_t
Definition: ref.h:82
d_scalemip
float d_scalemip[NUM_MIPS-1]
Definition: r_misc.c:32
dsprframe_t::origin_y
int origin_y
Definition: qfiles.h:177
SWimp_Init
int SWimp_Init(void *hInstance, void *wndProc)
Definition: rw_imp.c:118
r_warpbuffer
byte * r_warpbuffer
Definition: r_main.c:45
bedge_s::v
mvertex_t * v[2]
Definition: r_local.h:372
d_vrectx
int d_vrectx
Definition: r_misc.c:38
surf_s::insubmodel
qboolean insubmodel
Definition: r_local.h:443
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
drawsurf_t::lightadj
fixed8_t lightadj[MAXLIGHTMAPS]
Definition: r_local.h:346
surfcache_s::data
byte data[4]
Definition: r_local.h:400
MAX_BMODEL_EDGES
#define MAX_BMODEL_EDGES
Definition: r_bsp.c:41
R_ConcatRotations
void R_ConcatRotations(float in1[3][3], float in2[3][3], float out[3][3])
Definition: q_shared.c:191
NUMSTACKSURFACES
#define NUMSTACKSURFACES
Definition: r_local.h:206
R_RenderBmodelFace
void R_RenderBmodelFace(bedge_t *pedges, msurface_t *psurf)
Definition: r_rast.c:738
sdivzstepu
static float sdivzstepu
Definition: r_scan.c:32
model_s::firstmodelsurface
int firstmodelsurface
Definition: r_model.h:196
R_AliasPreparePoints
void R_AliasPreparePoints(void)
Definition: r_alias.c:242
finalvert_s::flags
int flags
Definition: r_local.h:296
newedges
edge_t * newedges[MAXHEIGHT]
Definition: r_edge.c:57
model_s::surfaces
msurface_t * surfaces
Definition: r_model.h:221
swwstate_t::wndproc
void * wndproc
Definition: rw_win.h:29
Com_PageInMemory
void Com_PageInMemory(byte *buffer, int size)
Definition: q_shared.c:1161
medge_t::v
unsigned short v[2]
Definition: r_model.h:79
CVAR_USERINFO
#define CVAR_USERINFO
Definition: q_shared.h:317
r_lefthand
cvar_t * r_lefthand
Definition: r_main.c:117
z
static float z
Definition: r_scan.c:31
db_time1
float db_time1
Definition: r_local.h:784
world_transformed_modelorg
vec3_t world_transformed_modelorg
Definition: r_edge.c:745
vec5_t
vec_t vec5_t[5]
Definition: q_shared.h:135
r_drawworld
cvar_t * r_drawworld
Definition: r_main.c:134
r_nearzi
float r_nearzi
Definition: r_rast.c:61
VectorMA
void VectorMA(vec3_t veca, float scale, vec3_t vecb, vec3_t vecc)
Definition: q_shared.c:719
mod_alias
@ mod_alias
Definition: r_model.h:169
local
static vec3_t local
Definition: r_part.c:468
d_zwidth
unsigned int d_zwidth
Definition: r_local.h:538
SURF_DRAWBACKGROUND
#define SURF_DRAWBACKGROUND
Definition: r_model.h:71
d_vrectright_particle
int d_vrectright_particle
Definition: r_local.h:532
sw_waterwarp
cvar_t * sw_waterwarp
Definition: r_main.c:130
pcx_t::manufacturer
char manufacturer
Definition: qfiles.h:62
NEAR_CLIP
#define NEAR_CLIP
Definition: asm_draw.h:13
MAX_SKINNAME
#define MAX_SKINNAME
Definition: qfiles.h:93
r_dlightframecount
int r_dlightframecount
Definition: r_light.c:24
r_lastvertvalid
qboolean r_lastvertvalid
Definition: r_rast.c:65
r_leftenter
mvertex_t r_leftenter
Definition: r_rast.c:51
particle_t::color
int color
Definition: ref.h:92
partparms
static partparms_t partparms
Definition: r_part.c:35
aliastriangleparms_t::c
finalvert_t * c
Definition: r_local.h:772
R_ImageList_f
void R_ImageList_f(void)
Definition: r_image.c:34
msurface_s
Definition: r_model.h:93
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
max_span_p
espan_t * max_span_p
Definition: r_edge.c:60
sw_aliasstats
cvar_t * sw_aliasstats
Definition: r_main.c:118
swwstate_t::hdcDIBSection
HDC hdcDIBSection
Definition: rw_win.h:33
dmdl_t::ofs_skins
int ofs_skins
Definition: qfiles.h:153
d_sdivzstepu
float d_sdivzstepu
Definition: r_main.c:188
R_TransformFrustum
void R_TransformFrustum(void)
Definition: r_misc.c:187
blendparticle
static byte(* blendparticle)(int, int)
Definition: r_part.c:473
blockdivmask
unsigned blockdivmask
Definition: r_surf.c:29
mplane_s
Definition: r_model.h:57
pcx_t::vres
unsigned short vres
Definition: qfiles.h:67
sw_mipscale
cvar_t * sw_mipscale
Definition: r_misc.c:27
dsprframe_t
Definition: qfiles.h:174
mtexinfo_s::flags
int flags
Definition: r_model.h:88
R_TransformFrustum
void R_TransformFrustum(void)
Definition: r_misc.c:187
db_time2
float db_time2
Definition: r_local.h:784
R_EdgeCodeEnd
void R_EdgeCodeEnd(void)
oldrefdef_t::vrect_x_adj_shift20
int vrect_x_adj_shift20
Definition: r_local.h:127
sw_maxsurfs
cvar_t * sw_maxsurfs
Definition: r_main.c:124
refdef_t::dlights
dlight_t * dlights
Definition: ref.h:120
d_minmip
int d_minmip
Definition: r_misc.c:31
surfcache_s::dlight
int dlight
Definition: r_local.h:394
r_turb_sstep
static fixed16_t r_turb_sstep
Definition: r_scan.c:37
refdef_t::width
int width
Definition: ref.h:104
R_AliasSetupLighting
void R_AliasSetupLighting(void)
Definition: r_alias.c:884
r_warpwidth
int r_warpwidth
Definition: r_main.c:46
DWORD
DWORD
Definition: qgl_win.c:49
DPS_MAXSPANS
#define DPS_MAXSPANS
Definition: r_polyse.c:35
msurface_s::texturemins
short texturemins[2]
Definition: r_model.h:109
ri
refimport_t ri
Definition: r_main.c:25
BlendParticle100
static byte BlendParticle100(int pcolor, int dstcolor)
Definition: r_part.c:448
R_DrawParticle
void R_DrawParticle(void)
Definition: r_part.c:475
R_PrintDSpeeds
void R_PrintDSpeeds(void)
Definition: r_misc.c:151
spancount
static int spancount
Definition: r_scan.c:28
R_PolysetSetEdgeTable
void R_PolysetSetEdgeTable(void)
Definition: r_polyse.c:1711
clipplane_s::dist
float dist
Definition: r_local.h:381
R_DrawAlphaSurfaces
void R_DrawAlphaSurfaces(void)
Definition: r_poly.c:1342
Draw_FindPic
image_t * Draw_FindPic(char *name)
Definition: r_draw.c:37
RF_SHELL_BLUE
#define RF_SHELL_BLUE
Definition: q_shared.h:611
lightstyle_t::white
float white
Definition: ref.h:99
skintable
byte * skintable[MAX_LBM_HEIGHT]
Definition: r_polyse.c:126
R_ClipAndDrawPoly
void R_ClipAndDrawPoly(float alpha, qboolean isturbulent, qboolean textured)
s_ziscale
static float s_ziscale
Definition: r_alias.c:58
dsprframe_t::origin_x
int origin_x
Definition: qfiles.h:177
count
static int count
Definition: r_part.c:472
i
static int i
Definition: r_part.c:472
w
GLdouble GLdouble GLdouble w
Definition: qgl_win.c:291
r_skyplanes
mplane_t r_skyplanes[6]
Definition: r_rast.c:69
right
GLdouble right
Definition: qgl_win.c:159
registration_sequence
int registration_sequence
Definition: r_model.c:44
r_lightsaturation
cvar_t * r_lightsaturation
Definition: r_main.c:155
edge_head_u_shift20
int edge_head_u_shift20
Definition: r_edge.c:66
refimport_t::Cvar_SetValue
void(* Cvar_SetValue)(char *name, float value)
Definition: ref.h:218
image_s
Definition: r_local.h:71
r_aliasblendcolor
int r_aliasblendcolor
Definition: r_alias.c:47
sw_state
swstate_t sw_state
Definition: r_main.c:49
refdef_t::viewangles
float viewangles[3]
Definition: ref.h:107
d_sdivzstepv
float d_sdivzstepv
Definition: r_main.c:189
Sys_Milliseconds
int Sys_Milliseconds(void)
Definition: q_shwin.c:120
refdef_t::x
int x
Definition: ref.h:104
vrect_s
Definition: vid.h:22
r_entorigin
vec3_t r_entorigin
Definition: r_bsp.c:31
mode
GLenum mode
Definition: qgl_win.c:113
BlendParticle66
static byte BlendParticle66(int pcolor, int dstcolor)
Definition: r_part.c:443
sww_state
swwstate_t sww_state
Definition: rw_imp.c:38
sw_clearcolor
cvar_t * sw_clearcolor
Definition: r_main.c:120
pbase
static byte * pbase
Definition: r_scan.c:29
Mod_Free
void Mod_Free(model_t *mod)
Definition: r_model.c:1313
R_MarkLeaves
void R_MarkLeaves(void)
Definition: r_main.c:467
YCENTERING
#define YCENTERING
Definition: r_local.h:224
swwstate_t::hWnd
HWND hWnd
Definition: rw_win.h:31
cacheblock
pixel_t * cacheblock
Definition: r_main.c:194
viddef_t::colormap
pixel_t * colormap
Definition: r_local.h:95
pcx_t::xmax
unsigned short xmax
Definition: qfiles.h:66
swwstate_t::hDC
HDC hDC
Definition: rw_win.h:30
mask
GLint GLuint mask
Definition: qgl_win.c:317
d_pzbuffer
short * d_pzbuffer
Definition: r_main.c:197
r_polyblendcolor
static int r_polyblendcolor
Definition: r_poly.c:40
SURFCACHE_SIZE_AT_320X240
#define SURFCACHE_SIZE_AT_320X240
Definition: r_local.h:218
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
model_s::vertexes
mvertex_t * vertexes
Definition: r_model.h:208
tadjust
fixed16_t tadjust
Definition: r_local.h:521
r_ppn
vec3_t r_ppn
Definition: r_part.c:22
surfcache_s::next
struct surfcache_s * next
Definition: r_local.h:391
STRINGER
#define STRINGER(x)
Definition: r_main.c:158
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
r_outofsurfaces
int r_outofsurfaces
Definition: r_main.c:57
msurface_s::nextalphasurface
struct msurface_s * nextalphasurface
Definition: r_model.h:118
izi
static int izi
Definition: r_scan.c:33
xcenter
float xcenter
Definition: r_main.c:81
Mod_Modellist_f
void Mod_Modellist_f(void)
Definition: r_model.c:55
viddef_t::alphamap
pixel_t * alphamap
Definition: r_local.h:96
r_drawsurf
drawsurf_t r_drawsurf
Definition: r_surf.c:24
R_BeginFrame
void R_BeginFrame(float camera_separation)
Definition: r_main.c:1177
sw_state
swstate_t sw_state
Definition: r_main.c:49
vpn
vec3_t vpn
Definition: r_main.c:73
r_source
unsigned char * r_source
Definition: r_surf.c:38
rserr_invalid_fullscreen
@ rserr_invalid_fullscreen
Definition: r_local.h:107
loadmodel
model_t * loadmodel
Definition: r_model.c:27
aliastriangleparms
aliastriangleparms_t aliastriangleparms
Definition: r_polyse.c:62
entity_s::oldorigin
float oldorigin[3]
Definition: ref.h:63
dlight_t::intensity
float intensity
Definition: ref.h:86
TRANSPARENT_COLOR
#define TRANSPARENT_COLOR
Definition: asm_i386.h:78
oldrefdef_t::aliasvrect
vrect_t aliasvrect
Definition: r_local.h:120
BBOX_TRIVIAL_REJECT
#define BBOX_TRIVIAL_REJECT
Definition: r_alias.c:87
R_SetupFrame
void R_SetupFrame(void)
Definition: r_misc.c:426
drawsurf_t::surfwidth
int surfwidth
Definition: r_local.h:350
d_scantable
int d_scantable[MAXHEIGHT]
Definition: r_misc.c:42
box_edges
int box_edges[24]
Definition: r_rast.c:80
r_turb_spancount
static int r_turb_spancount
Definition: r_scan.c:38
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
draw_chars
image_t * draw_chars
Definition: r_draw.c:26
Com_sprintf
void Com_sprintf(char *dest, int size, char *fmt,...)
Definition: q_shared.c:1223
surf_s
Definition: r_local.h:428
r_pcurrentvertbase
mvertex_t * r_pcurrentvertbase
Definition: r_main.c:62
surfaces
surf_t * surfaces
Definition: r_edge.c:51
r_outofedges
int r_outofedges
Definition: r_main.c:58
finalvert_s::l
int l
Definition: r_local.h:294
yscale
float yscale
Definition: r_local.h:575
dmdl_t
Definition: qfiles.h:137
entity_s::angles
float angles[3]
Definition: ref.h:52
PARTICLE_33
#define PARTICLE_33
Definition: r_part.c:24
zi
static float zi
Definition: r_part.c:469
LoadPCX
void LoadPCX(char *filename, byte **pic, byte **palette, int *width, int *height)
Definition: r_image.c:87
r_fullbright
cvar_t * r_fullbright
Definition: r_main.c:137
r_refdef
oldrefdef_t r_refdef
Definition: r_main.c:80
void
void(APIENTRY *qglAccum)(GLenum op
oldrefdef_t::vrectbottom
int vrectbottom
Definition: r_local.h:121
RotatePointAroundVector
void RotatePointAroundVector(vec3_t dst, const vec3_t dir, const vec3_t point, float degrees)
Definition: q_shared.c:32
blanktable
int blanktable[4200]
Definition: r_rast.c:49
dmdl_t::num_frames
int num_frames
Definition: qfiles.h:151
polydesc_t::vright
vec3_t vright
Definition: r_local.h:418
view_clipplanes
clipplane_t view_clipplanes[4]
Definition: r_rast.c:38
msurface_s::firstedge
int firstedge
Definition: r_model.h:103
dp_time2
float dp_time2
Definition: r_local.h:784
SURF_SKY
#define SURF_SKY
Definition: qfiles.h:371
izi
static int izi
Definition: r_part.c:472
sc_size
int sc_size
Definition: r_surf.c:112
da_time2
float da_time2
Definition: r_main.c:112
edge_s
Definition: r_local.h:450
surf_s::spanstate
int spanstate
Definition: r_local.h:435
r_customwidth
cvar_t * r_customwidth
Definition: r_main.c:151
pcx_t::bytes_per_line
unsigned short bytes_per_line
Definition: qfiles.h:71
model_s::extradatasize
int extradatasize
Definition: r_model.h:236
s_pmdl
dmdl_t * s_pmdl
Definition: r_alias.c:52
affinetridesc_t::pskin
void * pskin
Definition: r_local.h:328
model_s::numsurfaces
int numsurfaces
Definition: r_model.h:220
vrect_s::y
int y
Definition: vid.h:24
skybox_planes
int skybox_planes[12]
Definition: r_rast.c:76
ALIAS_RIGHT_CLIP
#define ALIAS_RIGHT_CLIP
Definition: r_local.h:213
it_sky
@ it_sky
Definition: r_local.h:68
vid
viddef_t vid
Definition: r_main.c:24