Untie mouse camera and free camera options

Either being enabled now allows the underlying freecam logic to run
This commit is contained in:
Irastris
2026-05-26 19:01:40 -04:00
parent 7f5a3320d4
commit 271e02036c
4 changed files with 17 additions and 19 deletions
+1
View File
@@ -1037,6 +1037,7 @@ public:
bool test1Camera(s32);
bool test2Camera(s32);
#if TARGET_PC
static bool canUseFreeCam();
bool freeCamera();
bool executeDebugFlyCam();
void deactivateDebugFlyCam();
+6 -2
View File
@@ -7640,12 +7640,16 @@ void dCamera_c::deactivateDebugFlyCam() {
mDebugFlyCam.initialized = false;
}
bool dCamera_c::canUseFreeCam() {
return dusk::getSettings().game.freeCamera || dusk::getSettings().game.enableMouseCamera;
}
bool dCamera_c::freeCamera() {
if (dusk::getSettings().game.freeCamera && mGear == 1) {
if (canUseFreeCam() && mGear == 1) {
mGear = 0;
}
if (!dusk::getSettings().game.freeCamera || mCamStyle == 70)
if (!canUseFreeCam() || mCamStyle == 70)
{
mCamParam.mManualMode = 0;
return false;
+4 -8
View File
@@ -36,9 +36,8 @@ bool queryMouseAimContext() {
}
bool wantMouseCapture() {
return (static_cast<bool>(getSettings().game.enableMouseCamera) &&
static_cast<bool>(getSettings().game.freeCamera)) ||
static_cast<bool>(getSettings().game.enableMouseAim);
const auto game = getSettings().game;
return game.enableMouseCamera.getValue() || game.enableMouseAim.getValue();
}
bool isWindowFocused(SDL_Window* window) {
@@ -128,9 +127,7 @@ void read() {
}
const bool aim_active = capture_active && queryMouseAimContext();
const bool camera_active = capture_active &&
static_cast<bool>(getSettings().game.enableMouseCamera) &&
static_cast<bool>(getSettings().game.freeCamera);
const bool camera_active = capture_active && getSettings().game.enableMouseCamera;
float mx_rel = 0.0f;
float my_rel = 0.0f;
@@ -147,8 +144,7 @@ void getCameraDeltas(float& out_yaw, float& out_pitch) {
out_yaw = 0.0f;
out_pitch = 0.0f;
if (!static_cast<bool>(getSettings().game.enableMouseCamera) ||
!static_cast<bool>(getSettings().game.freeCamera))
if (!getSettings().game.enableMouseCamera)
{
return;
}
+6 -9
View File
@@ -941,13 +941,12 @@ SettingsWindow::SettingsWindow(bool prelaunch) : mPrelaunch(prelaunch) {
leftPane.add_section("Camera");
addOption("Free Camera", getSettings().game.freeCamera,
"Enables free camera control, letting you control the camera fully with the C-Stick."
"<br/><br/>Must be enabled in order to use Mouse Camera.");
"Enables free camera control, letting you control the camera fully with the C-Stick.");
addOption("Invert Free Camera X Axis", getSettings().game.invertCameraXAxis,
"Invert horizontal free camera movement.<br/><br/>Applies to joystick input only.",
"Invert horizontal free camera movement.<br/><br/>Applies to the control stick only.",
[] { return !getSettings().game.freeCamera; });
addOption("Invert Free Camera Y Axis", getSettings().game.invertCameraYAxis,
"Invert vertical free camera movement.<br/><br/>Applies to joystick input only.",
"Invert vertical free camera movement.<br/><br/>Applies to the control stick only.",
[] { return !getSettings().game.freeCamera; });
config_percent_select(leftPane, rightPane, getSettings().game.freeCameraSensitivity,
"Free Camera Sensitivity",
@@ -992,9 +991,7 @@ SettingsWindow::SettingsWindow(bool prelaunch) : mPrelaunch(prelaunch) {
leftPane.add_section("Mouse");
addOption("Mouse Camera", getSettings().game.enableMouseCamera,
"Enables mouse input to rotate the third-person camera.<br/><br/>"
"Requires the Free Camera option to be enabled.",
[] { return !getSettings().game.freeCamera; });
"Enables mouse input for controlling the third-person camera.");
addOption("Mouse Aim", getSettings().game.enableMouseAim,
"Enables mouse input while in look mode, aiming a hawk, and aiming "
"supported items.<br/><br/>Supported items include the Slingshot, Gale Boomerang, "
@@ -1002,12 +999,12 @@ SettingsWindow::SettingsWindow(bool prelaunch) : mPrelaunch(prelaunch) {
config_percent_select(leftPane, rightPane, getSettings().game.mouseCameraSensitivityX,
"Mouse Camera X Sensitivity", "Controls horizontal mouse camera sensitivity.", 25, 400, 5,
[] {
return !getSettings().game.enableMouseCamera || !getSettings().game.freeCamera;
return !getSettings().game.enableMouseCamera;
});
config_percent_select(leftPane, rightPane, getSettings().game.mouseCameraSensitivityY,
"Mouse Camera Y Sensitivity", "Controls vertical mouse camera sensitivity.", 25, 400, 5,
[] {
return !getSettings().game.enableMouseCamera || !getSettings().game.freeCamera;
return !getSettings().game.enableMouseCamera;
});
config_percent_select(leftPane, rightPane, getSettings().game.mouseAimSensitivityX,
"Mouse Aim X Sensitivity", "Controls horizontal mouse aim sensitivity.", 25, 400, 5,