]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_draw.c
r_refdef.vieworg and r_refdef.viewangles replaced by r_refdef.viewentitymatrix
[xonotic/darkplaces.git] / gl_draw.c
index 775a150bd2e094a4d2d9f26f185eb707ca489f0f..7ba2282e38eb8bc0eff765055c6a3e6abd87ff38 100644 (file)
--- a/gl_draw.c
+++ b/gl_draw.c
@@ -328,7 +328,7 @@ void Draw_FreePic(char *picname)
        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;
@@ -507,6 +507,24 @@ void R_DrawQueue(void)
                        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;                          
                }
        }