mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-01-12 02:41:14 +00:00
suggestions
This commit is contained in:
parent
b81d67cf7f
commit
fc2fee33ab
1
.github/workflows/ci.yml
vendored
1
.github/workflows/ci.yml
vendored
@ -113,6 +113,7 @@ jobs:
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '17'
|
||||
|
||||
- name: Get CMake (Android)
|
||||
if: ${{ matrix.android }}
|
||||
uses: lukka/get-cmake@latest
|
||||
|
||||
@ -10,9 +10,10 @@ void Android_SetupDefaultConfigOverrides(dictionary* p_dictionary)
|
||||
SDL_Log("Overriding default config for Android");
|
||||
|
||||
const char* data = SDL_GetAndroidExternalStoragePath();
|
||||
char* savedata = new char[strlen(data) + strlen("/saves/") + 1];
|
||||
strcpy(savedata, data);
|
||||
strcat(savedata, "/saves/");
|
||||
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);
|
||||
|
||||
if (!SDL_GetPathInfo(savedata, NULL)) {
|
||||
SDL_CreateDirectory(savedata);
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
|
||||
#ifndef ANDROID_CONFIG_H
|
||||
#define ANDROID_CONFIG_H
|
||||
|
||||
|
||||
@ -1034,9 +1034,10 @@ bool IsleApp::LoadConfig()
|
||||
#elif defined(ANDROID)
|
||||
// SDL_GetAndroidExternalStoragePath() returns without a trailing / resulting in "filesisle.ini" :(
|
||||
const char* androidPath = SDL_GetAndroidExternalStoragePath();
|
||||
char* prefPath = new char[strlen(androidPath) + 2];
|
||||
strcpy(prefPath, androidPath);
|
||||
strcat(prefPath, "/");
|
||||
size_t len = SDL_strlen(androidPath) + 2;
|
||||
char* prefPath = new char[len];
|
||||
SDL_strlcpy(prefPath, androidPath, len);
|
||||
SDL_strlcat(prefPath, "/", len);
|
||||
#else
|
||||
char* prefPath = SDL_GetPrefPath("isledecomp", "isle");
|
||||
#endif
|
||||
@ -1242,7 +1243,7 @@ bool IsleApp::LoadConfig()
|
||||
|
||||
iniparser_freedict(dict);
|
||||
delete[] iniConfig;
|
||||
#if !defined(IOS) && !defined(ANDROID)
|
||||
#ifndef IOS
|
||||
SDL_free(prefPath);
|
||||
#endif
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user