mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-01-18 21:31:16 +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:
|
with:
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
java-version: '17'
|
java-version: '17'
|
||||||
|
|
||||||
- name: Get CMake (Android)
|
- name: Get CMake (Android)
|
||||||
if: ${{ matrix.android }}
|
if: ${{ matrix.android }}
|
||||||
uses: lukka/get-cmake@latest
|
uses: lukka/get-cmake@latest
|
||||||
|
|||||||
@ -10,9 +10,10 @@ 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();
|
||||||
char* savedata = new char[strlen(data) + strlen("/saves/") + 1];
|
size_t len = SDL_strlen(data) + SDL_strlen("/saves/") + 1;
|
||||||
strcpy(savedata, data);
|
char* savedata = new char[len];
|
||||||
strcat(savedata, "/saves/");
|
SDL_strlcpy(savedata, data, len);
|
||||||
|
SDL_strlcat(savedata, "/saves/", len);
|
||||||
|
|
||||||
if (!SDL_GetPathInfo(savedata, NULL)) {
|
if (!SDL_GetPathInfo(savedata, NULL)) {
|
||||||
SDL_CreateDirectory(savedata);
|
SDL_CreateDirectory(savedata);
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
#ifndef ANDROID_CONFIG_H
|
#ifndef ANDROID_CONFIG_H
|
||||||
#define ANDROID_CONFIG_H
|
#define ANDROID_CONFIG_H
|
||||||
|
|
||||||
|
|||||||
@ -1034,9 +1034,10 @@ bool IsleApp::LoadConfig()
|
|||||||
#elif defined(ANDROID)
|
#elif defined(ANDROID)
|
||||||
// SDL_GetAndroidExternalStoragePath() returns without a trailing / resulting in "filesisle.ini" :(
|
// SDL_GetAndroidExternalStoragePath() returns without a trailing / resulting in "filesisle.ini" :(
|
||||||
const char* androidPath = SDL_GetAndroidExternalStoragePath();
|
const char* androidPath = SDL_GetAndroidExternalStoragePath();
|
||||||
char* prefPath = new char[strlen(androidPath) + 2];
|
size_t len = SDL_strlen(androidPath) + 2;
|
||||||
strcpy(prefPath, androidPath);
|
char* prefPath = new char[len];
|
||||||
strcat(prefPath, "/");
|
SDL_strlcpy(prefPath, androidPath, len);
|
||||||
|
SDL_strlcat(prefPath, "/", len);
|
||||||
#else
|
#else
|
||||||
char* prefPath = SDL_GetPrefPath("isledecomp", "isle");
|
char* prefPath = SDL_GetPrefPath("isledecomp", "isle");
|
||||||
#endif
|
#endif
|
||||||
@ -1242,7 +1243,7 @@ bool IsleApp::LoadConfig()
|
|||||||
|
|
||||||
iniparser_freedict(dict);
|
iniparser_freedict(dict);
|
||||||
delete[] iniConfig;
|
delete[] iniConfig;
|
||||||
#if !defined(IOS) && !defined(ANDROID)
|
#ifndef IOS
|
||||||
SDL_free(prefPath);
|
SDL_free(prefPath);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user