mirror of
https://github.com/love2d/love-android.git
synced 2026-08-14 01:20:55 +02:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 667c4750ea | |||
| 38727b5c25 | |||
| 288a851a65 | |||
| 5e3579f680 | |||
| 1dd859c9d1 | |||
| 53d45533e0 | |||
| 3f13dc653f |
+2
-2
@@ -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"/>
|
||||||
|
|||||||
@@ -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 (!!!)
|
||||||
|
|||||||
@@ -32,18 +32,22 @@ namespace android
|
|||||||
|
|
||||||
double getScreenScale()
|
double getScreenScale()
|
||||||
{
|
{
|
||||||
JNIEnv *env = (JNIEnv*) SDL_AndroidGetJNIEnv();
|
static double result = -1.;
|
||||||
|
|
||||||
|
if (result == -1.) {
|
||||||
|
JNIEnv *env = (JNIEnv*) SDL_AndroidGetJNIEnv();
|
||||||
|
jclass activity = env->FindClass("org/love2d/android/GameActivity");
|
||||||
|
|
||||||
jclass activity = (jclass) SDL_AndroidGetActivity();
|
|
||||||
jmethodID getMetrics = env->GetStaticMethodID(activity, "getMetrics", "()Landroid/util/DisplayMetrics;");
|
jmethodID getMetrics = env->GetStaticMethodID(activity, "getMetrics", "()Landroid/util/DisplayMetrics;");
|
||||||
jobject metrics = env->CallStaticObjectMethod(activity, getMetrics);
|
jobject metrics = env->CallStaticObjectMethod(activity, getMetrics);
|
||||||
jclass metricsClass = env->GetObjectClass(metrics);
|
jclass metricsClass = env->GetObjectClass(metrics);
|
||||||
|
|
||||||
double result = env->GetFloatField(metrics, env->GetFieldID(metricsClass, "density", "F"));
|
result = env->GetFloatField(metrics, env->GetFieldID(metricsClass, "density", "F"));
|
||||||
|
|
||||||
env->DeleteLocalRef (metricsClass);
|
env->DeleteLocalRef (metricsClass);
|
||||||
env->DeleteLocalRef (metrics);
|
env->DeleteLocalRef (metrics);
|
||||||
env->DeleteLocalRef (activity);
|
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;
|
||||||
@@ -235,14 +235,12 @@ bool Filesystem::setIdentity(const char *ident, bool appendToPath)
|
|||||||
|
|
||||||
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())) {
|
||||||
SDL_Log ("Error: Could not create save directory %s!", save_path_full.c_str());
|
SDL_Log ("Error: Could not create save directory %s!", save_path_full.c_str());
|
||||||
|
|||||||
@@ -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");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
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
|
||||||
@@ -18,5 +17,4 @@ public class GameActivity extends SDLActivity {
|
|||||||
public static DisplayMetrics getMetrics() {
|
public static DisplayMetrics getMetrics() {
|
||||||
return metrics;
|
return metrics;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user