mirror of
https://github.com/izzy2lost/Starship.git
synced 2026-07-05 15:19:42 -07:00
practice SAF coding
This commit is contained in:
@@ -93,6 +93,20 @@ GameEngine::GameEngine() {
|
||||
// Note: Ship::Context will handle directory paths internally
|
||||
// Android: MainActivity handles file management via SAF
|
||||
|
||||
#ifdef __ANDROID__
|
||||
// Wait for MainActivity to finish setting up files via SAF
|
||||
JNIEnv* env = (JNIEnv*)SDL_AndroidGetJNIEnv();
|
||||
if (env) {
|
||||
jclass activityClass = env->FindClass("com/starship/android/MainActivity");
|
||||
if (activityClass) {
|
||||
jmethodID waitMethod = env->GetStaticMethodID(activityClass, "waitForSetupFromNative", "()V");
|
||||
if (waitMethod) {
|
||||
env->CallStaticVoidMethod(activityClass, waitMethod);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// Add sf64.o2r if it exists, otherwise prompt for extraction
|
||||
if (std::filesystem::exists(main_path)) {
|
||||
archiveFiles.push_back(main_path);
|
||||
|
||||
Reference in New Issue
Block a user