MCPcopy Create free account
hub / github.com/ZDoom/Raze / CheckIfResourceFileLoaded

Method CheckIfResourceFileLoaded

source/common/filesystem/source/filesystem.cpp:418–444  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

416//==========================================================================
417
418int FileSystem::CheckIfResourceFileLoaded (const char *name) noexcept
419{
420 unsigned int i;
421
422 if (strrchr (name, '/') != NULL)
423 {
424 for (i = 0; i < (unsigned)Files.size(); ++i)
425 {
426 if (stricmp (GetResourceFileFullName (i), name) == 0)
427 {
428 return i;
429 }
430 }
431 }
432 else
433 {
434 for (i = 0; i < (unsigned)Files.size(); ++i)
435 {
436 auto pth = ExtractBaseName(GetResourceFileName(i), true);
437 if (stricmp (pth.c_str(), name) == 0)
438 {
439 return i;
440 }
441 }
442 }
443 return -1;
444}
445
446//==========================================================================
447//

Callers 2

CheckSingleFileFunction · 0.80
CCMDFunction · 0.80

Calls 4

stricmpFunction · 0.85
ExtractBaseNameFunction · 0.85
c_strMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected