Quake II RTX doxygen
1.0 dev
|
|
#include "shared/shared.h"
#include "common/bsp.h"
#include "common/cmd.h"
#include "common/common.h"
#include "common/cvar.h"
#include "common/files.h"
#include "common/math.h"
#include "client/video.h"
#include "client/client.h"
#include "refresh/refresh.h"
#include "refresh/images.h"
#include "refresh/models.h"
#include "system/hunk.h"
#include "qgl/dynamic.h"
Go to the source code of this file.
|
enum | glCullResult_t { CULL_OUT,
CULL_IN,
CULL_CLIP
} |
|
enum | glStateBits_t {
GLS_DEFAULT = 0,
GLS_DEPTHMASK_FALSE = (1 << 0),
GLS_DEPTHTEST_DISABLE = (1 << 1),
GLS_BLEND_BLEND = (1 << 2),
GLS_BLEND_ADD = (1 << 3),
GLS_BLEND_MODULATE = (1 << 4),
GLS_ALPHATEST_ENABLE = (1 << 5),
GLS_TEXTURE_REPLACE = (1 << 6),
GLS_FLOW_ENABLE = (1 << 7),
GLS_LIGHTMAP_ENABLE = (1 << 8),
GLS_WARP_ENABLE = (1 << 9),
GLS_CULL_DISABLE = (1 << 10),
GLS_SHADE_SMOOTH = (1 << 11)
} |
|
enum | glArrayBits_t {
GLA_NONE = 0,
GLA_VERTEX = (1 << 0),
GLA_TC = (1 << 1),
GLA_LMTC = (1 << 2),
GLA_COLOR = (1 << 3)
} |
|
|
glCullResult_t | GL_CullBox (vec3_t bounds[2]) |
|
glCullResult_t | GL_CullSphere (const vec3_t origin, float radius) |
|
glCullResult_t | GL_CullLocalBox (const vec3_t origin, vec3_t bounds[2]) |
|
qboolean | GL_AllocBlock (int width, int height, int *inuse, int w, int h, int *s, int *t) |
|
void | GL_MultMatrix (GLfloat *out, const GLfloat *a, const GLfloat *b) |
|
void | GL_RotateForEntity (vec3_t origin, float scale) |
|
void | QGL_ClearErrors (void) |
|
qboolean | GL_ShowErrors (const char *func) |
|
void | GL_AdjustColor (vec3_t color) |
|
void | GL_PushLights (mface_t *surf) |
|
void | GL_RebuildLighting (void) |
|
void | GL_FreeWorld (void) |
|
void | GL_LoadWorld (const char *name) |
|
static void | GL_ActiveTexture (GLuint tmu) |
|
static void | GL_ClientActiveTexture (GLuint tmu) |
|
static void | GL_VertexPointer (GLint size, GLsizei stride, const GLfloat *pointer) |
|
static void | GL_TexCoordPointer (GLint size, GLsizei stride, const GLfloat *pointer) |
|
static void | GL_LightCoordPointer (GLint size, GLsizei stride, const GLfloat *pointer) |
|
static void | GL_ColorBytePointer (GLint size, GLsizei stride, const GLubyte *pointer) |
|
static void | GL_ColorFloatPointer (GLint size, GLsizei stride, const GLfloat *pointer) |
|
static void | GL_LockArrays (GLsizei count) |
|
static void | GL_UnlockArrays (void) |
|
static void | GL_LoadMatrix (const GLfloat *matrix) |
|
void | GL_ForceTexture (GLuint tmu, GLuint texnum) |
|
void | GL_BindTexture (GLuint tmu, GLuint texnum) |
|
void | GL_StateBits (glStateBits_t bits) |
|
void | GL_ArrayBits (glArrayBits_t bits) |
|
void | GL_Ortho (GLfloat xmin, GLfloat xmax, GLfloat ymin, GLfloat ymax, GLfloat znear, GLfloat zfar) |
|
void | GL_Setup2D (void) |
|
void | GL_Setup3D (void) |
|
void | GL_SetDefaultState (void) |
|
void | GL_InitPrograms (void) |
|
void | GL_ShutdownPrograms (void) |
|
void | GL_EnableOutlines (void) |
|
void | GL_DisableOutlines (void) |
|
void | GL_Blend (void) |
|
void | R_ClearColor_GL (void) |
|
void | R_SetAlpha_GL (float alpha) |
|
void | R_SetAlphaScale_GL (float alpha) |
|
void | R_SetColor_GL (uint32_t color) |
|
void | R_SetClipRect_GL (const clipRect_t *clip) |
|
float | R_ClampScaleGL (cvar_t *var) |
|
void | R_SetScale_GL (float scale) |
|
void | R_DrawStretchPic_GL (int x, int y, int w, int h, qhandle_t pic) |
|
void | R_DrawPic_GL (int x, int y, qhandle_t pic) |
|
void | R_TileClear_GL (int x, int y, int w, int h, qhandle_t pic) |
|
void | R_DrawFill8_GL (int x, int y, int w, int h, int c) |
|
void | R_DrawFill32_GL (int x, int y, int w, int h, uint32_t color) |
|
void | R_DrawChar_GL (int x, int y, int flags, int c, qhandle_t font) |
|
int | R_DrawString_GL (int x, int y, int flags, size_t maxlen, const char *s, qhandle_t font) |
|
void | Scrap_Upload (void) |
|
void | GL_InitImages (void) |
|
void | GL_ShutdownImages (void) |
|
void | IMG_Load_GL (image_t *image, byte *pic) |
|
void | IMG_Unload_GL (image_t *image) |
|
byte * | IMG_ReadPixels_GL (int *width, int *height, int *rowbytes) |
|
void | GL_Flush2D (void) |
|
void | GL_DrawParticles (void) |
|
void | GL_DrawBeams (void) |
|
void | GL_BindArrays (void) |
|
void | GL_Flush3D (void) |
|
void | GL_DrawFace (mface_t *surf) |
|
void | GL_AddAlphaFace (mface_t *face) |
|
void | GL_AddSolidFace (mface_t *face) |
|
void | GL_DrawAlphaFaces (void) |
|
void | GL_DrawSolidFaces (void) |
|
void | GL_ClearSolidFaces (void) |
|
void | GL_DrawBspModel (mmodel_t *model) |
|
void | GL_DrawWorld (void) |
|
void | GL_SampleLightPoint (vec3_t color) |
|
void | GL_LightPoint (vec3_t origin, vec3_t color) |
|
void | R_LightPoint_GL (vec3_t origin, vec3_t color) |
|
void | R_AddSkySurface (mface_t *surf) |
|
void | R_ClearSkyBox (void) |
|
void | R_DrawSkyBox (void) |
|
void | R_SetSky_GL (const char *name, float rotate, vec3_t axis) |
|
void | GL_DrawAliasModel (model_t *model) |
|
void | HQ2x_Render (uint32_t *output, const uint32_t *input, int width, int height) |
|
void | HQ4x_Render (uint32_t *output, const uint32_t *input, int width, int height) |
|
void | HQ2x_Init (void) |
|
qerror_t | MOD_LoadMD2_GL (model_t *model, const void *rawdata, size_t length) |
|
qerror_t | MOD_LoadMD3_GL (model_t *model, const void *rawdata, size_t length) |
|
void | MOD_Reference_GL (model_t *model) |
|
◆ AT_LEAST_OPENGL
#define AT_LEAST_OPENGL |
( |
|
major, |
|
|
|
minor |
|
) |
| (!gl_config.es_profile && AT_LEAST_OPENGL_ANY(major, minor)) |
Definition at line 121 of file gl.h.
◆ AT_LEAST_OPENGL_ANY
#define AT_LEAST_OPENGL_ANY |
( |
|
major, |
|
|
|
minor |
|
) |
| (gl_config.version_major > major || (gl_config.version_major == major && gl_config.version_minor >= minor)) |
Definition at line 118 of file gl.h.
◆ AT_LEAST_OPENGL_ES
#define AT_LEAST_OPENGL_ES |
( |
|
major, |
|
|
|
minor |
|
) |
| (gl_config.es_profile && AT_LEAST_OPENGL_ANY(major, minor)) |
Definition at line 124 of file gl.h.
◆ GLS_BLEND_MASK
Definition at line 297 of file gl.h.
◆ LIGHT_STYLE
#define LIGHT_STYLE |
( |
|
surf, |
|
|
|
i |
|
) |
| &glr.fd.lightstyles[gl_static.lightstylemap[(surf)->styles[i]]] |
Definition at line 251 of file gl.h.
◆ LM_BLOCK_HEIGHT
#define LM_BLOCK_HEIGHT 256 |
Definition at line 256 of file gl.h.
◆ LM_BLOCK_WIDTH
#define LM_BLOCK_WIDTH 256 |
Definition at line 255 of file gl.h.
◆ LM_MAX_LIGHTMAPS
#define LM_MAX_LIGHTMAPS 32 |
Definition at line 254 of file gl.h.
◆ MAX_TMUS
Definition at line 52 of file gl.h.
◆ NUM_TEXNUMS
Definition at line 57 of file gl.h.
◆ QGL_INDEX_ENUM
#define QGL_INDEX_ENUM GL_UNSIGNED_INT |
Definition at line 49 of file gl.h.
◆ QGL_INDEX_TYPE
#define QGL_INDEX_TYPE GLuint |
Definition at line 48 of file gl.h.
◆ TAB_COS
#define TAB_COS |
( |
|
x | ) |
gl_static.sintab[((x) + 64) & 255] |
Definition at line 55 of file gl.h.
◆ TAB_SIN
#define TAB_SIN |
( |
|
x | ) |
gl_static.sintab[(x) & 255] |
Definition at line 54 of file gl.h.
◆ TESS_MAX_INDICES
Definition at line 460 of file gl.h.
◆ TESS_MAX_VERTICES
#define TESS_MAX_VERTICES 4096 |
Definition at line 459 of file gl.h.
◆ TEXNUM_BEAM
#define TEXNUM_BEAM gl_static.texnums[3] |
Definition at line 442 of file gl.h.
◆ TEXNUM_BLACK
#define TEXNUM_BLACK gl_static.texnums[5] |
Definition at line 444 of file gl.h.
◆ TEXNUM_DEFAULT
#define TEXNUM_DEFAULT gl_static.texnums[0] |
Definition at line 439 of file gl.h.
◆ TEXNUM_PARTICLE
#define TEXNUM_PARTICLE gl_static.texnums[2] |
Definition at line 441 of file gl.h.
◆ TEXNUM_SCRAP
#define TEXNUM_SCRAP gl_static.texnums[1] |
Definition at line 440 of file gl.h.
◆ TEXNUM_WHITE
#define TEXNUM_WHITE gl_static.texnums[4] |
Definition at line 443 of file gl.h.
◆ VERTEX_SIZE
Definition at line 245 of file gl.h.
◆ maliasframe_t
◆ maliasmesh_t
◆ maliastc_t
◆ maliasvert_t
◆ glArrayBits_t
Enumerator |
---|
GLA_NONE | |
GLA_VERTEX | |
GLA_TC | |
GLA_LMTC | |
GLA_COLOR | |
Definition at line 299 of file gl.h.
◆ glCullResult_t
Enumerator |
---|
CULL_OUT | |
CULL_IN | |
CULL_CLIP | |
Definition at line 190 of file gl.h.
◆ glStateBits_t
Enumerator |
---|
GLS_DEFAULT | |
GLS_DEPTHMASK_FALSE | |
GLS_DEPTHTEST_DISABLE | |
GLS_BLEND_BLEND | |
GLS_BLEND_ADD | |
GLS_BLEND_MODULATE | |
GLS_ALPHATEST_ENABLE | |
GLS_TEXTURE_REPLACE | |
GLS_FLOW_ENABLE | |
GLS_LIGHTMAP_ENABLE | |
GLS_WARP_ENABLE | |
GLS_CULL_DISABLE | |
GLS_SHADE_SMOOTH | |
Definition at line 281 of file gl.h.
◆ GL_ActiveTexture()
static void GL_ActiveTexture |
( |
GLuint |
tmu | ) |
|
|
inlinestatic |
◆ GL_AddAlphaFace()
void GL_AddAlphaFace |
( |
mface_t * |
face | ) |
|
◆ GL_AddSolidFace()
void GL_AddSolidFace |
( |
mface_t * |
face | ) |
|
Definition at line 462 of file tess.c.
466 hash = face->texnum[0] ^ face->texnum[1] ^ face->statebits;
Referenced by GL_DrawNode().
◆ GL_AdjustColor()
void GL_AdjustColor |
( |
vec3_t |
color | ) |
|
◆ GL_AllocBlock()
Definition at line 252 of file main.c.
255 int i, j, k, x, y, max_inuse, min_inuse;
259 for (i = 0; i <
width - w; i++) {
261 for (j = 0; j < w; j++) {
263 if (k >= min_inuse) {
272 y = min_inuse = max_inuse;
280 for (i = 0; i < w; i++) {
281 inuse[x + i] = y + h;
◆ GL_ArrayBits()
◆ GL_BindArrays()
◆ GL_BindTexture()
void GL_BindTexture |
( |
GLuint |
tmu, |
|
|
GLuint |
texnum |
|
) |
| |
◆ GL_Blend()
◆ GL_ClearSolidFaces()
◆ GL_ClientActiveTexture()
static void GL_ClientActiveTexture |
( |
GLuint |
tmu | ) |
|
|
inlinestatic |
◆ GL_ColorBytePointer()
static void GL_ColorBytePointer |
( |
GLint |
size, |
|
|
GLsizei |
stride, |
|
|
const GLubyte * |
pointer |
|
) |
| |
|
inlinestatic |
◆ GL_ColorFloatPointer()
static void GL_ColorFloatPointer |
( |
GLint |
size, |
|
|
GLsizei |
stride, |
|
|
const GLfloat * |
pointer |
|
) |
| |
|
inlinestatic |
◆ GL_CullBox()
◆ GL_CullLocalBox()
glCullResult_t GL_CullLocalBox |
( |
const vec3_t |
origin, |
|
|
vec3_t |
bounds[2] |
|
) |
| |
◆ GL_CullSphere()
◆ GL_DisableOutlines()
◆ GL_DrawAliasModel()
void GL_DrawAliasModel |
( |
model_t * |
model | ) |
|
Definition at line 623 of file mesh.c.
630 if (newframenum < 0 || newframenum >= model->numframes) {
631 Com_DPrintf(
"%s: no such frame %d\n", __func__,
newframenum);
636 if (oldframenum < 0 || oldframenum >= model->numframes) {
637 Com_DPrintf(
"%s: no such oldframe %d\n", __func__,
oldframenum);
649 if (ent->flags & RF_FRAMELERP)
650 LerpVector2(ent->oldorigin, ent->origin,
653 VectorCopy(ent->origin,
origin);
670 if (ent->flags & RF_SHELL_MASK) {
672 WEAPONSHELL_SCALE : POWERSUIT_SCALE;
684 if (ent->scale > 0.f)
689 if ((ent->flags & (RF_WEAPONMODEL | RF_LEFTHAND)) ==
690 (RF_WEAPONMODEL | RF_LEFTHAND)) {
697 if (ent->flags & RF_DEPTHHACK)
701 for (i = 0; i < model->nummeshes; i++)
704 if (ent->flags & RF_DEPTHHACK)
707 if ((ent->flags & (RF_WEAPONMODEL | RF_LEFTHAND)) ==
708 (RF_WEAPONMODEL | RF_LEFTHAND)) {
Referenced by GL_DrawEntities().
◆ GL_DrawAlphaFaces()
◆ GL_DrawBeams()
Definition at line 164 of file tess.c.
191 numverts = numindices = 0;
192 for (i = 0, ent =
glr.
fd.entities; i <
glr.
fd.num_entities; i++, ent++) {
193 if (!(ent->flags & RF_BEAM)) {
198 end = ent->oldorigin;
199 VectorSubtract(end, start, d1);
200 VectorSubtract(
glr.
fd.vieworg, start, d2);
201 CrossProduct(d1, d2, d3);
202 length = VectorLength(d3);
203 length = ent->frame * 1.2f / length;
204 VectorScale(d3, length, d3);
206 length = VectorLength(d1);
208 if (ent->skinnum == -1) {
209 color.u32 = ent->rgba.u32;
212 color.u8[3] = 255 * ent->alpha;
219 numverts = numindices = 0;
223 VectorAdd(start, d3, dst_vert);
224 VectorSubtract(start, d3, dst_vert + 5);
225 VectorSubtract(end, d3, dst_vert + 10);
226 VectorAdd(end, d3, dst_vert + 15);
228 dst_vert[3] = 0; dst_vert[4] = 0;
229 dst_vert[8] = 1; dst_vert[9] = 0;
230 dst_vert[13] = 1; dst_vert[14] = length;
231 dst_vert[18] = 0; dst_vert[19] = length;
233 dst_color = (uint32_t *)
tess.
colors + numverts;
234 dst_color[0] =
color.u32;
235 dst_color[1] =
color.u32;
236 dst_color[2] =
color.u32;
237 dst_color[3] =
color.u32;
240 dst_indices[0] = numverts + 0;
241 dst_indices[1] = numverts + 2;
242 dst_indices[2] = numverts + 3;
243 dst_indices[3] = numverts + 0;
244 dst_indices[4] = numverts + 1;
245 dst_indices[5] = numverts + 2;
Referenced by R_RenderFrame_GL().
◆ GL_DrawBspModel()
void GL_DrawBspModel |
( |
mmodel_t * |
model | ) |
|
Definition at line 358 of file world.c.
360 mface_t *face, *last;
363 vec3_t transformed, temp;
367 if (!model->numfaces)
377 VectorCopy(model->mins, bounds[0]);
378 VectorCopy(model->maxs, bounds[1]);
385 VectorSubtract(
glr.
fd.vieworg, ent->origin, temp);
386 transformed[0] = DotProduct(temp,
glr.
entaxis[0]);
387 transformed[1] = DotProduct(temp,
glr.
entaxis[1]);
388 transformed[2] = DotProduct(temp,
glr.
entaxis[2]);
390 VectorAdd(model->mins, ent->origin, bounds[0]);
391 VectorAdd(model->maxs, ent->origin, bounds[1]);
397 VectorSubtract(
glr.
fd.vieworg, ent->origin, transformed);
407 last = model->firstface + model->numfaces;
408 for (face = model->firstface; face < last; face++) {
409 dot = PlaneDiffFast(transformed, face->plane);
416 if (face->drawflags & SURF_SKY) {
423 if (face->drawflags & SURF_TRANS_MASK) {
Referenced by GL_DrawEntities().
◆ GL_DrawFace()
void GL_DrawFace |
( |
mface_t * |
surf | ) |
|
Definition at line 367 of file tess.c.
369 int numtris = surf->numsurfedges - 2;
370 int numindices = numtris * 3;
376 texnum[0] = surf->texnum[1];
382 texnum[1] = surf->texnum[1];
403 for (i = 0; i < numtris; i++) {
405 dst_indices[1] = j + (i + 1);
406 dst_indices[2] = j + (i + 2);
Referenced by GL_DrawBspModel(), GL_DrawChain(), and GL_DrawNode().
◆ GL_DrawParticles()
Definition at line 79 of file tess.c.
91 if (!
glr.
fd.num_particles)
105 p =
glr.
fd.particles;
106 total =
glr.
fd.num_particles;
120 VectorSubtract(p->origin,
glr.
fd.vieworg, transformed);
125 scale += dist * 0.01f;
127 if (p->color == -1) {
128 color.u32 = p->rgba.u32;
131 color.u8[3] = 255 * p->alpha;
137 VectorMA(dst_vert, scale,
glr.
viewaxis[2], dst_vert + 5);
138 VectorMA(dst_vert, -scale,
glr.
viewaxis[1], dst_vert + 10);
140 dst_vert[ 3] = 0; dst_vert[ 4] = 0;
144 dst_color = (uint32_t *)
tess.
colors + numverts;
145 dst_color[0] =
color.u32;
146 dst_color[1] =
color.u32;
147 dst_color[2] =
color.u32;
Referenced by R_RenderFrame_GL().
◆ GL_DrawSolidFaces()
◆ GL_DrawWorld()
◆ GL_EnableOutlines()
◆ GL_Flush2D()
◆ GL_Flush3D()
◆ GL_ForceTexture()
void GL_ForceTexture |
( |
GLuint |
tmu, |
|
|
GLuint |
texnum |
|
) |
| |
Definition at line 25 of file state.c.
Referenced by gl_anisotropy_changed(), gl_bilerp_chars_changed(), gl_bilerp_pics_changed(), GL_InitBeamTexture(), GL_InitDefaultTexture(), GL_InitParticleTexture(), GL_InitWhiteImage(), gl_texturemode_changed(), IMG_Load_GL(), LM_RebuildSurfaces(), LM_UploadBlock(), Scrap_Upload(), and update_dynamic_lightmap().
◆ GL_FreeWorld()
◆ GL_InitImages()
◆ GL_InitPrograms()
Definition at line 477 of file state.c.
479 #ifdef GL_ARB_fragment_program
484 Com_Printf(
"...enabling GL_ARB_fragment_program\n");
488 Com_Printf(
"...ignoring GL_ARB_fragment_program\n");
491 Com_Printf(
"GL_ARB_fragment_program not found\n");
492 Cvar_Set(
"gl_fragment_program",
"0");
507 if (
GL_ShowErrors(
"Failed to initialize fragment program")) {
Referenced by R_EndFrame_GL(), and R_Init_GL().
◆ GL_LightCoordPointer()
static void GL_LightCoordPointer |
( |
GLint |
size, |
|
|
GLsizei |
stride, |
|
|
const GLfloat * |
pointer |
|
) |
| |
|
inlinestatic |
◆ GL_LightPoint()
void GL_LightPoint |
( |
vec3_t |
origin, |
|
|
vec3_t |
color |
|
) |
| |
◆ GL_LoadMatrix()
void GL_LoadMatrix |
( |
const GLfloat * |
matrix | ) |
|
|
inlinestatic |
◆ GL_LoadWorld()
void GL_LoadWorld |
( |
const char * |
name | ) |
|
Definition at line 876 of file surf.c.
878 char buffer[MAX_QPATH];
889 Com_Error(ERR_DROP,
"%s: couldn't load %s: %s",
895 for (i = 0; i < bsp->numtexinfo; i++) {
898 for (i = 0; i < bsp->numnodes; i++) {
899 bsp->nodes[i].visframe = 0;
901 for (i = 0; i < bsp->numleafs; i++) {
902 bsp->leafs[i].visframe = 0;
904 Com_DPrintf(
"%s: reused old world model\n", __func__);
918 for (i = 0, info = bsp->texinfo; i < bsp->numtexinfo; i++, info++) {
919 if (info->c.flags & SURF_WARP)
920 flags = IF_TURBULENT;
924 Q_concat(buffer,
sizeof(buffer),
"textures/", info->name,
".wal", NULL);
926 info->image =
IMG_Find(buffer, IT_WALL, flags);
931 for (i = 0, surf = bsp->faces; i < bsp->numfaces; i++, surf++) {
933 surf->drawflags |= surf->texinfo->c.flags & ~DSURF_PLANEBACK;
936 if (surf->drawflags & SURF_SKY)
939 size += surf->numsurfedges *
VERTEX_SIZE *
sizeof(vec_t);
944 Com_DPrintf(
"%s: %"PRIz
" bytes of vertex data as VBO\n", __func__, size);
950 Com_DPrintf(
"%s: %"PRIz
" bytes of vertex data on hunk\n", __func__, size);
Referenced by R_BeginRegistration_GL().
◆ GL_LockArrays()
static void GL_LockArrays |
( |
GLsizei |
count | ) |
|
|
inlinestatic |
◆ GL_MultMatrix()
void GL_MultMatrix |
( |
GLfloat * |
out, |
|
|
const GLfloat * |
a, |
|
|
const GLfloat * |
b |
|
) |
| |
Definition at line 290 of file main.c.
294 for (i = 0; i < 4; i++) {
295 for (j = 0; j < 4; j++) {
297 a[0 * 4 + j] * b[i * 4 + 0] +
298 a[1 * 4 + j] * b[i * 4 + 1] +
299 a[2 * 4 + j] * b[i * 4 + 2] +
300 a[3 * 4 + j] * b[i * 4 + 3];
Referenced by GL_RotateForEntity(), and setup_shadow().
◆ GL_Ortho()
void GL_Ortho |
( |
GLfloat |
xmin, |
|
|
GLfloat |
xmax, |
|
|
GLfloat |
ymin, |
|
|
GLfloat |
ymax, |
|
|
GLfloat |
znear, |
|
|
GLfloat |
zfar |
|
) |
| |
Definition at line 230 of file state.c.
237 depth = zfar - znear;
239 matrix[0] = 2 /
width;
242 matrix[12] = -(xmax + xmin) /
width;
247 matrix[13] = -(ymax + ymin) /
height;
251 matrix[10] = -2 / depth;
252 matrix[14] = -(zfar + znear) / depth;
Referenced by GL_Setup2D(), and R_SetScale_GL().
◆ GL_PushLights()
void GL_PushLights |
( |
mface_t * |
surf | ) |
|
Definition at line 271 of file surf.c.
276 if (!surf->lightmap) {
279 if (surf->drawflags & SURF_NOLM_MASK) {
282 if (!surf->texnum[1]) {
288 if (surf->dlightframe) {
295 for (i = 0; i < surf->numstyles; i++) {
297 if (style->white != surf->stylecache[i]) {
Referenced by GL_DrawBspModel(), and GL_DrawNode().
◆ GL_RebuildLighting()
◆ GL_RotateForEntity()
void GL_RotateForEntity |
( |
vec3_t |
origin, |
|
|
float |
scale |
|
) |
| |
◆ GL_SampleLightPoint()
void GL_SampleLightPoint |
( |
vec3_t |
color | ) |
|
Definition at line 21 of file world.c.
26 byte *b1, *b2, *b3, *b4;
37 w1 = (16 - fracu) * (16 - fracv);
38 w2 = fracu * (16 - fracv);
40 w4 = (16 - fracu) * fracv;
49 size = smax * tmax * 3;
54 lightmap = surf->lightmap;
55 for (i = 0; i < surf->numstyles; i++) {
56 b1 = &lightmap[3 * ((t + 0) * smax + (s + 0))];
57 b2 = &lightmap[3 * ((t + 0) * smax + (s + 1))];
58 b3 = &lightmap[3 * ((t + 1) * smax + (s + 1))];
59 b4 = &lightmap[3 * ((t + 1) * smax + (s + 0))];
61 temp[0] = (w1 * b1[0] + w2 * b2[0] + w3 * b3[0] + w4 * b4[0]) >> 8;
62 temp[1] = (w1 * b1[1] + w2 * b2[1] + w3 * b3[1] + w4 * b4[1]) >> 8;
63 temp[2] = (w1 * b1[2] + w2 * b2[2] + w3 * b3[2] + w4 * b4[2]) >> 8;
67 color[0] += temp[0] * style->rgb[0];
68 color[1] += temp[1] * style->rgb[1];
69 color[2] += temp[2] * style->rgb[2];
Referenced by _GL_LightPoint(), and sample_surface_verts().
◆ GL_SetDefaultState()
◆ GL_Setup2D()
◆ GL_Setup3D()
◆ GL_ShowErrors()
qboolean GL_ShowErrors |
( |
const char * |
func | ) |
|
◆ GL_ShutdownImages()
◆ GL_ShutdownPrograms()
◆ GL_StateBits()
Definition at line 60 of file state.c.
110 qglTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
112 qglTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
121 float scaled, scroll;
124 scaled =
glr.
fd.time * 0.5f;
127 scaled =
glr.
fd.time / 40;
128 scroll = -64 * (scaled - (
int)scaled);
148 #ifdef GL_ARB_fragment_program
155 param[0] =
glr.
fd.time;
156 param[1] =
glr.
fd.time;
157 param[2] = param[3] = 0;
Referenced by draw_alias_mesh(), draw_celshading(), draw_shadow(), GL_DrawBeams(), GL_DrawNullModel(), GL_DrawParticles(), GL_EnableOutlines(), GL_Flush2D(), GL_Flush3D(), GL_Setup3D(), and R_DrawSkyBox().
◆ GL_TexCoordPointer()
static void GL_TexCoordPointer |
( |
GLint |
size, |
|
|
GLsizei |
stride, |
|
|
const GLfloat * |
pointer |
|
) |
| |
|
inlinestatic |
◆ GL_UnlockArrays()
◆ GL_VertexPointer()
static void GL_VertexPointer |
( |
GLint |
size, |
|
|
GLsizei |
stride, |
|
|
const GLfloat * |
pointer |
|
) |
| |
|
inlinestatic |
◆ HQ2x_Init()
Definition at line 459 of file hq2x.c.
463 cvar_t *hqx_y =
Cvar_Get(
"hqx_y",
"48", CVAR_FILES);
464 cvar_t *hqx_cb =
Cvar_Get(
"hqx_cb",
"7", CVAR_FILES);
465 cvar_t *hqx_cr =
Cvar_Get(
"hqx_cr",
"6", CVAR_FILES);
471 for (n = 0; n < 256; n++) {
472 rotTable[n] = ((n >> 2) & 0x11) | ((n << 2) & 0x88)
473 | ((n & 0x01) << 5) | ((n & 0x08) << 3)
474 | ((n & 0x10) >> 3) | ((n & 0x80) >> 5);
478 for (n = 0; n < 256; n++) {
Referenced by GL_InitImages().
◆ HQ2x_Render()
void HQ2x_Render |
( |
uint32_t * |
output, |
|
|
const uint32_t * |
input, |
|
|
int |
width, |
|
|
int |
height |
|
) |
| |
Definition at line 357 of file hq2x.c.
361 for (y = 0; y <
height; y++) {
363 uint32_t *out0 = output + (y * 2 + 0) *
width * 2;
364 uint32_t *out1 = output + (y * 2 + 1) *
width * 2;
366 int prevline = (y == 0 ? 0 :
width);
369 for (x = 0; x <
width; x++) {
370 int prev = (x == 0 ? 0 : 1);
371 int next = (x ==
width - 1 ? 0 : 1);
373 uint32_t A = *(in - prevline - prev);
374 uint32_t
B = *(in - prevline);
375 uint32_t C = *(in - prevline + next);
376 uint32_t D = *(in - prev);
378 uint32_t
F = *(in + next);
379 uint32_t
G = *(in + nextline - prev);
380 uint32_t
H = *(in + nextline);
381 uint32_t
I = *(in + nextline + next);
384 pattern =
diff(
E, A) << 0;
385 pattern |=
diff(
E,
B) << 1;
386 pattern |=
diff(
E, C) << 2;
387 pattern |=
diff(
E, D) << 3;
388 pattern |=
diff(
E,
F) << 4;
389 pattern |=
diff(
E,
G) << 5;
390 pattern |=
diff(
E,
H) << 6;
391 pattern |=
diff(
E,
I) << 7;
Referenced by GL_Upscale32().
◆ HQ4x_Render()
void HQ4x_Render |
( |
uint32_t * |
output, |
|
|
const uint32_t * |
input, |
|
|
int |
width, |
|
|
int |
height |
|
) |
| |
Definition at line 405 of file hq2x.c.
409 for (y = 0; y <
height; y++) {
411 uint32_t *out0 = output + (y * 4 + 0) *
width * 4;
412 uint32_t *out1 = output + (y * 4 + 1) *
width * 4;
413 uint32_t *out2 = output + (y * 4 + 2) *
width * 4;
414 uint32_t *out3 = output + (y * 4 + 3) *
width * 4;
416 int prevline = (y == 0 ? 0 :
width);
419 for (x = 0; x <
width; x++) {
420 int prev = (x == 0 ? 0 : 1);
421 int next = (x ==
width - 1 ? 0 : 1);
423 uint32_t A = *(in - prevline - prev);
424 uint32_t
B = *(in - prevline);
425 uint32_t C = *(in - prevline + next);
426 uint32_t D = *(in - prev);
428 uint32_t
F = *(in + next);
429 uint32_t
G = *(in + nextline - prev);
430 uint32_t
H = *(in + nextline);
431 uint32_t
I = *(in + nextline + next);
434 pattern =
diff(
E, A) << 0;
435 pattern |=
diff(
E,
B) << 1;
436 pattern |=
diff(
E, C) << 2;
437 pattern |=
diff(
E, D) << 3;
438 pattern |=
diff(
E,
F) << 4;
439 pattern |=
diff(
E,
G) << 5;
440 pattern |=
diff(
E,
H) << 6;
441 pattern |=
diff(
E,
I) << 7;
443 hq4x_blend(
hqTable[pattern], out0 + 0, out0 + 1, out1 + 0, out1 + 1,
E, A,
B, D,
F,
H); pattern =
rotTable[pattern];
444 hq4x_blend(
hqTable[pattern], out0 + 3, out1 + 3, out0 + 2, out1 + 2,
E, C,
F,
B,
H, D); pattern =
rotTable[pattern];
445 hq4x_blend(
hqTable[pattern], out3 + 3, out3 + 2, out2 + 3, out2 + 2,
E,
I,
H,
F, D,
B); pattern =
rotTable[pattern];
446 hq4x_blend(
hqTable[pattern], out3 + 0, out2 + 0, out3 + 1, out2 + 1,
E,
G, D,
H,
B,
F);
Referenced by GL_Upscale32().
◆ IMG_Load_GL()
Definition at line 618 of file images.c.
621 int i, s, t, maxlevel;
624 width = image->upload_width;
625 height = image->upload_height;
628 if (image->type == IT_PIC &&
width < 64 &&
height < 64 &&
632 for (i = 0; i <
height; i++) {
633 memcpy(dst, src,
width * 4);
639 image->flags |= IF_SCRAP | IF_TRANSPARENT;
647 image->flags |= IF_UPSCALED;
657 image->flags |= IF_UPSCALED;
665 image->flags |= IF_TRANSPARENT;
Referenced by R_RegisterFunctionsGL().
◆ IMG_ReadPixels_GL()
byte* IMG_ReadPixels_GL |
( |
int * |
width, |
|
|
int * |
height, |
|
|
int * |
rowbytes |
|
) |
| |
Definition at line 427 of file state.c.
435 pixels = FS_AllocTempMem(pitch *
r_config.height);
438 GL_RGB, GL_UNSIGNED_BYTE, pixels);
440 int ideal_pitch =
r_config.width * 3;
441 if (pitch > ideal_pitch)
443 for (
int row = 1; row <
r_config.height; row++)
445 byte* src = pixels + row * pitch;
446 byte* dst = pixels + row * ideal_pitch;
447 memcpy(dst, src, ideal_pitch);
Referenced by R_RegisterFunctionsGL().
◆ IMG_Unload_GL()
◆ MOD_LoadMD2_GL()
qerror_t MOD_LoadMD2_GL |
( |
model_t * |
model, |
|
|
const void * |
rawdata, |
|
|
size_t |
length |
|
) |
| |
Definition at line 32 of file models.c.
35 dmd2frame_t *src_frame;
36 dmd2trivertx_t *src_vert;
37 dmd2triangle_t *src_tri;
49 int numverts, numindices;
50 char skinname[MAX_QPATH];
51 vec_t scale_s, scale_t;
55 if (length <
sizeof(header)) {
56 return Q_ERR_FILE_TOO_SMALL;
60 header = *(dmd2header_t *)rawdata;
61 for (i = 0; i <
sizeof(header) / 4; i++) {
62 ((uint32_t *)&header)[i] = LittleLong(((uint32_t *)&header)[i]);
68 if (ret == Q_ERR_TOO_FEW) {
70 model->type = MOD_EMPTY;
78 src_tri = (dmd2triangle_t *)((
byte *)rawdata + header.ofs_tris);
79 for (i = 0; i < header.num_tris; i++) {
80 for (j = 0; j < 3; j++) {
81 uint16_t idx_xyz = LittleShort(src_tri->index_xyz[j]);
82 uint16_t idx_st = LittleShort(src_tri->index_st[j]);
85 if (idx_xyz >= header.num_xyz || idx_st >= header.num_st) {
89 vertIndices[numindices + j] = idx_xyz;
90 tcIndices[numindices + j] = idx_st;
100 return Q_ERR_TOO_FEW;
103 for (i = 0; i < numindices; i++) {
109 src_tc = (dmd2stvert_t *)((
byte *)rawdata + header.ofs_st);
110 for (i = 0; i < numindices; i++) {
111 if (remap[i] != 0xFFFF) {
115 for (j = i + 1; j < numindices; j++) {
116 if (vertIndices[i] == vertIndices[j] &&
117 (src_tc[tcIndices[i]].s == src_tc[tcIndices[j]].s &&
118 src_tc[tcIndices[i]].t == src_tc[tcIndices[j]].t)) {
121 finalIndices[j] = numverts;
127 finalIndices[i] = numverts++;
131 return Q_ERR_TOO_MANY;
135 model->type = MOD_ALIAS;
136 model->nummeshes = 1;
137 model->numframes = header.num_frames;
139 model->frames = MOD_Malloc(header.num_frames *
sizeof(
maliasframe_t));
141 dst_mesh = model->meshes;
142 dst_mesh->
numtris = numindices / 3;
145 dst_mesh->
numskins = header.num_skins;
146 dst_mesh->
verts = MOD_Malloc(numverts * header.num_frames *
sizeof(
maliasvert_t));
150 if (dst_mesh->
numtris != header.num_tris) {
151 Com_DPrintf(
"%s has %d bad triangles\n", model->name, header.num_tris - dst_mesh->
numtris);
155 for (i = 0; i < numindices; i++) {
156 dst_mesh->
indices[i] = finalIndices[i];
160 src_skin = (
char *)rawdata + header.ofs_skins;
161 for (i = 0; i < header.num_skins; i++) {
162 if (!
Q_memccpy(skinname, src_skin, 0,
sizeof(skinname))) {
163 ret = Q_ERR_STRING_TRUNCATED;
168 src_skin += MD2_MAX_SKINNAME;
172 src_tc = (dmd2stvert_t *)((
byte *)rawdata + header.ofs_st);
174 scale_s = 1.0f / header.skinwidth;
175 scale_t = 1.0f / header.skinheight;
176 for (i = 0; i < numindices; i++) {
180 dst_tc[finalIndices[i]].
st[0] =
181 (int16_t)LittleShort(src_tc[tcIndices[i]].s) * scale_s;
182 dst_tc[finalIndices[i]].
st[1] =
183 (int16_t)LittleShort(src_tc[tcIndices[i]].t) * scale_t;
187 src_frame = (dmd2frame_t *)((
byte *)rawdata + header.ofs_frames);
188 dst_frame = model->frames;
189 for (j = 0; j < header.num_frames; j++) {
190 LittleVector(src_frame->scale, dst_frame->
scale);
191 LittleVector(src_frame->translate, dst_frame->
translate);
195 for (i = 0; i < numindices; i++) {
199 src_vert = &src_frame->verts[vertIndices[i]];
200 dst_vert = &dst_mesh->
verts[j * numverts + finalIndices[i]];
202 dst_vert->
pos[0] = src_vert->v[0];
203 dst_vert->
pos[1] = src_vert->v[1];
204 dst_vert->
pos[2] = src_vert->v[2];
206 val = src_vert->lightnormalindex;
207 if (val >= NUMVERTEXNORMALS) {
208 dst_vert->
norm[0] = 0;
209 dst_vert->
norm[1] = 0;
215 for (k = 0; k < 3; k++) {
216 val = dst_vert->
pos[k];
224 VectorVectorScale(mins, dst_frame->
scale, mins);
225 VectorVectorScale(maxs, dst_frame->
scale, maxs);
232 src_frame = (dmd2frame_t *)((
byte *)src_frame + header.framesize);
237 return Q_ERR_SUCCESS;
Referenced by R_RegisterFunctionsGL().
◆ MOD_LoadMD3_GL()
qerror_t MOD_LoadMD3_GL |
( |
model_t * |
model, |
|
|
const void * |
rawdata, |
|
|
size_t |
length |
|
) |
| |
◆ MOD_Reference_GL()
void MOD_Reference_GL |
( |
model_t * |
model | ) |
|
Definition at line 425 of file models.c.
430 switch (model->type) {
432 for (i = 0; i < model->nummeshes; i++) {
434 for (j = 0; j < mesh->
numskins; j++) {
440 for (i = 0; i < model->numframes; i++) {
447 Com_Error(ERR_FATAL,
"%s: bad model type", __func__);
Referenced by R_RegisterFunctionsGL().
◆ QGL_ClearErrors()
◆ R_AddSkySurface()
void R_AddSkySurface |
( |
mface_t * |
surf | ) |
|
Definition at line 234 of file sky.c.
239 msurfedge_t *surfedge;
243 Com_DPrintf(
"%s: too many verts\n", __func__);
248 surfedge = fa->firstsurfedge;
253 for (i = 0; i < fa->numsurfedges; i++, surfedge++) {
254 vert = surfedge->edge->v[surfedge->vert];
255 VectorSubtract(vert->point,
glr.
fd.vieworg, temp);
259 for (i = 0; i < fa->numsurfedges; i++, surfedge++) {
260 vert = surfedge->edge->v[surfedge->vert];
261 VectorSubtract(vert->point,
glr.
fd.vieworg, verts[i]);
Referenced by GL_DrawNode().
◆ R_ClampScaleGL()
float R_ClampScaleGL |
( |
cvar_t * |
var | ) |
|
◆ R_ClearColor_GL()
◆ R_ClearSkyBox()
◆ R_DrawChar_GL()
◆ R_DrawFill32_GL()
Definition at line 202 of file draw.c.
206 _GL_StretchPic(x, y, w, h, 0, 0, 1, 1,
color,
TEXNUM_WHITE, 0);
Referenced by R_RegisterFunctionsGL().
◆ R_DrawFill8_GL()
Definition at line 195 of file draw.c.
199 _GL_StretchPic(x, y, w, h, 0, 0, 1, 1,
d_8to24table[
c & 0xff],
TEXNUM_WHITE, 0);
Referenced by R_RegisterFunctionsGL().
◆ R_DrawPic_GL()
◆ R_DrawSkyBox()
Definition at line 337 of file sky.c.
339 static const int skytexorder[6] = {0, 2, 1, 3, 4, 5};
352 for (i = 0; i < 6; i++) {
Referenced by GL_DrawWorld().
◆ R_DrawStretchPic_GL()
◆ R_DrawString_GL()
int R_DrawString_GL |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
flags, |
|
|
size_t |
maxlen, |
|
|
const char * |
s, |
|
|
qhandle_t |
font |
|
) |
| |
◆ R_LightPoint_GL()
void R_LightPoint_GL |
( |
vec3_t |
origin, |
|
|
vec3_t |
color |
|
) |
| |
◆ R_SetAlpha_GL()
void R_SetAlpha_GL |
( |
float |
alpha | ) |
|
◆ R_SetAlphaScale_GL()
void R_SetAlphaScale_GL |
( |
float |
alpha | ) |
|
◆ R_SetClipRect_GL()
void R_SetClipRect_GL |
( |
const clipRect_t * |
clip | ) |
|
Definition at line 115 of file draw.c.
133 rc.left = clip->left * scale;
134 rc.top = clip->top * scale;
135 rc.right = clip->right * scale;
136 rc.bottom = clip->bottom * scale;
146 if (rc.right < rc.left)
148 if (rc.bottom < rc.top)
153 rc.right - rc.left, rc.bottom - rc.top);
Referenced by R_RegisterFunctionsGL().
◆ R_SetColor_GL()
void R_SetColor_GL |
( |
uint32_t |
color | ) |
|
◆ R_SetScale_GL()
void R_SetScale_GL |
( |
float |
scale | ) |
|
◆ R_SetSky_GL()
void R_SetSky_GL |
( |
const char * |
name, |
|
|
float |
rotate, |
|
|
vec3_t |
axis |
|
) |
| |
Definition at line 382 of file sky.c.
385 char pathname[MAX_QPATH];
389 static const char suf[6][3] = {
"rt",
"bk",
"lf",
"ft",
"up",
"dn" };
399 for (i = 0; i < 6; i++) {
400 len =
Q_concat(pathname,
sizeof(pathname),
401 "env/", name, suf[i],
".tga", NULL);
402 if (len >=
sizeof(pathname)) {
407 image =
IMG_Find(pathname, IT_SKY, IF_NONE);
Referenced by R_RegisterFunctionsGL().
◆ R_TileClear_GL()
◆ Scrap_Upload()
Definition at line 30 of file main.c.
Referenced by AC_FreeChecks(), AC_SendChecks(), BSP_ClusterVis(), CheckBlock(), CL_ConnectionlessPacket(), CL_GetDemoInfo(), CL_Heatbeam(), CL_OldRailTrail(), CL_RailSpiral(), CL_Record_f(), CL_WriteConfig_f(), clamp_output(), CM_InitBoxHull(), Cmd_EchoEx_f(), Cmd_UnAlias_f(), COM_Compress(), Com_Generic_c(), Com_HashString(), Com_HashStringLen(), COM_IsFloat(), COM_IsPath(), COM_IsUint(), COM_IsWhite(), COM_Parse(), COM_strclr(), compute_cluster_aabbs(), Con_DrawLine(), Con_Paste(), cull_lerped_model(), cull_static_model(), Cvar_BitInfo(), Cvar_Default_g(), Cvar_Get(), Cvar_List_f(), Cvar_Set_f(), Cvar_Variable_g(), D_FlushCaches(), draw_alias_mesh(), draw_char(), dummy_find_slot(), escape_path(), format_mask(), FS_NormalizePath(), FS_UnLink_f(), G_FindTeams(), get_emissive_shell(), GL_BindTexture(), GL_ColorInvertTexture(), GL_DrawBspModel(), GL_DrawFace(), GL_DrawLeaf(), GL_DrawNode(), GL_Flush2D(), GL_Flush3D(), GL_ForceTexture(), GL_GrayScaleTexture(), GL_LightScaleTexture(), GL_MarkLeaves(), GL_TextureAnimation(), GL_TextureHasAlpha(), GL_Upload32(), GL_WorldNode_r(), IMG_Load(), Info_SetValueForKey(), Info_SubValidate(), Info_Validate(), inject_model_lights(), Key_Bind_f(), KeyDown(), KeyUp(), left_of(), LM_RebuildSurfaces(), logfile_write(), MSG_ReadByte(), MSG_ReadChar(), MSG_ReadLong(), MSG_ReadShort(), MSG_ReadString(), MSG_ReadStringLine(), MSG_ReadWord(), MSG_WriteByte(), MSG_WriteChar(), MSG_WriteLong(), MSG_WriteShort(), MVD_Connect_f(), MVD_Control_f(), MVD_CountClients(), MVD_Play_f(), MVD_StreamedRecord_f(), needs_quotes(), Parse_Action(), Parse_Bind(), Parse_Bitmap(), Parse_Color(), parse_CSV_line(), Parse_Field(), parse_ignore_nick(), Parse_Pairs(), Parse_Range(), Parse_Savegame(), Parse_Spin(), Parse_Style(), Parse_Toggle(), Q_memccpy(), Q_strchrnul(), R_BeginFrame_GL(), R_DrawChar_GL(), R_DrawChar_RTX(), R_DrawFill32(), R_DrawFill8(), R_DrawFill8_GL(), R_DrawFill8_RTX(), R_DrawString(), R_DrawString_GL(), R_DrawString_RTX(), R_IMFlatShadedQuad(), R_LightScaleTexture(), R_RecursiveWorldNode(), R_TextureAnimation(), sample_spherical_lights(), SCR_Draw_f(), SCR_LagDraw(), SCR_ParseColor(), SetupRotationMatrix(), SV_ConnectionlessPacket(), SV_CvarResult_f(), SV_DumpEnts_f(), SV_ExecuteClientMessage(), SV_ExecuteUserCommand(), SV_MvdRecord_f(), SV_NewClientExecuteMove(), SV_StuffCvar_f(), SZ_WriteByte(), SZ_WriteLong(), SZ_WriteShort(), target_string_use(), TH_DrawString(), UI_DrawRect8(), UnionBounds(), update_dynamic_lightmap(), and validate_char().
◆ draw
◆ gl_brightness
◆ gl_celshading
◆ gl_clear
◆ gl_coloredlightmaps
cvar_t* gl_coloredlightmaps |
◆ gl_config
Definition at line 29 of file main.c.
Referenced by draw_shadow(), gl_anisotropy_changed(), GL_InitPrograms(), GL_PostInit(), GL_SetFilterAndRepeat(), GL_SetupConfig(), GL_ShutdownPrograms(), GL_Strings_f(), GL_Upload32(), GL_UpscaleLevel(), R_EndFrame_GL(), R_Init_GL(), and R_Shutdown_GL().
◆ gl_cull_nodes
◆ gl_dotshading
◆ gl_doublelight_entities
cvar_t* gl_doublelight_entities |
◆ gl_drawsky
◆ gl_dynamic
◆ gl_fontshadow
◆ gl_fragment_program
cvar_t* gl_fragment_program |
◆ gl_fullbright
◆ gl_hash_faces
◆ gl_lightmap
◆ gl_lockpvs
◆ gl_modulate
◆ gl_modulate_entities
cvar_t* gl_modulate_entities |
◆ gl_modulate_world
cvar_t* gl_modulate_world |
◆ gl_novis
◆ gl_partscale
◆ gl_partstyle
◆ gl_shadows
◆ gl_showtris
◆ gl_static
Definition at line 28 of file main.c.
Referenced by _GL_LightPoint(), build_style_map(), build_surface_light(), color_for_surface(), create_surface_vbo(), draw_shadow(), GL_AdjustColor(), GL_BindArrays(), GL_BuildIntensityTable(), GL_CopyVerts(), GL_DrawEntities(), GL_DrawFace(), gl_drawsky_changed(), GL_DrawWorld(), GL_Flush3D(), GL_FreeWorld(), GL_Frustum(), GL_InitImages(), GL_InitPrograms(), GL_InitTables(), GL_LightPoint(), GL_LoadWorld(), GL_MarkLeaves(), gl_modulate_entities_changed(), GL_RebuildLighting(), GL_SetDefaultState(), GL_Setup3D(), GL_ShutdownImages(), GL_ShutdownPrograms(), GL_StateBits(), LM_RebuildSurfaces(), MakeSkyVec(), MOD_LoadMD2_GL(), R_BeginRegistration_GL(), R_EndRegistration_GL(), R_RenderFrame_GL(), R_Shutdown_GL(), set_world_size(), and upload_world_surfaces().
◆ gl_vertexlight
◆ gl_world
◆ gl_znear
◆ glr
Definition at line 27 of file main.c.
Referenced by _GL_LightPoint(), build_style_map(), cull_lerped_model(), cull_static_model(), draw_alias_mesh(), GL_Blend(), GL_ClipNode(), GL_CullBox(), GL_CullLocalBox(), GL_CullSphere(), GL_DrawAliasModel(), GL_DrawAlphaFaces(), GL_DrawBeams(), GL_DrawBspModel(), GL_DrawEntities(), GL_DrawLeaf(), GL_DrawNode(), GL_DrawNullModel(), GL_DrawParticles(), GL_DrawSpriteModel(), GL_DrawWorld(), GL_Frustum(), GL_MarkLeaves(), gl_novis_changed(), GL_RotateForEntity(), GL_RotateForViewer(), GL_SampleLightPoint(), GL_Setup3D(), GL_SetupFrustum(), GL_StateBits(), GL_TextureAnimation(), GL_ViewCluster_m(), GL_WorldNode_r(), make_box_points(), MakeSkyVec(), R_AddSkySurface(), R_BeginRegistration_GL(), R_RenderFrame_GL(), sample_surface_verts(), setup_celshading(), setup_color(), setup_dotshading(), setup_shadow(), texnum_for_mesh(), and update_dynamic_lightmap().
◆ gls
Definition at line 22 of file state.c.
Referenced by GL_ActiveTexture(), GL_ArrayBits(), GL_BindTexture(), GL_ClientActiveTexture(), GL_ForceTexture(), GL_LoadMatrix(), GL_RotateForEntity(), GL_RotateForViewer(), GL_SetDefaultState(), GL_StateBits(), and IMG_Unload_GL().
◆ lm
Definition at line 25 of file surf.c.
Referenced by adjust_color_f(), adjust_color_ub(), build_primary_lightmap(), GL_BindArrays(), GL_InitImages(), gl_lightmap_changed(), GL_ShutdownImages(), LM_BeginBuilding(), LM_BuildSurface(), LM_EndBuilding(), LM_InitBlock(), LM_RebuildSurfaces(), LM_UploadBlock(), and R_RenderFrame_GL().
◆ tess
Definition at line 21 of file tess.c.
Referenced by _GL_StretchPic(), draw_alias_mesh(), GL_BindArrays(), GL_CopyVerts(), GL_DrawBeams(), GL_DrawFace(), GL_DrawParticles(), GL_Flush2D(), GL_Flush3D(), tess_lerped_plain(), tess_lerped_shade(), tess_lerped_shell(), tess_static_plain(), tess_static_shade(), tess_static_shell(), upload_surface_vbo(), and upload_world_surfaces().
vec_t RadiusFromBounds(const vec3_t mins, const vec3_t maxs)
#define SCRAP_BLOCK_HEIGHT
cvar_t * Cvar_Set(const char *var_name, const char *value)
#define SKY_VISIBLE(side)
PFNGLCLIENTACTIVETEXTUREARBPROC qglClientActiveTextureARB
static cvar_t * gl_gamma_scale_pics
void IMG_GetPalette(void)
static const uint8_t hqTable[256]
static void GL_DrawChain(mface_t **head)
static tessfunc_t tessfunc
static void draw_alias_mesh(maliasmesh_t *mesh)
static void Scrap_Init(void)
static cvar_t * gl_texturemode
#define Scrap_AllocBlock(w, h, s, t)
static int32_t yccTable[8][256]
static mface_t ** faces_next[FACE_HASH_SIZE]
static byte scrap_data[SCRAP_BLOCK_WIDTH *SCRAP_BLOCK_HEIGHT *4]
static void LM_RebuildSurfaces(void)
void Hunk_Begin(memhunk_t *hunk, size_t maxsize)
static void GL_Frustum(void)
static void GL_InitParticleTexture(void)
void GL_PushLights(mface_t *surf)
static const char * GL_ErrorString(GLenum err)
PFNGLPROGRAMLOCALPARAMETER4FVARBPROC qglProgramLocalParameter4fvARB
static size_t align(size_t x, size_t alignment)
static float skymins[2][6]
static void tess_static_shade(const maliasmesh_t *mesh)
static q_noinline uint32_t hq2x_blend(int rule, uint32_t E, uint32_t A, uint32_t B, uint32_t D, uint32_t F, uint32_t H)
cvar_t * Cvar_Get(const char *var_name, const char *var_value, int flags)
const char * Q_ErrorString(qerror_t error)
void GL_Ortho(GLfloat xmin, GLfloat xmax, GLfloat ymin, GLfloat ymax, GLfloat znear, GLfloat zfar)
PFNGLLOCKARRAYSEXTPROC qglLockArraysEXT
static void adjust_color_f(vec_t *out, const vec_t *in, float modulate)
void * Hunk_Alloc(memhunk_t *hunk, size_t size)
PFNGLPROGRAMSTRINGARBPROC qglProgramStringARB
static int GL_UpscaleLevel(int width, int height, imagetype_t type, imageflags_t flags)
static void setup_color(void)
#define BSP_CullFace(face, dot)
void GL_AddAlphaFace(mface_t *face)
static cvar_t * gl_noscrap
#define qglDisableClientState
static void MakeSkyVec(float s, float t, int axis, vec_t *out)
static mface_t * faces_alpha
static int GL_CopyVerts(mface_t *surf)
static glCullResult_t cull_static_model(model_t *model)
static void GL_Upscale32(byte *data, int width, int height, int maxlevel, imagetype_t type, imageflags_t flags)
static void make_box_points(const vec3_t origin, vec3_t bounds[2], vec3_t points[8])
void GL_BindTexture(GLuint tmu, GLuint texnum)
PFNGLDELETEPROGRAMSARBPROC qglDeleteProgramsARB
void GL_ClearSolidFaces(void)
glCullResult_t GL_CullSphere(const vec3_t origin, float radius)
static qboolean create_surface_vbo(size_t size)
uint32_t d_8to24table[256]
static void GL_Upload32(byte *data, int width, int height, int baselevel, imagetype_t type, imageflags_t flags)
static void GL_ClientActiveTexture(GLuint tmu)
static void R_UnsetSky(void)
qerror_t MOD_ValidateMD2(dmd2header_t *header, size_t length)
PFNGLDELETEBUFFERSARBPROC qglDeleteBuffersARB
static mface_t * faces_head[FACE_HASH_SIZE]
static void gl_texturemode_g(genctx_t *ctx)
static void GL_LockArrays(GLsizei count)
static cvar_t * gl_saturation
qboolean infront(edict_t *self, edict_t *other)
static void gl_bilerp_chars_changed(cvar_t *self)
static cvar_t * gl_round_down
static cvar_t * gl_invert
static void gl_texturebits_changed(cvar_t *self)
static void GL_InitBeamTexture(void)
static void GL_UnlockArrays(void)
static float skymaxs[2][6]
GLbitfield stencil_buffer_bit
static void setup_shadow(void)
static int GL_TextureAnimation(mtexinfo_t *tex)
static void gl_bilerp_pics_changed(cvar_t *self)
static cvar_t * gl_anisotropy
image_t * skins[MAX_ALIAS_SKINS]
static void GL_LightCoordPointer(GLint size, GLsizei stride, const GLfloat *pointer)
void Hunk_Free(memhunk_t *hunk)
static void GL_BuildGammaTables(void)
#define TESS_MAX_VERTICES
static void Scrap_Shutdown(void)
static void LM_EndBuilding(void)
#define GL_AddLights(origin, color)
void GL_ArrayBits(glArrayBits_t bits)
#define qglTexCoordPointer
#define GL_StretchPic(x, y, w, h, s1, t1, s2, t2, color, image)
void Com_Error(error_type_t type, const char *fmt,...)
void BSP_Free(bsp_t *bsp)
void GL_RotateForEntity(vec3_t origin, float scale)
static void tess_lerped_plain(const maliasmesh_t *mesh)
void GL_DrawFace(mface_t *surf)
static cvar_t * gl_downsample_skins
#define QGL_ARB_fragment_program
void QGL_ClearErrors(void)
static void tess_lerped_shell(const maliasmesh_t *mesh)
#define AT_LEAST_OPENGL(major, minor)
struct glStatic_t::@11 world
float Cvar_ClampValue(cvar_t *var, float min, float max)
static void gl_anisotropy_changed(cvar_t *self)
cplane_t frustumPlanes[4]
void GL_MultMatrix(GLfloat *p, const GLfloat *a, const GLfloat *b)
byte latlngtab[NUMVERTEXNORMALS][2]
static void GL_ColorBytePointer(GLint size, GLsizei stride, const GLubyte *pointer)
QGL_INDEX_TYPE indices[TESS_MAX_INDICES]
static void setup_dotshading(void)
static void tess_static_plain(const maliasmesh_t *mesh)
static void SkyInverseRotate(vec3_t out, const vec3_t in)
void ClearBounds(vec3_t mins, vec3_t maxs)
static void GL_TexCoordPointer(GLint size, GLsizei stride, const GLfloat *pointer)
glCullResult_t GL_CullLocalBox(const vec3_t origin, vec3_t bounds[2])
void GL_ArrayBits(glArrayBits_t bits)
void Hunk_End(memhunk_t *hunk)
static q_noinline void hq4x_blend(int rule, uint32_t *p00, uint32_t *p01, uint32_t *p10, uint32_t *p11, uint32_t E, uint32_t A, uint32_t B, uint32_t D, uint32_t F, uint32_t H)
#define qglEnableClientState
void GL_DisableOutlines(void)
static cvar_t * gl_bilerp_pics
GLuint texnums[NUM_TEXNUMS]
void QGL_ShutdownExtensions(unsigned mask)
void SetupRotationMatrix(vec3_t matrix[3], const vec3_t dir, float degrees)
static void _GL_StretchPic(float x, float y, float w, float h, float s1, float t1, float s2, float t2, uint32_t color, int texnum, int flags)
#define GL_TransformLights()
static void GL_ActiveTexture(GLuint tmu)
static qboolean upload_alpha
static void draw_char(int x, int y, int flags, int c, image_t *image)
void GL_DrawSolidFaces(void)
vec_t VectorNormalize2(vec3_t v, vec3_t out)
static void upload_world_surfaces(void)
PFNGLACTIVETEXTUREARBPROC qglActiveTextureARB
void GL_ForceTexture(GLuint tmu, GLuint texnum)
static uint8_t rotTable[256]
image_t * IMG_Find(const char *name, imagetype_t type, imageflags_t flags)
static qboolean _GL_LightPoint(vec3_t start, vec3_t color)
void GL_Ortho(GLfloat xmin, GLfloat xmax, GLfloat ymin, GLfloat ymax, GLfloat znear, GLfloat zfar)
void GL_LightPoint(vec3_t origin, vec3_t color)
static cvar_t * gl_upscale_pcx
static void gl_texturemode_changed(cvar_t *self)
PFNGLGENPROGRAMSARBPROC qglGenProgramsARB
void GL_BindTexture(GLuint tmu, GLuint texnum)
GLubyte colors[4 *TESS_MAX_VERTICES]
static cvar_t * gl_bilerp_chars
static void setup_celshading(void)
static void GL_InitDefaultTexture(void)
int registration_sequence
static void GL_VertexPointer(GLint size, GLsizei stride, const GLfloat *pointer)
static void GL_BuildIntensityTable(void)
static void LM_BeginBuilding(void)
void QGL_InitExtensions(unsigned mask)
static void GL_InitWhiteImage(void)
cvar_t * gl_doublelight_entities
static void GL_LoadMatrix(const GLfloat *matrix)
PFNGLBINDBUFFERARBPROC qglBindBufferARB
static q_noinline int diff(uint32_t A_u32, uint32_t B_u32)
static vec3_t skymatrix[3]
static glCullResult_t cull_lerped_model(model_t *model)
#define LIGHT_STYLE(surf, i)
cvar_t * gl_fragment_program
static const char gl_prog_warp[]
static cvar_t * gl_texture_non_power_of_two
static const vec_t * shadelight
GLuint texnums[LM_MAX_LIGHTMAPS]
void * Q_memccpy(void *dst, const void *src, int c, size_t size)
#define SCRAP_BLOCK_WIDTH
static void GL_WorldNode_r(mnode_t *node, int clipflags)
qerror_t BSP_Load(const char *name, bsp_t **bsp_p)
static void update_dynamic_lightmap(mface_t *surf)
image_t * IMG_ForHandle(qhandle_t h)
size_t Q_concat(char *dest, size_t size,...)
const GLfloat * currentmatrix
static void gl_gamma_changed(cvar_t *self)
PFNGLUNLOCKARRAYSEXTPROC qglUnlockArraysEXT
glCullResult_t GL_CullBox(vec3_t bounds[2])
GLfloat vertices[VERTEX_SIZE *TESS_MAX_VERTICES]
CONST PIXELFORMATDESCRIPTOR int
static cvar_t * gl_intensity
static cvar_t * gl_texturebits
static void GL_RotateForViewer(void)
void GL_EnableOutlines(void)
void GL_StateBits(glStateBits_t bits)
static void tess_lerped_shade(const maliasmesh_t *mesh)
static cvar_t * gl_picmip
static void GL_MarkLeaves(void)
PFNGLBINDPROGRAMARBPROC qglBindProgramARB
qboolean GL_ShowErrors(const char *func)
static void tess_static_shell(const maliasmesh_t *mesh)
static void GL_SetFilterAndRepeat(imagetype_t type, imageflags_t flags)
size_t FS_NormalizePath(char *out, const char *in)
void GL_StateBits(glStateBits_t bits)
int BoxOnPlaneSide(vec3_t emins, vec3_t emaxs, cplane_t *p)
#define qglDeleteTextures
static void ClipSkyPolygon(int nump, vec3_t vecs, int stage)
static qboolean scrap_dirty
static void set_world_size(void)