Skip to content

Commit

Permalink
Merge branch 'Pojav-Input' of https://github.com/QuestCraftPlusPlus/P…
Browse files Browse the repository at this point in the history
…ojlib into Testing
  • Loading branch information
Cartrigger committed Sep 10, 2024
2 parents 3918b10 + 0d58d6a commit 150ec8c
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ android {
compileSdkVersion = "android-32"
defaultConfig {
minSdk 32

multiDexEnabled true
ndk.stl = "c++_shared"
}

Expand Down
Binary file modified src/main/assets/lwjgl/lwjgl-glfw-classes.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion src/main/assets/lwjgl/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1725945217571
1725986487354
2 changes: 1 addition & 1 deletion src/main/assets/optionsviveprofiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
"chatNotificationSound": "block.note_block.bell",
"jumpThreshold": "0.05",
"movementSpeedMultiplier": "1.0",
"seated": "false",
"seated": "true",
"doubleGUIResolution": "false",
"physicalKeyboardTheme": "DEFAULT",
"rightclickDelay": "VANILLA",
Expand Down
39 changes: 21 additions & 18 deletions src/main/java/pojlib/UnityPlayerActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
import android.view.MotionEvent;
import android.view.Window;

import androidx.annotation.RequiresApi;

import com.unity3d.player.IUnityPlayerLifecycleEvents;
import com.unity3d.player.UnityPlayer;

Expand All @@ -38,28 +36,15 @@
import pojlib.input.gamepad.DefaultDataProvider;
import pojlib.input.gamepad.Gamepad;
import pojlib.util.FileUtil;
import pojlib.util.Logger;

public class UnityPlayerActivity extends ActivityGroup implements IUnityPlayerLifecycleEvents, GrabListener
{
protected UnityPlayer mUnityPlayer; // don't change the name of this variable; referenced from native code
public static volatile ClipboardManager GLOBAL_CLIPBOARD;
private Gamepad mGamepad = null;

private final RemapperManager mInputManager = new RemapperManager(this, new RemapperView.Builder(null)
.remapA(true)
.remapB(true)
.remapX(true)
.remapY(true)

.remapLeftJoystick(true)
.remapRightJoystick(true)
.remapStart(true)
.remapSelect(true)
.remapLeftShoulder(true)
.remapRightShoulder(true)
.remapLeftTrigger(true)
.remapRightTrigger(true)
.remapDpad(true));
private RemapperManager mInputManager;

private boolean mLastGrabState = false;

Expand Down Expand Up @@ -102,6 +87,24 @@ protected String updateUnityCommandLineArguments(String cmdLine)

updateWindowSize(this);
GLOBAL_CLIPBOARD = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);

mInputManager = new RemapperManager(this, new RemapperView.Builder(null)
.remapA(true)
.remapB(true)
.remapX(true)
.remapY(true)

.remapLeftJoystick(true)
.remapRightJoystick(true)
.remapStart(true)
.remapSelect(true)
.remapLeftShoulder(true)
.remapRightShoulder(true)
.remapLeftTrigger(true)
.remapRightTrigger(true)
.remapDpad(true));

CallbackBridge.nativeSetUseInputStackQueue(true);
}

public static DisplayMetrics getDisplayMetrics(Activity activity) {
Expand Down Expand Up @@ -228,7 +231,7 @@ public boolean dispatchKeyEvent(KeyEvent event) {

/** The event for keyboard/ gamepad button inputs */
public boolean processKeyEvent(KeyEvent event) {
//Log.i("KeyEvent", event.toString());
// Logger.getInstance().appendToLog("KeyEvent " + event.toString());

//Filtering useless events by order of probability
int eventKeycode = event.getKeyCode();
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/pojlib/input/gamepad/Gamepad.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
public class Gamepad implements GrabListener, GamepadHandler {

/* Resolution scaler option, allow downsizing a window */
private final float mScaleFactor = 0; // LauncherPreferences.DEFAULT_PREF.getInt("resolutionRatio",100)/100f;
private final float mScaleFactor = 1; // LauncherPreferences.DEFAULT_PREF.getInt("resolutionRatio",100)/100f;

/* Sensitivity, adjusted according to screen size */
private final double mSensitivityFactor = (1.4 * (1080f/ currentDisplayMetrics.heightPixels));
Expand Down Expand Up @@ -79,7 +79,7 @@ public class Gamepad implements GrabListener, GamepadHandler {
private final GamepadDataProvider mMapProvider;

public Gamepad(InputDevice inputDevice, GamepadDataProvider mapProvider){
Settings.setDeadzoneScale(100f);
Settings.setDeadzoneScale(1f);

mScreenChoreographer = Choreographer.getInstance();
Choreographer.FrameCallback frameCallback = new Choreographer.FrameCallback() {
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/pojlib/input/gamepad/GamepadMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ public static GamepadMap getDefaultMenuMap(){
keycodes[0] = keycodes[1] = keycodes[2] = keycodes[3] = GamepadMap.MOUSE_SCROLL_DOWN;
}

menuMap.DPAD_DOWN.keycodes[0] = LwjglGlfwKeycode.GLFW_KEY_O; //For mods ?
menuMap.DPAD_UP.keycodes[0] = LwjglGlfwKeycode.GLFW_KEY_TAB; // QC Funnies
menuMap.DPAD_DOWN.keycodes[0] = LwjglGlfwKeycode.GLFW_KEY_ENTER; //For mods ?
menuMap.DPAD_RIGHT.keycodes[0] = LwjglGlfwKeycode.GLFW_KEY_K; //For mods ?
menuMap.DPAD_LEFT.keycodes[0] = LwjglGlfwKeycode.GLFW_KEY_J; //For mods ?

Expand Down
5 changes: 2 additions & 3 deletions src/main/java/pojlib/util/JREUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ public static void initJavaRuntime() {
dlopen(f.getAbsolutePath());
}
dlopen(sNativeLibDir + "/libopenal.so");
dlopen(sNativeLibDir + "/libopuscodec.so");
}

public static void redirectAndPrintJRELog() {
Expand Down Expand Up @@ -191,8 +190,8 @@ public static int launchJavaVM(final Activity activity, final List<String> JVMAr
userArgs.add("-Xms" + 2048 + "M");
userArgs.add("-Xmx" + 3072 + "M");
} else {
userArgs.add("-Xms" + 2048 + "M");
userArgs.add("-Xmx" + 2048 + "M");
userArgs.add("-Xms" + 512 + "M");
userArgs.add("-Xmx" + 4860 + "M");
}
}

Expand Down
Binary file modified src/main/jni/OpenOVR/OCOVR.a
Binary file not shown.
Binary file modified src/main/jni/OpenOVR/libDrvOpenXR.a
Binary file not shown.
Binary file modified src/main/jni/OpenOVR/libOpenXR.a
Binary file not shown.
3 changes: 0 additions & 3 deletions src/main/jniLibs/arm64-v8a/libopuscodec.so

This file was deleted.

0 comments on commit 150ec8c

Please sign in to comment.