From: Rudolf Polzer Date: Mon, 18 Oct 2010 12:13:31 +0000 (+0200) Subject: also support JPEG waypointsprites X-Git-Tag: xonotic-v0.1.0preview~289 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=41a037997dc89b6b50b1974fea236832a7fed387;p=xonotic%2Fxonotic-data.pk3dir.git also support JPEG waypointsprites --- diff --git a/qcsrc/client/waypointsprites.qc b/qcsrc/client/waypointsprites.qc index a001732da..07e912782 100644 --- a/qcsrc/client/waypointsprites.qc +++ b/qcsrc/client/waypointsprites.qc @@ -431,6 +431,7 @@ 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) @@ -445,6 +446,21 @@ void WaypointSprite_Load() 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)); + 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); } waypointsprite_initialized = 1; }