]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/draw.qc
Fix display of maps with missing previews, add a new option (enabled by default)...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / draw.qc
index ae6967e367565fc02c38f08f57c77ac0ccca706d..0bd4e29fe02c435de2d0c429bf9d82db0f877ae0 100644 (file)
@@ -83,6 +83,17 @@ vector draw_PictureSize(string pic)
        return drawgetimagesize(pic);
 }
 
+bool draw_PictureExists(string pic)
+{
+       pic = draw_UseSkinFor(pic);
+       if (fexists(strcat(pic, ".tga"))) return true;
+       if (fexists(strcat(pic, ".png"))) return true;
+       if (fexists(strcat(pic, ".jpg"))) return true;
+       if (fexists(strcat(pic, ".pcx"))) return true;
+
+       return false;
+}
+
 void draw_Fill(vector theOrigin, vector theSize, vector theColor, float theAlpha)
 {
        drawfill(boxToGlobal(theOrigin, draw_shift, draw_scale), boxToGlobalSize(theSize, draw_scale), theColor, theAlpha * draw_alpha, 0);