]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Added a test when freeing textures (glt->image can be NULL if the program exits becau...
authormolivier <molivier@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 19 Oct 2002 09:43:46 +0000 (09:43 +0000)
committermolivier <molivier@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 19 Oct 2002 09:43:46 +0000 (09:43 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@2540 d7cf8633-e32d-0410-b094-e92efae38249

gl_textures.c
host_cmd.c
r_shadow.c

index 558b1f59cb457bfab6721dec5a539c06e0e5c99e..edd0b7dbac9ba494ea1774fe31567f2ca819c61f 100644 (file)
@@ -222,20 +222,23 @@ void R_FreeTexture(rtexture_t *rt)
        // note: if freeing a fragment texture, this will not make the claimed
        // space available for new textures unless all other fragments in the
        // image are also freed
-       image = glt->image;
-       image->texturecount--;
-       if (image->texturecount < 1)
+       if (glt->image)
        {
-               for (gltimagepointer = &glt->pool->imagechain;*gltimagepointer && *gltimagepointer != image;gltimagepointer = &(*gltimagepointer)->imagechain);
-               if (*gltimagepointer == image)
-                       *gltimagepointer = image->imagechain;
-               else
-                       Host_Error("R_FreeTexture: image not linked in pool\n");
-               if (image->texnum)
-                       qglDeleteTextures(1, &image->texnum);
-               if (image->blockallocation)
-                       Mem_Free(image->blockallocation);
-               Mem_Free(image);
+               image = glt->image;
+               image->texturecount--;
+               if (image->texturecount < 1)
+               {
+                       for (gltimagepointer = &glt->pool->imagechain;*gltimagepointer && *gltimagepointer != image;gltimagepointer = &(*gltimagepointer)->imagechain);
+                       if (*gltimagepointer == image)
+                               *gltimagepointer = image->imagechain;
+                       else
+                               Host_Error("R_FreeTexture: image not linked in pool\n");
+                       if (image->texnum)
+                               qglDeleteTextures(1, &image->texnum);
+                       if (image->blockallocation)
+                               Mem_Free(image->blockallocation);
+                       Mem_Free(image);
+               }
        }
 
        if (glt->identifier)
index b026fa8bbfb3e8217d219f840ae148572c79df74..da2705a40f58ec2071e3f4f5f893d80f4b587fb7 100644 (file)
@@ -1533,7 +1533,12 @@ void Host_Startdemos_f (void)
        if (cls.state == ca_dedicated)
        {
                if (!sv.active && !sv_spawnmap[0])
-                       Cbuf_AddText ("map start\n");
+               {
+                       if (gamemode == GAME_TRANSFUSION)
+                               Cbuf_AddText ("map bb1\n");
+                       else
+                               Cbuf_AddText ("map start\n");
+               }
                return;
        }
 
index e6db552961ee2af61932dde5cfc4f3876f69e462..65a1dfe14d2d358cb2e226ce41695792b9c20510 100644 (file)
@@ -225,7 +225,7 @@ void R_Shadow_Volume(int numverts, int numtris, float *vertex, int *elements, in
                        out[5] = e[2] + numverts;
                        out += 6;
                        tris += 2;
-#else if 1
+#elif 1
                        // rear cap
                        out[0] = e[0] + numverts;
                        out[1] = e[1] + numverts;