mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-11-12 14:09:43 +01:00
Move assetdir off of Graphics
It's only used in FileSystemUtils and never anywhere else, especially not Graphics. Why is this on Graphics again? It's now a static variable inside FileSystemUtils. It has also been renamed to assetDir for consistency with saveDir and levelDir. Also, it's a C string now, and is no longer an STL string.
This commit is contained in:
parent
22ced8b59b
commit
b4dd516d7d
2 changed files with 8 additions and 7 deletions
|
@ -26,6 +26,8 @@
|
|||
static char saveDir[MAX_PATH] = {'\0'};
|
||||
static char levelDir[MAX_PATH] = {'\0'};
|
||||
|
||||
static char assetDir[MAX_PATH] = {'\0'};
|
||||
|
||||
static void PLATFORM_getOSDirectory(char* output);
|
||||
static void PLATFORM_migrateSaveData(char* output);
|
||||
static void PLATFORM_copyFile(const char *oldLocation, const char *newLocation);
|
||||
|
@ -221,7 +223,7 @@ void FILESYSTEM_mount(const char *fname)
|
|||
}
|
||||
else
|
||||
{
|
||||
graphics.assetdir = std::string(path);
|
||||
SDL_strlcpy(assetDir, path, sizeof(assetDir));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -318,7 +320,7 @@ void FILESYSTEM_mountassets(const char* path)
|
|||
}
|
||||
else
|
||||
{
|
||||
graphics.assetdir = std::string(zip_data);
|
||||
SDL_strlcpy(assetDir, zip_data, sizeof(assetDir));
|
||||
}
|
||||
|
||||
FILESYSTEM_assetsmounted = true;
|
||||
|
@ -345,11 +347,11 @@ void FILESYSTEM_mountassets(const char* path)
|
|||
|
||||
void FILESYSTEM_unmountassets(void)
|
||||
{
|
||||
if (graphics.assetdir != "")
|
||||
if (assetDir[0] != '\0')
|
||||
{
|
||||
printf("Unmounting %s\n", graphics.assetdir.c_str());
|
||||
PHYSFS_unmount(graphics.assetdir.c_str());
|
||||
graphics.assetdir = "";
|
||||
printf("Unmounting %s\n", assetDir);
|
||||
PHYSFS_unmount(assetDir);
|
||||
assetDir[0] = '\0';
|
||||
graphics.reloadresources();
|
||||
}
|
||||
else
|
||||
|
|
|
@ -184,7 +184,6 @@ public:
|
|||
bool onscreen(int t);
|
||||
|
||||
void reloadresources(void);
|
||||
std::string assetdir;
|
||||
|
||||
|
||||
void menuoffrender(void);
|
||||
|
|
Loading…
Reference in a new issue