]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_draw.c
changed most Sys_Error calls to Con_Printf with appropriate error returns
[xonotic/darkplaces.git] / gl_draw.c
index 3c1c394bda53ebc37fe5738f9aa5769d26c31304..d1dbbf4a27b75641411fa97df2d4024e3ee3ff6e 100644 (file)
--- a/gl_draw.c
+++ b/gl_draw.c
@@ -310,7 +310,11 @@ cachepic_t *Draw_CachePic (const char *path, qboolean persistent)
                        return pic;
 
        if (numcachepics == MAX_CACHED_PICS)
                        return pic;
 
        if (numcachepics == MAX_CACHED_PICS)
-               Sys_Error ("numcachepics == MAX_CACHED_PICS");
+       {
+               Con_Printf ("Draw_CachePic: numcachepics == MAX_CACHED_PICS");
+               // FIXME: support NULL in callers?
+               return cachepics; // return the first one
+       }
        pic = cachepics + (numcachepics++);
        strlcpy (pic->name, path, sizeof(pic->name));
        // link into list
        pic = cachepics + (numcachepics++);
        strlcpy (pic->name, path, sizeof(pic->name));
        // link into list
@@ -400,7 +404,11 @@ cachepic_t *Draw_NewPic(const char *picname, int width, int height, int alpha, q
                if (pic == NULL)
                {
                        if (numcachepics == MAX_CACHED_PICS)
                if (pic == NULL)
                {
                        if (numcachepics == MAX_CACHED_PICS)
-                               Sys_Error ("numcachepics == MAX_CACHED_PICS");
+                       {
+                               Con_Printf ("Draw_NewPic: numcachepics == MAX_CACHED_PICS");
+                               // FIXME: support NULL in callers?
+                               return cachepics; // return the first one
+                       }
                        pic = cachepics + (numcachepics++);
                        strcpy (pic->name, picname);
                        // link into list
                        pic = cachepics + (numcachepics++);
                        strcpy (pic->name, picname);
                        // link into list