hashkey = ((crc >> 8) ^ crc) % CACHEPICHASHSIZE;
for (pic = cachepichash[hashkey];pic;pic = pic->chain)
{
- if (!strcmp (picname, pic->name))
+ if (!strcmp (picname, pic->name) && pic->tex)
{
R_FreeTexture(pic->tex);
pic->width = 0;
{
dq = (drawqueue_t *)(r_refdef.drawqueue + pos);
color = dq->color;
-
- if(dq->flags & DRAWFLAG_ADDITIVE)
+
+ if(dq->flags == DRAWFLAG_ADDITIVE)
GL_BlendFunc(GL_SRC_ALPHA, GL_ONE);
- else if(dq->flags & DRAWFLAG_MODULATE)
+ 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);
R_Mesh_Draw(mesh->num_vertices, mesh->num_triangles, mesh->data_element3i);
currentpic = "\0";
break;
+ case DRAWQUEUE_SETCLIP:
+ {
+ // We have to convert the con coords into real coords
+ int x , y, width, height;
+ x = dq->x * ((float)vid.realwidth / vid.conwidth);
+ // OGL uses top to bottom
+ y = dq->y * ((float) vid.realheight / vid.conheight);
+ width = dq->scalex * ((float)vid.realwidth / vid.conwidth);
+ height = dq->scaley * ((float)vid.realheight / vid.conheight);
+
+ GL_Scissor(x, y, width, height);
+
+ GL_ScissorTest(true);
+ }
+ break;
+ case DRAWQUEUE_RESETCLIP:
+ GL_ScissorTest(false);
+ break;
}
}