#include "quakedef.h"
#include "image.h"
-cvar_t scr_conalpha = {CVAR_SAVE, "scr_conalpha", "1"};
-
static rtexture_t *char_texture;
//=============================================================================
void GL_Draw_Init (void)
{
- Cvar_RegisterVariable (&scr_conalpha);
-
numcachepics = 0;
memset(cachepichash, 0, sizeof(cachepichash));
int quadelements[768];
void R_DrawQueue(void)
{
- int pos, num, chartexnum, overbright, texnum, additive, batch;
+ int pos, num, chartexnum, texnum, batch;
float x, y, w, h, s, t, u, v, *av, *at, c[4];
cachepic_t *pic;
drawqueue_t *dq;
texnum = 0;
color = 0;
- overbright = v_overbrightbits.integer;
batch = false;
batchcount = 0;
for (pos = 0;pos < r_refdef.drawqueuesize;pos += ((drawqueue_t *)(r_refdef.drawqueue + pos))->size)
{
dq = (drawqueue_t *)(r_refdef.drawqueue + pos);
- additive = (dq->flags & DRAWFLAG_ADDITIVE) != 0;
color = dq->color;
- GL_BlendFunc(GL_SRC_ALPHA, additive ? GL_ONE : GL_ONE_MINUS_SRC_ALPHA);
+
+ if(dq->flags & DRAWFLAG_ADDITIVE)
+ GL_BlendFunc(GL_SRC_ALPHA, GL_ONE);
+ else if(dq->flags & DRAWFLAG_MODULATE)
+ GL_BlendFunc(GL_DST_COLOR, GL_ZERO);
+ else
+ GL_BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+
GL_DepthMask(true);
GL_DepthTest(false);
- c[0] = (float) ((color >> 24) & 0xFF) * (1.0f / 255.0f) * r_colorscale;
- c[1] = (float) ((color >> 16) & 0xFF) * (1.0f / 255.0f) * r_colorscale;
- c[2] = (float) ((color >> 8) & 0xFF) * (1.0f / 255.0f) * r_colorscale;
+ c[0] = (float) ((color >> 24) & 0xFF) * (1.0f / 255.0f);
+ c[1] = (float) ((color >> 16) & 0xFF) * (1.0f / 255.0f);
+ c[2] = (float) ((color >> 8) & 0xFF) * (1.0f / 255.0f);
c[3] = (float) ( color & 0xFF) * (1.0f / 255.0f);
x = dq->x;
y = dq->y;
break;
case DRAWQUEUE_MESH:
mesh = (void *)(dq + 1);
- GL_VertexPointer(mesh->vertex3f);
- GL_ColorPointer(mesh->color4f);
+ GL_VertexPointer(mesh->data_vertex3f);
+ GL_ColorPointer(mesh->data_color4f);
m.tex[0] = R_GetTexture(mesh->texture);
- m.pointer_texcoord[0] = mesh->texcoord2f;
+ m.pointer_texcoord[0] = mesh->data_texcoord2f;
R_Mesh_State_Texture(&m);
- R_Mesh_Draw(mesh->numvertices, mesh->numtriangles, mesh->element3i);
+ R_Mesh_Draw(mesh->num_vertices, mesh->num_triangles, mesh->data_element3i);
currentpic = "\0";
break;
}
}
else
c[0] = c[1] = c[2] = v_contrast.value;
- VectorScale(c, (float) (1 << v_overbrightbits.integer), c);
if (c[0] >= 1.01f || c[1] >= 1.01f || c[2] >= 1.01f)
{
GL_BlendFunc(GL_DST_COLOR, GL_ONE);