mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-16 07:50:28 +02:00
Misc cleanup
This commit is contained in:
1 parent
5627d82891
commit
cefb57d778
6 files changed
+3
-41
No files matched your search
@@ -0,0 +1 @@
|
||||
org.gradle.jvmargs=-Xmx1536M
|
||||
@@ -48,23 +48,7 @@ public class InputDeviceState {
|
||||
}
|
||||
NativeApp.sendMessage("inputDeviceConnected", device.getName());
|
||||
}
|
||||
|
||||
public static float ProcessAxis(InputDevice.MotionRange range, float axisvalue) {
|
||||
float absaxisvalue = Math.abs(axisvalue);
|
||||
float deadzone = range.getFlat();
|
||||
if (absaxisvalue <= deadzone) {
|
||||
return 0.0f;
|
||||
}
|
||||
float normalizedvalue;
|
||||
if (axisvalue < 0.0f) {
|
||||
normalizedvalue = absaxisvalue / range.getMin();
|
||||
} else {
|
||||
normalizedvalue = absaxisvalue / range.getMax();
|
||||
}
|
||||
|
||||
return normalizedvalue;
|
||||
}
|
||||
|
||||
public boolean onKeyDown(KeyEvent event) {
|
||||
int keyCode = event.getKeyCode();
|
||||
boolean repeat = event.getRepeatCount() > 0;
|
||||
@@ -84,7 +68,6 @@ public class InputDeviceState {
|
||||
for (int i = 0; i < mAxes.length; i++) {
|
||||
int axisId = mAxes[i];
|
||||
float value = event.getAxisValue(axisId);
|
||||
// TODO: Use processAxis or move that to the C++ code
|
||||
NativeApp.joystickAxis(deviceId, axisId, value);
|
||||
}
|
||||
NativeApp.endJoystickEvent();
|
||||
|
||||
@@ -348,7 +348,7 @@ public class NativeActivity extends Activity implements SurfaceHolder.Callback {
|
||||
Log.i(TAG, "Starting the render loop: " + mSurface);
|
||||
// Start emulation using the provided Surface.
|
||||
if (!runEGLRenderLoop(mSurface)) {
|
||||
// TODO: Add an alert dialog or something
|
||||
// Shouldn't happen.
|
||||
Log.e(TAG, "Failed to start up OpenGL");
|
||||
}
|
||||
Log.i(TAG, "Left the render loop: " + mSurface);
|
||||
@@ -507,7 +507,6 @@ public class NativeActivity extends Activity implements SurfaceHolder.Callback {
|
||||
Log.w(TAG, "Joined render loop thread.");
|
||||
mRenderLoopThread = null;
|
||||
} catch (InterruptedException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@@ -866,7 +865,6 @@ public class NativeActivity extends Activity implements SurfaceHolder.Callback {
|
||||
// Fall through
|
||||
default:
|
||||
// send the rest of the keys through.
|
||||
// TODO: get rid of the three special cases above by adjusting the native side of the code.
|
||||
// Log.d(TAG, "Key down: " + keyCode + ", KeyEvent: " + event);
|
||||
return NativeApp.keyUp(0, keyCode);
|
||||
}
|
||||
|
||||
@@ -37,24 +37,6 @@ public class NativeGLView extends GLSurfaceView implements SensorEventListener,
|
||||
super(activity);
|
||||
mActivity = activity;
|
||||
|
||||
/*// TODO: This would be nice.
|
||||
if (Build.VERSION.SDK_INT >= 11) {
|
||||
try {
|
||||
Method method_setPreserveEGLContextOnPause = GLSurfaceView.class.getMethod(
|
||||
"setPreserveEGLContextOnPause", new Class[] { Boolean.class });
|
||||
Log.i(TAG, "Invoking setPreserveEGLContextOnPause");
|
||||
method_setPreserveEGLContextOnPause.invoke(this, true);
|
||||
} catch (NoSuchMethodException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalArgumentException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
} catch (InvocationTargetException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}*/
|
||||
|
||||
mSensorManager = (SensorManager)activity.getSystemService(Activity.SENSOR_SERVICE);
|
||||
mAccelerometer = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
|
||||
|
||||
|
||||
@@ -126,9 +126,8 @@ public class NativeSurfaceView extends SurfaceView implements SensorEventListene
|
||||
mSensorManager.registerListener(this, mAccelerometer, SensorManager.SENSOR_DELAY_GAME);
|
||||
if (mController != null) {
|
||||
mController.onResume();
|
||||
|
||||
// According to the docs, the Moga's state can be inconsistent here.
|
||||
// We should do a one time poll. TODO
|
||||
// Should we do a one time poll?
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@ import android.os.Environment;
|
||||
|
||||
/**
|
||||
* Simple dialog to pick file.
|
||||
* TODO: Use GameBrowser from MainScreen.cpp instead. Then remove this class.
|
||||
*/
|
||||
public class SimpleFileChooser {
|
||||
|
||||
|
||||
Reference in new issue
Block a user