Now, we have a filetype association!!!! :)

This commit is contained in:
Jairo Luiz
2014-02-12 20:56:11 -03:00
parent 667c4750ea
commit 8069dc02c6
5 changed files with 82 additions and 7 deletions
+24
View File
@@ -52,6 +52,30 @@ double getScreenScale()
return result;
}
const char* getSelectedGameFile()
{
static const char *path;
if (!path) {
JNIEnv *env = (JNIEnv*) SDL_AndroidGetJNIEnv();
jclass activity = env->FindClass("org/love2d/android/GameLauncher");
jmethodID getGamePath = env->GetStaticMethodID(activity, "getGamePath", "()Ljava/lang/String;");
jstring gamePath = (jstring) env->CallStaticObjectMethod(activity, getGamePath);
const char *utf = env->GetStringUTFChars(gamePath, 0);
if (utf)
{
path = SDL_strdup(utf);
env->ReleaseStringUTFChars(gamePath, utf);
}
env->DeleteLocalRef (gamePath);
env->DeleteLocalRef (activity);
}
return path;
}
} // android
} // love
+5
View File
@@ -36,6 +36,11 @@ namespace android
**/
double getScreenScale();
/**
* Gets the selected love file in the device filesystem.
**/
const char* getSelectedGameFile();
} // android
} // love