Compare commits

...

7 Commits

Author SHA1 Message Date
fysx 667c4750ea properly load shared libraries 2014-02-11 02:00:33 +01:00
fysx 38727b5c25 beta1 - here we go 2014-02-11 01:03:39 +01:00
fysx 288a851a65 fix for the fix for the non-improvement 2014-02-11 00:42:05 +01:00
fysx 5e3579f680 should fix the crash on startup 2014-02-11 00:26:03 +01:00
fysx 1dd859c9d1 fixed indentations 2014-02-10 08:31:40 +01:00
fysx 53d45533e0 properly using workaround for love.filesystem.getDirectoryItems 2014-02-10 08:30:43 +01:00
fysx 3f13dc653f fixed issue tracker link 2014-02-09 23:57:03 +01:00
6 changed files with 37 additions and 29 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest package="org.love2d.android" <manifest package="org.love2d.android"
android:versionCode="9" android:versionCode="10"
android:versionName="0.9.0-alpha9" android:versionName="0.9.0-beta1"
android:installLocation="auto" xmlns:android="http://schemas.android.com/apk/res/android"> android:installLocation="auto" xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
+6 -1
View File
@@ -27,11 +27,16 @@ Bugs:
----- -----
Bugs and feature requests should be reported to the [issue Bugs and feature requests should be reported to the [issue
tracker](issues?status=new&status=open). tracker](issues).
Changelog: Changelog:
---------- ----------
beta1:
* fixed nasty crash on startup bug
* fixed love.filesystem.getDirectoryItems()
alpha9: alpha9:
* Packaged games do not get duplicated for loading, instead are loaded from memory (!!!) * Packaged games do not get duplicated for loading, instead are loaded from memory (!!!)
+13 -9
View File
@@ -32,18 +32,22 @@ namespace android
double getScreenScale() double getScreenScale()
{ {
JNIEnv *env = (JNIEnv*) SDL_AndroidGetJNIEnv(); static double result = -1.;
jclass activity = (jclass) SDL_AndroidGetActivity(); if (result == -1.) {
jmethodID getMetrics = env->GetStaticMethodID(activity, "getMetrics", "()Landroid/util/DisplayMetrics;"); JNIEnv *env = (JNIEnv*) SDL_AndroidGetJNIEnv();
jobject metrics = env->CallStaticObjectMethod(activity, getMetrics); jclass activity = env->FindClass("org/love2d/android/GameActivity");
jclass metricsClass = env->GetObjectClass(metrics);
double result = env->GetFloatField(metrics, env->GetFieldID(metricsClass, "density", "F")); jmethodID getMetrics = env->GetStaticMethodID(activity, "getMetrics", "()Landroid/util/DisplayMetrics;");
jobject metrics = env->CallStaticObjectMethod(activity, getMetrics);
jclass metricsClass = env->GetObjectClass(metrics);
env->DeleteLocalRef (metricsClass); result = env->GetFloatField(metrics, env->GetFieldID(metricsClass, "density", "F"));
env->DeleteLocalRef (metrics);
env->DeleteLocalRef (activity); env->DeleteLocalRef (metricsClass);
env->DeleteLocalRef (metrics);
env->DeleteLocalRef (activity);
}
return result; return result;
} }
@@ -187,7 +187,7 @@ void Filesystem::init(const char *arg0)
throw Exception(PHYSFS_getLastError()); throw Exception(PHYSFS_getLastError());
#ifdef LOVE_ANDROID #ifdef LOVE_ANDROID
// PHYSFS_permitSymbolicLinks (1); PHYSFS_permitSymbolicLinks (1);
#endif #endif
initialized = true; initialized = true;
@@ -229,19 +229,17 @@ bool Filesystem::setIdentity(const char *ident, bool appendToPath)
save_path_full += save_path_relative; save_path_full += save_path_relative;
#ifdef LOVE_ANDROID #ifdef LOVE_ANDROID
std::string internal_storage_path = SDL_AndroidGetInternalStoragePath(); std::string internal_storage_path = SDL_AndroidGetInternalStoragePath();
std::string save_directory = internal_storage_path + "/save"; std::string save_directory = internal_storage_path + "/save";
save_path_full = std::string(SDL_AndroidGetInternalStoragePath()) + std::string("/save/") + save_identity; save_path_full = std::string(SDL_AndroidGetInternalStoragePath()) + std::string("/save/") + save_identity;
if (androidDirectoryExists (save_path_full.c_str())) {
if (androidDirectoryExists (save_path_full.c_str())) { SDL_Log ("dir exists");
SDL_Log ("dir exists"); } else {
} else { SDL_Log ("does not exist");
SDL_Log ("does not exist"); }
}
if (!androidDirectoryExists (save_path_full.c_str())) { if (!androidDirectoryExists (save_path_full.c_str())) {
if (!androidMkdir (save_path_full.c_str())) { if (!androidMkdir (save_path_full.c_str())) {
+3
View File
@@ -50,6 +50,9 @@ public class SDLActivity extends Activity {
//System.loadLibrary("SDL2_net"); //System.loadLibrary("SDL2_net");
//System.loadLibrary("SDL2_ttf"); //System.loadLibrary("SDL2_ttf");
System.loadLibrary("gnustl_shared"); System.loadLibrary("gnustl_shared");
System.loadLibrary("devil");
System.loadLibrary("mpg123");
System.loadLibrary("openal");
System.loadLibrary("love"); System.loadLibrary("love");
} }
+5 -7
View File
@@ -1,22 +1,20 @@
package org.love2d.android; package org.love2d.android;
import org.libsdl.app.SDLActivity; import org.libsdl.app.SDLActivity;
import android.util.DisplayMetrics;
import android.os.Bundle; import android.os.Bundle;
import android.util.DisplayMetrics;
public class GameActivity extends SDLActivity { public class GameActivity extends SDLActivity {
private static DisplayMetrics metrics = new DisplayMetrics(); private static DisplayMetrics metrics = new DisplayMetrics();
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
getWindowManager().getDefaultDisplay().getMetrics(metrics); getWindowManager().getDefaultDisplay().getMetrics(metrics);
} }
public static DisplayMetrics getMetrics() { public static DisplayMetrics getMetrics() {
return metrics; return metrics;
} }
} }