X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fclient%2Fwaypointsprites.qc;h=07e9127827dc0131c43a9874c4e4bfca87f23e2c;hp=db0fdb83fd81a3dd46293211d9eca60df94157ad;hb=4fc59bbd7e2d4f25ba21952ed50ae754295a7faa;hpb=16c35f41a25bb2edf3d4b7d664049d2923000f96 diff --git a/qcsrc/client/waypointsprites.qc b/qcsrc/client/waypointsprites.qc index db0fdb83fd..07e9127827 100644 --- a/qcsrc/client/waypointsprites.qc +++ b/qcsrc/client/waypointsprites.qc @@ -166,7 +166,7 @@ void Draw_WaypointSprite() dist = vlen(self.origin - view_origin); float a; - a = self.alpha * hud_fg_alpha; + a = self.alpha * autocvar_hud_panel_fg_alpha; if(self.maxdistance > waypointsprite_normdistance) a *= pow(bound(0, (self.maxdistance - dist) / (self.maxdistance - waypointsprite_normdistance), 1), waypointsprite_distancealphaexponent); @@ -431,16 +431,28 @@ void WaypointSprite_Load() { 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));