From 5fae2be850b4d185d9fc53fc1324faa1996218da Mon Sep 17 00:00:00 2001 From: MelonSpeedruns Date: Tue, 31 Mar 2026 17:33:28 -0400 Subject: [PATCH] Added camera invert X option to Tweaks menu --- include/d/actor/d_a_alink.h | 1 + src/d/actor/d_a_alink.cpp | 1 + src/d/d_camera.cpp | 7 +++++++ src/dusk/imgui/ImGuiMenuGame.cpp | 1 + 4 files changed, 10 insertions(+) diff --git a/include/d/actor/d_a_alink.h b/include/d/actor/d_a_alink.h index a4d38efc43..f2f96487d4 100644 --- a/include/d/actor/d_a_alink.h +++ b/include/d/actor/d_a_alink.h @@ -8428,6 +8428,7 @@ inline daAlink_c* daAlink_getAlinkActorClass() { #if TARGET_PC namespace dusk::tweaks { extern bool FastIronBoots; + extern bool InvertCameraXAxis; } #endif diff --git a/src/d/actor/d_a_alink.cpp b/src/d/actor/d_a_alink.cpp index 5e2530bdf3..fe8e016c7e 100644 --- a/src/d/actor/d_a_alink.cpp +++ b/src/d/actor/d_a_alink.cpp @@ -56,6 +56,7 @@ #if TARGET_PC bool dusk::tweaks::FastIronBoots = false; +bool dusk::tweaks::InvertCameraXAxis = false; #endif static int daAlink_Create(fopAc_ac_c* i_this); diff --git a/src/d/d_camera.cpp b/src/d/d_camera.cpp index a5efef9bfa..6e7e7b8f53 100644 --- a/src/d/d_camera.cpp +++ b/src/d/d_camera.cpp @@ -762,6 +762,13 @@ void dCamera_c::updatePad() { var_f29 = 0.0f; } else { var_f31 = mDoCPd_c::getSubStickX3D(mPadID); + + #if TARGET_PC + if (dusk::tweaks::InvertCameraXAxis) { + var_f31 *= -1.0f; + } + #endif + var_f30 = mDoCPd_c::getSubStickY(mPadID); var_f29 = mDoCPd_c::getSubStickValue(mPadID); } diff --git a/src/dusk/imgui/ImGuiMenuGame.cpp b/src/dusk/imgui/ImGuiMenuGame.cpp index c68140f3cd..c6acd044a9 100644 --- a/src/dusk/imgui/ImGuiMenuGame.cpp +++ b/src/dusk/imgui/ImGuiMenuGame.cpp @@ -78,6 +78,7 @@ namespace dusk { if (ImGui::BeginMenu("Tweaks")) { ImGui::MenuItem("Fast iron boots", nullptr, &tweaks::FastIronBoots); + ImGui::MenuItem("Invert Camera X Axis", nullptr, &tweaks::InvertCameraXAxis); ImGui::EndMenu(); }