mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2025-02-01 21:55:01 +01:00
Separate mkdirs from path string generation
This commit is contained in:
parent
029cc9d4b9
commit
c4853688b4
1 changed files with 18 additions and 10 deletions
|
@ -74,17 +74,25 @@ int FILESYSTEM_init(char *argvZero, char* baseDir, char *assetsPath)
|
|||
PHYSFS_setWriteDir(output);
|
||||
printf("Base directory: %s\n", output);
|
||||
|
||||
/* Create save directory */
|
||||
strcpy(saveDir, "saves");
|
||||
strcat(saveDir, PHYSFS_getDirSeparator());
|
||||
mkdirResult = PHYSFS_mkdir(saveDir);
|
||||
printf("Save directory: %s%s\n", output, saveDir);
|
||||
/* Create the save/level folders */
|
||||
mkdirResult |= PHYSFS_mkdir("saves");
|
||||
mkdirResult |= PHYSFS_mkdir("levels");
|
||||
|
||||
/* Create level directory */
|
||||
strcpy(levelDir, "levels");
|
||||
strcat(levelDir, PHYSFS_getDirSeparator());
|
||||
mkdirResult |= PHYSFS_mkdir(levelDir);
|
||||
printf("Level directory: %s%s\n", output, levelDir);
|
||||
/* Store full save directory */
|
||||
SDL_snprintf(saveDir, sizeof(saveDir), "%s%s%s",
|
||||
output,
|
||||
"saves",
|
||||
PHYSFS_getDirSeparator()
|
||||
);
|
||||
printf("Save directory: %s\n", saveDir);
|
||||
|
||||
/* Store full level directory */
|
||||
SDL_snprintf(levelDir, sizeof(levelDir), "%s%s%s",
|
||||
output,
|
||||
"levels",
|
||||
PHYSFS_getDirSeparator()
|
||||
);
|
||||
printf("Level directory: %s\n", levelDir);
|
||||
|
||||
/* We didn't exist until now, migrate files! */
|
||||
if (mkdirResult == 0)
|
||||
|
|
Loading…
Add table
Reference in a new issue