X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=blobdiff_plain;f=gl_draw.c;h=775a150bd2e094a4d2d9f26f185eb707ca489f0f;hp=d2e627d7a8f9420c08d1d0ba053057ccebe80c9e;hb=19fc2b9ed255622fe0bad9841c9fd0b7383988d7;hpb=dc9c3c045d3685a2e32ace6cd30efe05114897fc diff --git a/gl_draw.c b/gl_draw.c index d2e627d7..775a150b 100644 --- a/gl_draw.c +++ b/gl_draw.c @@ -378,7 +378,7 @@ float blendvertex3f[9] = {-5000, -5000, 10, 10000, -5000, 10, -5000, 10000, 10}; 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; @@ -421,21 +421,28 @@ void R_DrawQueue(void) 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 if(dq->flags == DRAWFLAG_2XMODULATE) + GL_BlendFunc(GL_DST_COLOR,GL_SRC_COLOR); + 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; @@ -492,12 +499,12 @@ void R_DrawQueue(void) 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; } @@ -518,7 +525,6 @@ void R_DrawQueue(void) } 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);