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