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