MCPcopy Create free account
hub / github.com/TurningWheel/Barony / physfsSearchSpritesToUpdate

Function physfsSearchSpritesToUpdate

src/files.cpp:5474–5502  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5472}
5473
5474bool physfsSearchSpritesToUpdate() //TODO: NX PORT: Any changes needed here?
5475{
5476 if ( !PHYSFS_getRealDir("images/sprites.txt") )
5477 {
5478 printlog("error: could not find file: %s", "images/sprites.txt");
5479 return false;
5480 }
5481 std::string spritesDirectory = PHYSFS_getRealDir("images/sprites.txt");
5482 spritesDirectory.append(PHYSFS_getDirSeparator()).append("images/sprites.txt");
5483 File* fp = openDataFile(spritesDirectory.c_str(), "rb");
5484 char name[PATH_MAX];
5485
5486 for ( int c = 0; !fp->eof(); ++c )
5487 {
5488 fp->gets2(name, PATH_MAX);
5489 if ( PHYSFS_getRealDir(name) != nullptr )
5490 {
5491 std::string spritesRealDir = PHYSFS_getRealDir(name);
5492 if ( spritesRealDir.compare("./") != 0 )
5493 {
5494 FileIO::close(fp);
5495 printlog("[PhysFS]: Found modified sprite in sprites/ directory, reloading all sprites...");
5496 return true;
5497 }
5498 }
5499 }
5500 FileIO::close(fp);
5501 return false;
5502}
5503
5504void physfsReloadSprites(bool reloadAll) //TODO: NX PORT: Any changes needed here?
5505{

Callers 1

loadModsMethod · 0.85

Calls 6

printlogFunction · 0.85
openDataFileFunction · 0.85
appendMethod · 0.80
c_strMethod · 0.80
eofMethod · 0.80
gets2Method · 0.80

Tested by

no test coverage detected