From 7b22fd1cc40096901d7a57d2fbf2927d69622ec9 Mon Sep 17 00:00:00 2001 From: Joshua Granick Date: Fri, 5 Aug 2016 11:30:48 -0700 Subject: [PATCH] Fix Android crash in System directory check (resolve openfl/openfl#1219) --- project/src/backend/sdl/SDLSystem.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/project/src/backend/sdl/SDLSystem.cpp b/project/src/backend/sdl/SDLSystem.cpp index e5c0d30ee..f1e47ef5a 100644 --- a/project/src/backend/sdl/SDLSystem.cpp +++ b/project/src/backend/sdl/SDLSystem.cpp @@ -117,7 +117,7 @@ namespace lime { SHGetFolderPath (NULL, CSIDL_DESKTOPDIRECTORY, NULL, SHGFP_TYPE_CURRENT, result); return WIN_StringToUTF8 (result); - #else + #elseif !defined (ANDROID) std::string result = std::string (getenv ("HOME")) + std::string ("/Desktop"); return result.c_str (); @@ -142,6 +142,10 @@ namespace lime { SHGetFolderPath (NULL, CSIDL_MYDOCUMENTS, NULL, SHGFP_TYPE_CURRENT, result); return WIN_StringToUTF8 (result); + #elif defined (ANDROID) + + return "/mnt/sdcard/Documents"; + #else std::string result = std::string (getenv ("HOME")) + std::string ("/Documents"); @@ -204,6 +208,10 @@ namespace lime { SHGetFolderPath (NULL, CSIDL_PROFILE, NULL, SHGFP_TYPE_CURRENT, result); return WIN_StringToUTF8 (result); + #elif defined (ANDROID) + + return "/mnt/sdcard"; + #else std::string result = getenv ("HOME");