From: Holger Schemel Date: Tue, 27 Jun 2017 17:58:55 +0000 (+0200) Subject: changed using 'external' app data directory on Android version, if possible X-Git-Tag: 4.0.1.0~40 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=17c100ba4bca1cf8475905b6eeb502e581489c5c;p=rocksndiamonds.git changed using 'external' app data directory on Android version, if possible --- diff --git a/src/init.c b/src/init.c index 731bdd19..ea7c8f9a 100644 --- a/src/init.c +++ b/src/init.c @@ -6074,10 +6074,10 @@ void OpenAll() Error(ERR_DEBUG, "::: SDL_AndroidGetExternalStoragePath() == '%s'", SDL_AndroidGetExternalStoragePath()); Error(ERR_DEBUG, "::: SDL_AndroidGetExternalStorageState() == '%s'", - (SDL_AndroidGetExternalStorageState() == - SDL_ANDROID_EXTERNAL_STORAGE_READ ? "read" : - SDL_AndroidGetExternalStorageState() == - SDL_ANDROID_EXTERNAL_STORAGE_WRITE ? "write" : "not available")); + (SDL_AndroidGetExternalStorageState() & + SDL_ANDROID_EXTERNAL_STORAGE_WRITE ? "writable" : + SDL_AndroidGetExternalStorageState() & + SDL_ANDROID_EXTERNAL_STORAGE_READ ? "readable" : "not available")); #endif #endif } diff --git a/src/libgame/setup.c b/src/libgame/setup.c index 03d9bfd8..ced73a83 100644 --- a/src/libgame/setup.c +++ b/src/libgame/setup.c @@ -1400,7 +1400,10 @@ char *getUserGameDataDir(void) #if defined(PLATFORM_ANDROID) if (user_game_data_dir == NULL) - user_game_data_dir = (char *)SDL_AndroidGetInternalStoragePath(); + user_game_data_dir = (char *)(SDL_AndroidGetExternalStorageState() & + SDL_ANDROID_EXTERNAL_STORAGE_WRITE ? + SDL_AndroidGetExternalStoragePath() : + SDL_AndroidGetInternalStoragePath()); #else if (user_game_data_dir == NULL) user_game_data_dir = getPath2(getPersonalDataDir(),