X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Fwaypointsprites.qc;h=816a2e4851eb8827eee5505e67e91f99b1e65844;hb=a60cee16752e5abd387f6b7cd7d826b4f0321d05;hp=d7b9ee9d01960829aa3992dcebec4eb6bb7e84c8;hpb=fc4ffd914a2b01d1d8724ea1982e5c1de1bfdaeb;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/waypointsprites.qc b/qcsrc/client/waypointsprites.qc index d7b9ee9d0..816a2e485 100644 --- a/qcsrc/client/waypointsprites.qc +++ b/qcsrc/client/waypointsprites.qc @@ -425,22 +425,34 @@ void WaypointSprite_Load() waypointsprite_distancefadealpha = cvar_or("g_waypointsprite_distancefadealpha", 1); waypointsprite_distancefadescale = cvar_or("g_waypointsprite_distancefadescale", 1); waypointsprite_distancefadedistance = vlen(mi_max - mi_min) * cvar_or("g_waypointsprite_distancefadedistancemultiplier", 1); - waypointsprite_alpha = cvar_or("g_waypointsprite_alpha", 1) * (1 - cvar("_menu_alpha")); + waypointsprite_alpha = cvar_or("g_waypointsprite_alpha", 1) * (1 - autocvar__menu_alpha); if(!waypointsprite_initialized) { float dh, n, i, o, f; string s, sname, sframes; + dh = search_begin("models/sprites/*_frame*.tga", FALSE, FALSE); n = search_getsize(dh); for(i = 0; i < n; ++i) { s = search_getfilename(dh, i); - if(substring(s, 0, 15) != "models/sprites/") - continue; - if(substring(s, strlen(s) - 4, 4) != ".tga") - continue; - s = substring(s, 15, strlen(s) - 19); + s = substring(s, 15, strlen(s) - 15 - 4); // strip models/sprites/ and .tga + + o = strstrofs(s, "_frame", 0); + sname = strcat("/spriteframes/", substring(s, 0, o)); + sframes = substring(s, o + 6, strlen(s) - o - 6); + f = stof(sframes) + 1; + db_put(tempdb, sname, ftos(max(f, stof(db_get(tempdb, sname))))); + } + search_end(dh); + + dh = search_begin("models/sprites/*_frame*.jpg", FALSE, FALSE); + n = search_getsize(dh); + for(i = 0; i < n; ++i) + { + s = search_getfilename(dh, i); + s = substring(s, 15, strlen(s) - 15 - 4); // strip models/sprites/ and .jpg o = strstrofs(s, "_frame", 0); sname = strcat("/spriteframes/", substring(s, 0, o));