Android template improvements
This commit is contained in:
@@ -863,4 +863,4 @@ namespace lime {
|
|||||||
|
|
||||||
#ifdef ANDROID
|
#ifdef ANDROID
|
||||||
int SDL_main (int argc, char *argv[]) { return 0; }
|
int SDL_main (int argc, char *argv[]) { return 0; }
|
||||||
#endif
|
#endif
|
||||||
@@ -15,7 +15,6 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.haxe.extension.Extension;
|
import org.haxe.extension.Extension;
|
||||||
import org.haxe.HXCPP;
|
|
||||||
import org.libsdl.app.SDLActivity;
|
import org.libsdl.app.SDLActivity;
|
||||||
|
|
||||||
|
|
||||||
@@ -28,6 +27,16 @@ public class GameActivity extends SDLActivity {
|
|||||||
public Handler handler;
|
public Handler handler;
|
||||||
|
|
||||||
|
|
||||||
|
protected String[] getLibraries () {
|
||||||
|
|
||||||
|
return new String[] {
|
||||||
|
::foreach ndlls::"::name::",
|
||||||
|
::end::"ApplicationMain"
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override protected void onActivityResult (int requestCode, int resultCode, Intent data) {
|
@Override protected void onActivityResult (int requestCode, int resultCode, Intent data) {
|
||||||
|
|
||||||
for (Extension extension : extensions) {
|
for (Extension extension : extensions) {
|
||||||
@@ -283,7 +292,7 @@ public class GameActivity extends SDLActivity {
|
|||||||
boolean hasBackKey = KeyCharacterMap.deviceHasKey (KeyEvent.KEYCODE_BACK);
|
boolean hasBackKey = KeyCharacterMap.deviceHasKey (KeyEvent.KEYCODE_BACK);
|
||||||
boolean hasHomeKey = KeyCharacterMap.deviceHasKey (KeyEvent.KEYCODE_HOME);
|
boolean hasHomeKey = KeyCharacterMap.deviceHasKey (KeyEvent.KEYCODE_HOME);
|
||||||
|
|
||||||
View decorView = getWindow ().getDecorView ();
|
View decorView = Extension.mainActivity.getWindow ().getDecorView ();
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= 19) {
|
if (Build.VERSION.SDK_INT >= 19) {
|
||||||
|
|
||||||
|
|||||||
@@ -30,8 +30,6 @@ import android.media.*;
|
|||||||
import android.hardware.*;
|
import android.hardware.*;
|
||||||
import android.content.pm.ActivityInfo;
|
import android.content.pm.ActivityInfo;
|
||||||
|
|
||||||
import org.haxe.HXCPP;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
SDL Activity
|
SDL Activity
|
||||||
*/
|
*/
|
||||||
@@ -73,14 +71,12 @@ public class SDLActivity extends Activity {
|
|||||||
*/
|
*/
|
||||||
protected String[] getLibraries() {
|
protected String[] getLibraries() {
|
||||||
return new String[] {
|
return new String[] {
|
||||||
::foreach ndlls::"::name::",
|
"SDL2",
|
||||||
::end::
|
|
||||||
// "SDL2",
|
|
||||||
// "SDL2_image",
|
// "SDL2_image",
|
||||||
// "SDL2_mixer",
|
// "SDL2_mixer",
|
||||||
// "SDL2_net",
|
// "SDL2_net",
|
||||||
// "SDL2_ttf",
|
// "SDL2_ttf",
|
||||||
// "main"
|
"main"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1031,7 +1027,7 @@ class SDLMain implements Runnable {
|
|||||||
// Runs SDL_main()
|
// Runs SDL_main()
|
||||||
SDLActivity.nativeInit(SDLActivity.mSingleton.getArguments());
|
SDLActivity.nativeInit(SDLActivity.mSingleton.getArguments());
|
||||||
|
|
||||||
HXCPP.run ("ApplicationMain");
|
org.haxe.HXCPP.run("ApplicationMain");
|
||||||
//Log.v("SDL", "SDL thread terminated");
|
//Log.v("SDL", "SDL thread terminated");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1378,8 +1374,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
Thread.sleep((Build.VERSION.SDK_INT < Build.VERSION_CODES.FROYO) ? 16 : 1);
|
Thread.sleep((Build.VERSION.SDK_INT < Build.VERSION_CODES.FROYO) ? 16 : 1);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {}
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user