mirror of
https://github.com/love2d/love.git
synced 2026-08-12 08:30:56 +02:00
Pass pointer of PHYSFS_AndroidInit struct in Android when initializing PhysFS.
This commit is contained in:
@@ -804,6 +804,15 @@ const char *getCRequirePath()
|
||||
return path;
|
||||
}
|
||||
|
||||
const char *getArg0()
|
||||
{
|
||||
static PHYSFS_AndroidInit androidInit = {
|
||||
SDL_AndroidGetJNIEnv(),
|
||||
SDL_AndroidGetActivity()
|
||||
};
|
||||
return (const char *) &androidInit;
|
||||
}
|
||||
|
||||
} // android
|
||||
} // love
|
||||
|
||||
|
||||
@@ -103,6 +103,12 @@ bool checkFusedGame(void **physfsIO_Out);
|
||||
|
||||
const char *getCRequirePath();
|
||||
|
||||
/**
|
||||
* Retrieve PHYSFS_AndroidInit structure.
|
||||
* @return Pointer to PHYSFS_AndroidInit structure, casted to pointer of char.
|
||||
*/
|
||||
const char *getArg0();
|
||||
|
||||
} // android
|
||||
} // love
|
||||
|
||||
|
||||
@@ -125,10 +125,7 @@ const char *Filesystem::getName() const
|
||||
void Filesystem::init(const char *arg0)
|
||||
{
|
||||
#ifdef LOVE_ANDROID
|
||||
// TODO: This should be a pointer to an initializeed PHYSFS_AndroidInit
|
||||
// struct on android. But it's only used for PHYSFS_getBaseDir and
|
||||
// PHYSFS_getPrefDir, which we don't use right now...
|
||||
arg0 = nullptr;
|
||||
arg0 = love::android::getArg0();
|
||||
#endif
|
||||
|
||||
if (!PHYSFS_init(arg0))
|
||||
|
||||
Reference in New Issue
Block a user