================= bIsImageFile builds path and scans for valid image extentions ================= */
| 2387 | ================= |
| 2388 | */ |
| 2389 | static qboolean IsImageFile(const char* dirptr, const char* skinname, qboolean building) |
| 2390 | { |
| 2391 | char fpath[MAX_QPATH]; |
| 2392 | int f; |
| 2393 | |
| 2394 | |
| 2395 | Com_sprintf(fpath, MAX_QPATH, "models/players/%s/icon_%s.jpg", dirptr, skinname); |
| 2396 | ui.FS_FOpenFile(fpath, &f, FS_READ); |
| 2397 | if (!f) |
| 2398 | { //not there, try png |
| 2399 | Com_sprintf(fpath, MAX_QPATH, "models/players/%s/icon_%s.png", dirptr, skinname); |
| 2400 | ui.FS_FOpenFile(fpath, &f, FS_READ); |
| 2401 | } |
| 2402 | if (!f) |
| 2403 | { //not there, try tga |
| 2404 | Com_sprintf(fpath, MAX_QPATH, "models/players/%s/icon_%s.tga", dirptr, skinname); |
| 2405 | ui.FS_FOpenFile(fpath, &f, FS_READ); |
| 2406 | } |
| 2407 | if (f) |
| 2408 | { |
| 2409 | ui.FS_FCloseFile(f); |
| 2410 | if ( building ) ui.R_RegisterShaderNoMip(fpath); |
| 2411 | return qtrue; |
| 2412 | } |
| 2413 | |
| 2414 | return qfalse; |
| 2415 | } |
| 2416 | |
| 2417 | static void UI_FreeSpecies( playerSpeciesInfo_t *species ) |
| 2418 | { |
no test coverage detected