MCPcopy Create free account
hub / github.com/JACoders/OpenJK / IsImageFile

Function IsImageFile

code/ui/ui_main.cpp:2389–2415  ·  view source on GitHub ↗

================= bIsImageFile builds path and scans for valid image extentions ================= */

Source from the content-addressed store, hash-verified

2387=================
2388*/
2389static 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
2417static void UI_FreeSpecies( playerSpeciesInfo_t *species )
2418{

Callers 1

UI_BuildPlayerModel_ListFunction · 0.85

Calls 1

Com_sprintfFunction · 0.50

Tested by

no test coverage detected