]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/xonotic/serverlist.c
Fix commit a4226f7e2fa44bb63541258d1ad1f16f3ba0df2b "Fix typo" that broke g_lsm_regen...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / serverlist.c
index 05cb576e78ec68449f9696ed8f6a79e81172e263..44ca1b227943cf7da354dbe5219f72b387f3fa48 100644 (file)
@@ -608,6 +608,7 @@ void XonoticServerList_drawListBoxItem(entity me, float i, vector absSize, float
 
        s = gethostcachestring(SLIST_FIELD_QCSTATUS, i);
        m = tokenizebyseparator(s, ":");
+       typestr = "";
        if(m >= 2)
        {
                typestr = argv(0);
@@ -616,6 +617,7 @@ void XonoticServerList_drawListBoxItem(entity me, float i, vector absSize, float
        freeslots = -1;
        sflags = -1;
        modname = "";
+       pure = 0;
        for(j = 2; j < m; ++j)
        {
                if(argv(j) == "")
@@ -637,16 +639,20 @@ void XonoticServerList_drawListBoxItem(entity me, float i, vector absSize, float
                modname = "Xonotic";
 #endif
 
+       /*
        SLIST_FIELD_MOD = gethostcacheindexforkey("mod");
        s = gethostcachestring(SLIST_FIELD_MOD, i);
        if(s != "data")
                if(modname == "Xonotic")
                        modname = s;
+       */
 
        // list the mods here on which the pure server check actually works
        if(modname != "Xonotic")
        if(modname != "MinstaGib")
        if(modname != "CTS")
+       if(modname != "NIX")
+       if(modname != "NewToys")
                pure = 0;
 
        if(gethostcachenumber(SLIST_FIELD_FREESLOTS, i) <= 0)
@@ -735,34 +741,44 @@ void XonoticServerList_drawListBoxItem(entity me, float i, vector absSize, float
                iconPos_x = (me.columnIconsSize - 3 * iconSize_x) * 0.5;
                iconPos_y = (1 - iconSize_y) * 0.5;
 
+               string n;
+
                if not(me.seenIPv4 && me.seenIPv6)
                {
                        iconPos_x += iconSize_x * 0.5;
                }
                else if(me.seenIPv4 && me.seenIPv6)
                {
+                       n = string_null;
                        if(isv6)
-                               draw_Picture(iconPos, strcat(SKINGFX_SERVERLIST_ICON, "_ipv6"), iconSize, '1 1 1', 1);
+                               draw_PreloadPictureWithFlags(n = strcat(SKINGFX_SERVERLIST_ICON, "_ipv6"), 0); // PRECACHE_PIC_MIPMAP
                        else if(isv4)
-                               draw_Picture(iconPos, strcat(SKINGFX_SERVERLIST_ICON, "_ipv4"), iconSize, '1 1 1', 1);
+                               draw_PreloadPictureWithFlags(n = strcat(SKINGFX_SERVERLIST_ICON, "_ipv4"), 0); // PRECACHE_PIC_MIPMAP
+                       if(n)
+                               draw_Picture(iconPos, n, iconSize, '1 1 1', 1);
                        iconPos_x += iconSize_x;
                }
 
                if(q > 0)
-                       draw_Picture(iconPos, strcat(SKINGFX_SERVERLIST_ICON, "_aeslevel", ftos(q)), iconSize, '1 1 1', 1);
+               {
+                       draw_PreloadPictureWithFlags(n = strcat(SKINGFX_SERVERLIST_ICON, "_aeslevel", ftos(q)), 0); // PRECACHE_PIC_MIPMAP
+                       draw_Picture(iconPos, n, iconSize, '1 1 1', 1);
+               }
                iconPos_x += iconSize_x;
 
                if(modname == "Xonotic")
                {
                        if(pure == 0)
-                               draw_Picture(iconPos, strcat(SKINGFX_SERVERLIST_ICON, "_pure1"), iconSize, '1 1 1', 1);
+                       {
+                               draw_PreloadPictureWithFlags(n = strcat(SKINGFX_SERVERLIST_ICON, "_pure1"), PRECACHE_PIC_MIPMAP);
+                               draw_Picture(iconPos, n, iconSize, '1 1 1', 1);
+                       }
                }
                else
                {
-                       string n;
-                       n = strcat(SKINGFX_SERVERLIST_ICON, "_mod_", modname);
+                       draw_PreloadPictureWithFlags(n = strcat(SKINGFX_SERVERLIST_ICON, "_mod_", modname), PRECACHE_PIC_MIPMAP);
                        if(draw_PictureSize(n) == '0 0 0')
-                               n = strcat(SKINGFX_SERVERLIST_ICON, "_mod_");
+                               draw_PreloadPictureWithFlags(n = strcat(SKINGFX_SERVERLIST_ICON, "_mod_"), PRECACHE_PIC_MIPMAP);
                        if(pure == 0)
                                draw_Picture(iconPos, n, iconSize, '1 1 1', 1);
                        else
@@ -771,7 +787,10 @@ void XonoticServerList_drawListBoxItem(entity me, float i, vector absSize, float
                iconPos_x += iconSize_x;
 
                if(sflags >= 0 && (sflags & SERVERFLAG_PLAYERSTATS))
-                               draw_Picture(iconPos, strcat(SKINGFX_SERVERLIST_ICON, "_stats1"), iconSize, '1 1 1', 1);
+               {
+                       draw_PreloadPictureWithFlags(n = strcat(SKINGFX_SERVERLIST_ICON, "_stats1"), 0); // PRECACHE_PIC_MIPMAP
+                       draw_Picture(iconPos, n, iconSize, '1 1 1', 1);
+               }
                iconPos_x += iconSize_x;
        }