|
|
@ -11,7 +11,6 @@ import android.view.Window; |
|
|
|
import android.view.WindowManager; |
|
|
|
import android.view.WindowManager; |
|
|
|
|
|
|
|
|
|
|
|
import com.jme3.app.Application; |
|
|
|
import com.jme3.app.Application; |
|
|
|
import com.jme3.app.android.AndroidApplication; |
|
|
|
|
|
|
|
import com.jme3.input.TouchInput; |
|
|
|
import com.jme3.input.TouchInput; |
|
|
|
import com.jme3.input.android.AndroidInput; |
|
|
|
import com.jme3.input.android.AndroidInput; |
|
|
|
import com.jme3.input.controls.TouchListener; |
|
|
|
import com.jme3.input.controls.TouchListener; |
|
|
@ -38,7 +37,6 @@ public class AndroidHarness extends Activity implements TouchListener, DialogInt |
|
|
|
protected Application app = null; |
|
|
|
protected Application app = null; |
|
|
|
|
|
|
|
|
|
|
|
protected boolean debug = false; |
|
|
|
protected boolean debug = false; |
|
|
|
|
|
|
|
|
|
|
|
final private String ESCAPE_EVENT = "TouchEscape"; |
|
|
|
final private String ESCAPE_EVENT = "TouchEscape"; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -55,15 +53,13 @@ public class AndroidHarness extends Activity implements TouchListener, DialogInt |
|
|
|
AppSettings settings = new AppSettings(true); |
|
|
|
AppSettings settings = new AppSettings(true); |
|
|
|
AndroidInput input = new AndroidInput(this); |
|
|
|
AndroidInput input = new AndroidInput(this); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Create application instance
|
|
|
|
// Create application instance
|
|
|
|
try{ |
|
|
|
try{ |
|
|
|
@SuppressWarnings("unchecked") |
|
|
|
@SuppressWarnings("unchecked") |
|
|
|
Class<? extends Application> clazz = (Class<? extends Application>) Class.forName(appClass); |
|
|
|
Class<? extends Application> clazz = (Class<? extends Application>) Class.forName(appClass); |
|
|
|
app = clazz.newInstance(); |
|
|
|
app = clazz.newInstance(); |
|
|
|
}catch (Exception ex){ |
|
|
|
}catch (Exception ex){ |
|
|
|
ex.printStackTrace(); |
|
|
|
handleError("Class " + appClass + " init failed", ex); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
app.setSettings(settings); |
|
|
|
app.setSettings(settings); |
|
|
@ -78,9 +74,6 @@ public class AndroidHarness extends Activity implements TouchListener, DialogInt |
|
|
|
view = ctx.createView(input); |
|
|
|
view = ctx.createView(input); |
|
|
|
} |
|
|
|
} |
|
|
|
setContentView(view); |
|
|
|
setContentView(view); |
|
|
|
|
|
|
|
|
|
|
|
app.inputManager.addMapping(ESCAPE_EVENT, new TouchTrigger(TouchInput.KEYCODE_BACK)); |
|
|
|
|
|
|
|
app.inputManager.addListener(this, new String[]{ESCAPE_EVENT}); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -125,7 +118,10 @@ public class AndroidHarness extends Activity implements TouchListener, DialogInt |
|
|
|
logger.info("onDestroy"); |
|
|
|
logger.info("onDestroy"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Application getJmeApplication() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return app; |
|
|
|
|
|
|
|
} |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Called when an error has occured. This is typically |
|
|
|
* Called when an error has occured. This is typically |
|
|
|
* invoked when an uncought exception is thrown in the render thread. |
|
|
|
* invoked when an uncought exception is thrown in the render thread. |
|
|
|