]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Improve menu performance with Quake 3 maps installed
authorMario <mario.mario@y7mail.com>
Wed, 29 Jan 2025 18:25:28 +0000 (18:25 +0000)
committerterencehill <piuntn@gmail.com>
Wed, 29 Jan 2025 18:25:28 +0000 (18:25 +0000)
qcsrc/menu/xonotic/maplist.qc

index 84e408196674a1d4f2eb9307da91c5d721dc150e..e65ff7fa8d42aab5c87da1afa4f1bf8ed2542ad7 100644 (file)
@@ -158,7 +158,7 @@ void XonoticMapList_drawListBoxItem(entity me, int i, vector absSize, bool isSel
 
        if(draw_PictureSize(strcat("/maps/", MapInfo_Map_bspname)) == '0 0 0')
        {
-               if(!draw_PictureExists(strcat("/levelshots/", MapInfo_Map_bspname)))
+               if(draw_PictureSize(strcat("/levelshots/", MapInfo_Map_bspname)) == '0 0 0')
                        draw_Picture(me.columnPreviewOrigin * eX, "nopreview_map", me.columnPreviewSize * eX + eY, '1 1 1', theAlpha);
                else
                        draw_Picture(me.columnPreviewOrigin * eX, strcat("/levelshots/", MapInfo_Map_bspname), me.columnPreviewSize * eX + eY, '1 1 1', theAlpha);
@@ -188,7 +188,10 @@ void XonoticMapList_refilter(entity me)
        me.nItems = MapInfo_count;
 
        for(i = 0; i < MapInfo_count; ++i)
-               draw_PreloadPicture(strcat("/maps/", MapInfo_BSPName_ByID(i)));
+       {
+               if(draw_PreloadPicture(strcat("/maps/", MapInfo_BSPName_ByID(i))) == "")
+                       draw_PreloadPicture(strcat("/levelshots/", MapInfo_BSPName_ByID(i)));
+       }
        s = "0";
        for(i = 1; i < MapInfo_count; i *= 2)
                s = strcat(s, s);