mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-31 10:14:40 +03:00
Refactor endsWith() to not use the STL
There's not really any reason for this function to use heap-allocated strings. So I've refactored it to not do that. I would've used SDL_strrstr(), if it existed. It does not appear to exist. But that's okay.
This commit is contained in:
@@ -204,7 +204,7 @@ void FILESYSTEM_mountassets(const char* path)
|
||||
FILESYSTEM_mount(zippath.c_str());
|
||||
graphics.reloadresources();
|
||||
FILESYSTEM_assetsmounted = true;
|
||||
} else if (zip_path != "data.zip" && !endsWith(zip_path, "/data.zip") && endsWith(zip_path, ".zip")) {
|
||||
} else if (zip_path != "data.zip" && !endsWith(zip_path.c_str(), "/data.zip") && endsWith(zip_path.c_str(), ".zip")) {
|
||||
printf("Custom asset directory is .zip at %s\n", zip_path.c_str());
|
||||
PHYSFS_File* zip = PHYSFS_openRead(zip_path.c_str());
|
||||
zip_path += ".data.zip";
|
||||
|
||||
Reference in New Issue
Block a user