fcol = col*0.0625;
size = 0.0625;
+ if (!r_render.value)
+ return;
glBindTexture(GL_TEXTURE_2D, char_texture);
// LordHavoc: NEAREST mode on text if not scaling up
if ((int) vid.width < glwidth)
maxlen = strlen(str);
else if (maxlen > (int) strlen(str))
maxlen = strlen(str);
+ if (!r_render.value)
+ return;
glBindTexture(GL_TEXTURE_2D, char_texture);
// LordHavoc: NEAREST mode on text if not scaling up
void Draw_GenericPic (int texnum, float red, float green, float blue, float alpha, float x, float y, float width, float height)
{
+ if (!r_render.value)
+ return;
glDisable(GL_ALPHA_TEST);
// glEnable (GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
if (scrap_dirty)
Scrap_Upload ();
gl = (glpic_t *)pic->data;
+ if (!r_render.value)
+ return;
glColor4f(1,1,1,alpha);
glBindTexture(GL_TEXTURE_2D, gl->texnum);
glBegin (GL_QUADS);
if (scrap_dirty)
Scrap_Upload ();
gl = (glpic_t *)pic->data;
+ if (!r_render.value)
+ return;
glColor3f(1,1,1);
glBindTexture(GL_TEXTURE_2D, gl->texnum);
glBegin (GL_QUADS);
for (i = 0;i < c;i++)
*dest++ = translation[*src++];
- glBindTexture(GL_TEXTURE_2D, GL_LoadTexture ("translatedplayerpic", pic->width, pic->height, trans, false, true, 1));
+ c = GL_LoadTexture ("translatedplayerpic", pic->width, pic->height, trans, false, true, 1);
free(trans);
+ if (!r_render.value)
+ return;
+ glBindTexture(GL_TEXTURE_2D, c);
glColor3f(1,1,1);
glBegin (GL_QUADS);
glTexCoord2f (0, 0);
*/
void Draw_Fill (int x, int y, int w, int h, int c)
{
+ if (!r_render.value)
+ return;
glDisable (GL_TEXTURE_2D);
glColor3f (host_basepal[c*3]/255.0, host_basepal[c*3+1]/255.0, host_basepal[c*3+2]/255.0);
*/
void GL_Set2D (void)
{
+ if (!r_render.value)
+ return;
glViewport (glx, gly, glwidth, glheight);
glMatrixMode(GL_PROJECTION);
void GL_DrawModelMesh(int skin, byte *colors, maliashdr_t *maliashdr)
{
int i;
+ if (!r_render.value)
+ return;
glBindTexture(GL_TEXTURE_2D, skin);
if (!colors)
{
R_AliasLerpVerts(maliashdr->numverts, lerp, (trivert2 *)((int) maliashdr + maliashdr->posedata) + ent->draw_lastpose * maliashdr->numverts, maliashdr->scale, maliashdr->scale_origin, (trivert2 *)((int) maliashdr + maliashdr->posedata) + ent->draw_pose * maliashdr->numverts, maliashdr->scale, maliashdr->scale_origin);
// prep the vertex array as early as possible
- if (gl_vertexarrays.value)
+ if (r_render.value)
{
- qglVertexPointer(3, GL_FLOAT, 0, aliasvert);
- glEnableClientState(GL_VERTEX_ARRAY);
+ if (gl_vertexarrays.value)
+ {
+ qglVertexPointer(3, GL_FLOAT, 0, aliasvert);
+ glEnableClientState(GL_VERTEX_ARRAY);
+ }
}
R_LightModel(maliashdr->numverts, org, color);
+ if (!r_render.value)
+ return;
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glShadeModel(GL_SMOOTH);
if (effects & EF_ADDITIVE)
float lerp;
md2memframe_t *frame1, *frame2;
- glBindTexture(GL_TEXTURE_2D, skin);
+ if (r_render.value)
+ glBindTexture(GL_TEXTURE_2D, skin);
softwaretransformforentity(ent);
R_LightModel(pheader->num_xyz, org, color);
+ if (!r_render.value)
+ return;
if (gl_vertexarrays.value)
{
// LordHavoc: big mess...
R_LightPoint (color, org);
}
- glDisable(GL_ALPHA_TEST);
+ if (r_render.value)
+ glDisable(GL_ALPHA_TEST);
if (frame < 0 || frame >= clmodel->numframes)
{
skinset = skinanim + i*5;
}
- glEnable (GL_TEXTURE_2D);
+ if (r_render.value)
+ glEnable (GL_TEXTURE_2D);
c_alias_polys += clmodel->numtris;
if (clmodel->aliastype == ALIASTYPE_MD2)
{
int smax, tmax;
// upload the new lightmap texture fragment
- glBindTexture(GL_TEXTURE_2D, lightmap_textures + lnum);
+ if(r_upload.value)
+ glBindTexture(GL_TEXTURE_2D, lightmap_textures + lnum);
if (nosubimage || nosubimagefragments)
{
if (lightmapupdate[lnum][0] > s->light_t)
if (lightmaprgba)
{
R_BuildLightMap (s, templight, smax * 4);
- glTexSubImage2D(GL_TEXTURE_2D, 0, s->light_s, s->light_t, smax, tmax, GL_RGBA, GL_UNSIGNED_BYTE, templight);
+ if(r_upload.value)
+ glTexSubImage2D(GL_TEXTURE_2D, 0, s->light_s, s->light_t, smax, tmax, GL_RGBA, GL_UNSIGNED_BYTE, templight);
}
else
{
R_BuildLightMap (s, templight, smax * 3);
- glTexSubImage2D(GL_TEXTURE_2D, 0, s->light_s, s->light_t, smax, tmax, GL_RGB , GL_UNSIGNED_BYTE, templight);
+ if(r_upload.value)
+ glTexSubImage2D(GL_TEXTURE_2D, 0, s->light_s, s->light_t, smax, tmax, GL_RGB , GL_UNSIGNED_BYTE, templight);
}
}
}
{
if (lightmapupdate[i][0] < lightmapupdate[i][1])
{
- glBindTexture(GL_TEXTURE_2D, lightmap_textures + i);
- if (nosubimage)
- {
- if (lightmaprgba)
- glTexImage2D(GL_TEXTURE_2D, 0, 3, BLOCK_WIDTH, BLOCK_HEIGHT, 0, GL_RGBA, GL_UNSIGNED_BYTE, lightmaps[i]);
- else
- glTexImage2D(GL_TEXTURE_2D, 0, 3, BLOCK_WIDTH, BLOCK_HEIGHT, 0, GL_RGB, GL_UNSIGNED_BYTE, lightmaps[i]);
- }
- else
+ if(r_upload.value)
{
- if (lightmaprgba)
- glTexSubImage2D(GL_TEXTURE_2D, 0, 0, lightmapupdate[i][0], BLOCK_WIDTH, lightmapupdate[i][1] - lightmapupdate[i][0], GL_RGBA, GL_UNSIGNED_BYTE, lightmaps[i] + (BLOCK_WIDTH * 4 * lightmapupdate[i][0]));
+ glBindTexture(GL_TEXTURE_2D, lightmap_textures + i);
+ if (nosubimage)
+ {
+ if (lightmaprgba)
+ glTexImage2D(GL_TEXTURE_2D, 0, 3, BLOCK_WIDTH, BLOCK_HEIGHT, 0, GL_RGBA, GL_UNSIGNED_BYTE, lightmaps[i]);
+ else
+ glTexImage2D(GL_TEXTURE_2D, 0, 3, BLOCK_WIDTH, BLOCK_HEIGHT, 0, GL_RGB, GL_UNSIGNED_BYTE, lightmaps[i]);
+ }
else
- glTexSubImage2D(GL_TEXTURE_2D, 0, 0, lightmapupdate[i][0], BLOCK_WIDTH, lightmapupdate[i][1] - lightmapupdate[i][0], GL_RGB, GL_UNSIGNED_BYTE, lightmaps[i] + (BLOCK_WIDTH * 3 * lightmapupdate[i][0]));
+ {
+ if (lightmaprgba)
+ glTexSubImage2D(GL_TEXTURE_2D, 0, 0, lightmapupdate[i][0], BLOCK_WIDTH, lightmapupdate[i][1] - lightmapupdate[i][0], GL_RGBA, GL_UNSIGNED_BYTE, lightmaps[i] + (BLOCK_WIDTH * 4 * lightmapupdate[i][0]));
+ else
+ glTexSubImage2D(GL_TEXTURE_2D, 0, 0, lightmapupdate[i][0], BLOCK_WIDTH, lightmapupdate[i][1] - lightmapupdate[i][0], GL_RGB, GL_UNSIGNED_BYTE, lightmaps[i] + (BLOCK_WIDTH * 3 * lightmapupdate[i][0]));
+ }
}
}
lightmapupdate[i][0] = BLOCK_HEIGHT;
{
byte blank[BLOCK_WIDTH*BLOCK_HEIGHT*3];
memset(blank, 0, sizeof(blank));
- glBindTexture(GL_TEXTURE_2D, lightmap_textures + texnum);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- if (lightmaprgba)
- glTexImage2D (GL_TEXTURE_2D, 0, 3, BLOCK_WIDTH, BLOCK_HEIGHT, 0, GL_RGBA, GL_UNSIGNED_BYTE, blank);
- else
- glTexImage2D (GL_TEXTURE_2D, 0, 3, BLOCK_WIDTH, BLOCK_HEIGHT, 0, GL_RGB, GL_UNSIGNED_BYTE, blank);
+ if(r_upload.value)
+ {
+ glBindTexture(GL_TEXTURE_2D, lightmap_textures + texnum);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ if (lightmaprgba)
+ glTexImage2D (GL_TEXTURE_2D, 0, 3, BLOCK_WIDTH, BLOCK_HEIGHT, 0, GL_RGBA, GL_UNSIGNED_BYTE, blank);
+ else
+ glTexImage2D (GL_TEXTURE_2D, 0, 3, BLOCK_WIDTH, BLOCK_HEIGHT, 0, GL_RGB, GL_UNSIGNED_BYTE, blank);
+ }
}
for (i=0 ; i<w ; i++)
if (lightmaprgba)
{
R_BuildLightMap (surf, templight, smax * 4);
- glTexSubImage2D(GL_TEXTURE_2D, 0, surf->light_s, surf->light_t, smax, tmax, GL_RGBA, GL_UNSIGNED_BYTE, templight);
+ if(r_upload.value)
+ glTexSubImage2D(GL_TEXTURE_2D, 0, surf->light_s, surf->light_t, smax, tmax, GL_RGBA, GL_UNSIGNED_BYTE, templight);
}
else
{
R_BuildLightMap (surf, templight, smax * 3);
- glTexSubImage2D(GL_TEXTURE_2D, 0, surf->light_s, surf->light_t, smax, tmax, GL_RGB , GL_UNSIGNED_BYTE, templight);
+ if(r_upload.value)
+ glTexSubImage2D(GL_TEXTURE_2D, 0, surf->light_s, surf->light_t, smax, tmax, GL_RGB , GL_UNSIGNED_BYTE, templight);
}
}
if (nosubimage || nosubimagefragments)
{
- if (gl_mtexable)
- qglSelectTexture(gl_mtex_enum+1);
+ if(r_upload.value)
+ if (gl_mtexable)
+ qglSelectTexture(gl_mtex_enum+1);
for (i = 0;i < MAX_LIGHTMAPS;i++)
{
if (!allocated[i][0])
break;
lightmapupdate[i][0] = BLOCK_HEIGHT;
lightmapupdate[i][1] = 0;
- glBindTexture(GL_TEXTURE_2D, lightmap_textures + i);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- if (lightmaprgba)
- glTexImage2D(GL_TEXTURE_2D, 0, 3, BLOCK_WIDTH, BLOCK_HEIGHT, 0, GL_RGBA, GL_UNSIGNED_BYTE, lightmaps[i]);
- else
- glTexImage2D(GL_TEXTURE_2D, 0, 3, BLOCK_WIDTH, BLOCK_HEIGHT, 0, GL_RGB, GL_UNSIGNED_BYTE, lightmaps[i]);
+ if(r_upload.value)
+ {
+ glBindTexture(GL_TEXTURE_2D, lightmap_textures + i);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ if (lightmaprgba)
+ glTexImage2D(GL_TEXTURE_2D, 0, 3, BLOCK_WIDTH, BLOCK_HEIGHT, 0, GL_RGBA, GL_UNSIGNED_BYTE, lightmaps[i]);
+ else
+ glTexImage2D(GL_TEXTURE_2D, 0, 3, BLOCK_WIDTH, BLOCK_HEIGHT, 0, GL_RGB, GL_UNSIGNED_BYTE, lightmaps[i]);
+ }
}
- if (gl_mtexable)
- qglSelectTexture(gl_mtex_enum+0);
+ if(r_upload.value)
+ if (gl_mtexable)
+ qglSelectTexture(gl_mtex_enum+0);
}
}