Remove unused functions, log and comment fixes

This commit is contained in:
Henrik Rydgård 2022-12-22 11:38:36 +01:00
parent d65c7fb05e
commit 6927c44fba
6 changed files with 9 additions and 26 deletions

View file

@ -846,7 +846,6 @@ extern "C" void Java_org_ppsspp_ppsspp_NativeApp_shutdown(JNIEnv *, jclass) {
INFO_LOG(SYSTEM, "NativeApp.shutdown() -- begin");
if (renderer_inited) {
INFO_LOG(G3D, "Shutting down renderer");
// This will be from the wrong thread? :/
graphicsContext->Shutdown();
delete graphicsContext;
graphicsContext = nullptr;
@ -947,10 +946,8 @@ static void recalculateDpi() {
pixel_in_dps_x = (float)pixel_xres / dp_xres;
pixel_in_dps_y = (float)pixel_yres / dp_yres;
INFO_LOG(G3D, "RecalcDPI: display_xres=%d display_yres=%d", display_xres, display_yres);
INFO_LOG(G3D, "RecalcDPI: g_dpi=%f g_dpi_scale_x=%f g_dpi_scale_y=%f", g_dpi, g_dpi_scale_x, g_dpi_scale_y);
INFO_LOG(G3D, "RecalcDPI: dp_xres=%d dp_yres=%d", dp_xres, dp_yres);
INFO_LOG(G3D, "RecalcDPI: pixel_xres=%d pixel_yres=%d", pixel_xres, pixel_yres);
INFO_LOG(G3D, "RecalcDPI: display_xres=%d display_yres=%d pixel_xres=%d pixel_yres=%d", display_xres, display_yres, pixel_xres, pixel_yres);
INFO_LOG(G3D, "RecalcDPI: g_dpi=%f g_dpi_scale_x=%f g_dpi_scale_y=%f dp_xres=%d dp_yres=%d", g_dpi, g_dpi_scale_x, g_dpi_scale_y, dp_xres, dp_yres);
}
extern "C" void JNICALL Java_org_ppsspp_ppsspp_NativeApp_backbufferResize(JNIEnv *, jclass, jint bufw, jint bufh, jint format) {
@ -1109,11 +1106,6 @@ extern "C" jboolean Java_org_ppsspp_ppsspp_NativeApp_keyUp(JNIEnv *, jclass, jin
return NativeKey(keyInput);
}
extern "C" void Java_org_ppsspp_ppsspp_NativeApp_beginJoystickEvent(
JNIEnv *env, jclass) {
// mutex lock?
}
extern "C" jboolean Java_org_ppsspp_ppsspp_NativeApp_joystickAxis(
JNIEnv *env, jclass, jint deviceId, jint axisId, jfloat value) {
if (!renderer_inited)
@ -1127,14 +1119,11 @@ extern "C" jboolean Java_org_ppsspp_ppsspp_NativeApp_joystickAxis(
return NativeAxis(axis);
}
extern "C" void Java_org_ppsspp_ppsspp_NativeApp_endJoystickEvent(
JNIEnv *env, jclass) {
// mutex unlock?
}
extern "C" jboolean Java_org_ppsspp_ppsspp_NativeApp_mouseWheelEvent(
JNIEnv *env, jclass, jint stick, jfloat x, jfloat y) {
if (!renderer_inited)
return false;
// TODO: Support mousewheel for android
return true;
}
@ -1376,6 +1365,7 @@ extern "C" bool JNICALL Java_org_ppsspp_ppsspp_NativeActivity_runEGLRenderLoop(J
display_xres, display_yres, desiredBackbufferSizeX, desiredBackbufferSizeY);
if (!wnd) {
// This shouldn't ever happen.
ERROR_LOG(G3D, "Error: Surface is null.");
renderLoopRunning = false;
return false;
@ -1401,9 +1391,7 @@ extern "C" bool JNICALL Java_org_ppsspp_ppsspp_NativeActivity_runEGLRenderLoop(J
}
graphicsContext->ThreadStart();
renderer_inited = true;
}
if (!exitRenderLoop) {
static bool hasSetThreadName = false;
if (!hasSetThreadName) {
hasSetThreadName = true;

View file

@ -147,13 +147,11 @@ public class InputDeviceState {
if ((event.getSource() & InputDevice.SOURCE_CLASS_JOYSTICK) == 0) {
return false;
}
NativeApp.beginJoystickEvent();
for (int i = 0; i < mAxes.length; i++) {
int axisId = mAxes[i];
float value = event.getAxisValue(axisId);
NativeApp.joystickAxis(deviceId, axisId, value);
}
NativeApp.endJoystickEvent();
return true;
}
}

View file

@ -41,9 +41,7 @@ public class NativeApp {
public static native boolean keyDown(int deviceId, int key, boolean isRepeat);
public static native boolean keyUp(int deviceId, int key);
public static native void beginJoystickEvent();
public static native void joystickAxis(int deviceId, int axis, float value);
public static native void endJoystickEvent();
public static native boolean mouseWheelEvent(float x, float y);

View file

@ -48,7 +48,7 @@ public class NativeGLView extends GLSurfaceView implements SensorEventListener,
Log.i(TAG, "MOGA initialized");
mController.setListener(this, new Handler());
} catch (Exception e) {
Log.i(TAG, "Moga failed to initialize");
// Log.d(TAG, "MOGA failed to initialize");
}
}

View file

@ -10,6 +10,7 @@ import javax.microedition.khronos.egl.EGLContext;
import javax.microedition.khronos.egl.EGLDisplay;
import javax.microedition.khronos.opengles.GL10;
// Only used for the OpenGL backend.
public class NativeRenderer implements GLSurfaceView.Renderer {
private static String TAG = "NativeRenderer";
private NativeActivity mActivity;
@ -35,7 +36,7 @@ public class NativeRenderer implements GLSurfaceView.Renderer {
public void onSurfaceCreated(GL10 gl, EGLConfig config) {
failed = false;
Log.i(TAG, "NativeRenderer: onSurfaceCreated");
Log.i(TAG, "NativeRenderer (OpenGL): onSurfaceCreated");
EGL10 egl = (EGL10)EGLContext.getEGL();
if (egl != null) {

View file

@ -107,7 +107,6 @@ public class PpssppActivity extends NativeActivity {
} else {
String param = getIntent().getStringExtra(SHORTCUT_EXTRA_KEY);
String args = getIntent().getStringExtra(ARGS_EXTRA_KEY);
Log.e(TAG, "Got ACTION_VIEW without a valid uri, trying param");
if (param != null) {
Log.i(TAG, "Found Shortcut Parameter in extra-data: " + param);
super.setShortcutParam("\"" + param.replace("\\", "\\\\").replace("\"", "\\\"") + "\"");
@ -115,7 +114,6 @@ public class PpssppActivity extends NativeActivity {
Log.i(TAG, "Found args parameter in extra-data: " + args);
super.setShortcutParam(args);
} else {
Log.e(TAG, "Shortcut missing parameter!");
super.setShortcutParam("");
}
}