Skip to content

Commit b1a9d5f

Browse files
committed
cleanup android backend and normalize settings
1 parent 530c865 commit b1a9d5f

12 files changed

Lines changed: 13 additions & 1358 deletions

File tree

jme3-android-examples/src/main/java/org/jmonkeyengine/jme3androidexamples/JmeFragment.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,4 @@ protected LegacyApplication createApplication() throws Exception {
5252
return (LegacyApplication) clazz.getDeclaredConstructor().newInstance();
5353
}
5454

55-
@Override
56-
protected void configureSettings(AppSettings settings) {
57-
settings.setEmulateMouse(mouseEventsEnabled);
58-
settings.setUseJoysticks(joystickEventsEnabled);
59-
settings.setEmulateKeyboard(keyEventsEnabled);
60-
61-
settings.setBitsPerPixel(24);
62-
settings.setAlphaBits(0);
63-
settings.setGammaCorrection(true);
64-
settings.setDepthBits(16);
65-
settings.setSamples(4);
66-
settings.setStencilBits(0);
67-
settings.setFrameRate(-1);
68-
}
6955
}

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

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,7 @@ public void onCreate(Bundle savedInstanceState) {
9696

9797
try {
9898
app = createApplication();
99-
100-
AppSettings settings = createSettings();
101-
configureSettings(settings);
102-
app.setSettings(settings);
10399
app.start();
104-
105100
OGLESContext context = (OGLESContext) app.getContext();
106101
context.setSystemListener(this);
107102
} catch (Exception exception) {
@@ -117,25 +112,6 @@ public void onCreate(Bundle savedInstanceState) {
117112
*/
118113
protected abstract LegacyApplication createApplication() throws Exception;
119114

120-
/**
121-
* Creates the default Android settings. Subclasses can override this when
122-
* they need to replace the settings object rather than adjust it.
123-
*
124-
* @return default settings for Android
125-
*/
126-
protected AppSettings createSettings() {
127-
AppSettings settings = new AppSettings(true);
128-
settings.setAudioRenderer(AppSettings.ANDROID_OPENAL_SOFT);
129-
return settings;
130-
}
131-
132-
/**
133-
* Customizes the settings before the application starts.
134-
*
135-
* @param settings the settings to customize
136-
*/
137-
protected void configureSettings(AppSettings settings) {
138-
}
139115

140116
@Override
141117
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

jme3-android/src/main/java/com/jme3/system/android/JmeAndroidSystem.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
public class JmeAndroidSystem extends JmeSystemDelegate {
3333

3434
private static View view;
35-
private static String audioRendererType = AppSettings.ANDROID_OPENAL_SOFT;
35+
private static String audioRendererType = AppSettings.OPENAL;
3636

3737
static {
3838
try {
@@ -83,11 +83,11 @@ public JmeContext newContext(AppSettings settings, Type contextType) {
8383
audioRendererType = null;
8484
} else if (settings.getAudioRenderer().equals(AppSettings.ANDROID_MEDIAPLAYER)) {
8585
audioRendererType = AppSettings.ANDROID_MEDIAPLAYER;
86-
} else if (settings.getAudioRenderer().equals(AppSettings.ANDROID_OPENAL_SOFT)) {
86+
} else if (settings.getAudioRenderer().equals(AppSettings.ANDROID_OPENAL_SOFT)||settings.getAudioRenderer().equals(AppSettings.OPENAL)) {
8787
audioRendererType = AppSettings.ANDROID_OPENAL_SOFT;
8888
} else {
8989
logger.log(Level.INFO, "AudioRenderer not set. Defaulting to OpenAL Soft");
90-
audioRendererType = AppSettings.ANDROID_OPENAL_SOFT;
90+
audioRendererType = AppSettings.OPENAL;
9191
}
9292
initialize(settings);
9393
JmeContext ctx = new OGLESContext();

jme3-android/src/main/java/com/jme3/view/package-info.java

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)