Skip to content

Commit 016311c

Browse files
committed
Adapt AndroidHarness to current fragment startup
1 parent 0c94c82 commit 016311c

2 files changed

Lines changed: 7 additions & 15 deletions

File tree

jme3-android/build.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ dependencies {
1818
}
1919

2020
compileJava {
21-
// The Android-Native Project requires the jni headers to be generated, so we do that here
22-
options.compilerArgs += ["-h", "${project.rootDir}/jme3-android-native/src/native/headers"]
2321
options.sourcepath = files("src/androidx-stubs/java")
2422
options.compilerArgs += ["-implicit:none"]
2523
}

jme3-android/src/main/java/com/jme3/app/AndroidHarness.java

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -366,20 +366,10 @@ private AndroidHarness harness() {
366366
protected LegacyApplication createApplication() throws Exception {
367367
AndroidHarness harness = harness();
368368
Class<?> clazz = Class.forName(harness.appClass);
369-
harness.app = (LegacyApplication) clazz.getDeclaredConstructor().newInstance();
370-
return harness.app;
371-
}
372-
373-
@Override
374-
protected AppSettings createSettings() {
375-
AppSettings settings = super.createSettings();
376-
settings.setAudioRenderer(harness().audioRendererType);
377-
return settings;
378-
}
369+
LegacyApplication application = (LegacyApplication) clazz.getDeclaredConstructor().newInstance();
379370

380-
@Override
381-
protected void configureSettings(AppSettings settings) {
382-
AndroidHarness harness = harness();
371+
AppSettings settings = new AppSettings(true);
372+
settings.setAudioRenderer(harness.audioRendererType);
383373
settings.setEmulateMouse(harness.mouseEventsEnabled);
384374
settings.setEmulateMouseFlipAxis(harness.mouseEventsInvertX, harness.mouseEventsInvertY);
385375
settings.setUseJoysticks(harness.joystickEventsEnabled);
@@ -391,6 +381,10 @@ protected void configureSettings(AppSettings settings) {
391381
settings.setSamples(harness.eglSamples);
392382
settings.setStencilBits(harness.eglStencilBits);
393383
settings.setFrameRate(harness.frameRate);
384+
385+
application.setSettings(settings);
386+
harness.app = application;
387+
return application;
394388
}
395389

396390
@Override

0 commit comments

Comments
 (0)