mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-01-20 14:11:16 +00:00
use MxString
This commit is contained in:
parent
434afbe084
commit
45f1777de1
@ -1,5 +1,7 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
#include "mxstring.h"
|
||||||
|
|
||||||
#include <SDL3/SDL_filesystem.h>
|
#include <SDL3/SDL_filesystem.h>
|
||||||
#include <SDL3/SDL_log.h>
|
#include <SDL3/SDL_log.h>
|
||||||
#include <SDL3/SDL_system.h>
|
#include <SDL3/SDL_system.h>
|
||||||
@ -10,20 +12,17 @@ void Android_SetupDefaultConfigOverrides(dictionary* p_dictionary)
|
|||||||
SDL_Log("Overriding default config for Android");
|
SDL_Log("Overriding default config for Android");
|
||||||
|
|
||||||
const char* data = SDL_GetAndroidExternalStoragePath();
|
const char* data = SDL_GetAndroidExternalStoragePath();
|
||||||
size_t len = SDL_strlen(data) + SDL_strlen("/saves/") + 1;
|
MxString savedata = MxString(data) + "/saves/";
|
||||||
char* savedata = new char[len];
|
|
||||||
SDL_strlcpy(savedata, data, len);
|
|
||||||
SDL_strlcat(savedata, "/saves/", len);
|
|
||||||
|
|
||||||
if (!SDL_GetPathInfo(savedata, NULL)) {
|
if (!SDL_GetPathInfo(savedata.GetData(), NULL)) {
|
||||||
SDL_CreateDirectory(savedata);
|
SDL_CreateDirectory(savedata.GetData());
|
||||||
}
|
}
|
||||||
|
|
||||||
iniparser_set(p_dictionary, "isle:diskpath", data);
|
iniparser_set(p_dictionary, "isle:diskpath", data);
|
||||||
iniparser_set(p_dictionary, "isle:cdpath", data);
|
iniparser_set(p_dictionary, "isle:cdpath", data);
|
||||||
iniparser_set(p_dictionary, "isle:mediapath", data);
|
iniparser_set(p_dictionary, "isle:mediapath", data);
|
||||||
|
|
||||||
iniparser_set(p_dictionary, "isle:savepath", savedata);
|
iniparser_set(p_dictionary, "isle:savepath", savedata.GetData());
|
||||||
|
|
||||||
// Default to Virtual Mouse
|
// Default to Virtual Mouse
|
||||||
char buf[16];
|
char buf[16];
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user