mirror of
https://github.com/blupi-games/planetblupi
synced 2024-12-30 10:15:36 +01:00
Fix base path initializing on Android
This commit is contained in:
parent
dcadfe1c38
commit
5c8bd3ac27
@ -109,8 +109,9 @@ std::string
|
||||
GetShareDir ()
|
||||
{
|
||||
static std::string basePath;
|
||||
static bool inited = false;
|
||||
|
||||
if (!basePath.size ())
|
||||
if (!inited)
|
||||
{
|
||||
auto sdlBasePath = SDL_GetBasePath ();
|
||||
if (!sdlBasePath)
|
||||
@ -123,6 +124,7 @@ GetShareDir ()
|
||||
std::replace (basePath.begin (), basePath.end (), '\\', '/');
|
||||
basePath = basePath.substr (0, basePath.find_last_of ("//") + 1);
|
||||
SDL_free (sdlBasePath);
|
||||
inited = true;
|
||||
}
|
||||
|
||||
return basePath + "share/";
|
||||
|
Loading…
x
Reference in New Issue
Block a user