summaryrefslogtreecommitdiffstats
path: root/game/client/player_look.cc
diff options
context:
space:
mode:
authoruntodesu <kirill@untode.su>2025-06-28 01:59:49 +0500
committeruntodesu <kirill@untode.su>2025-06-28 01:59:49 +0500
commit61e5bcef2629e2d68b805a956a96fff264d4f74d (patch)
treebca3a94bac79d34e3c0db57c77604f5a823ecbda /game/client/player_look.cc
parent88c01588aa0830e219eaa62588839e4d1e2883ce (diff)
downloadvoxelius-61e5bcef2629e2d68b805a956a96fff264d4f74d.tar.bz2
voxelius-61e5bcef2629e2d68b805a956a96fff264d4f74d.zip
Restructure dependencies and update to C++20
- Nuked static_assert from almost everywhere in the project - Nuked binary dependency support. Might add one later though - Separated dependency headers into a separate include subdirectory - Grafted a thirdpartylegalnotices.txt generator from RITEG - Pushed development snapshot version to 2126 (26th week of 2025)
Diffstat (limited to 'game/client/player_look.cc')
-rw-r--r--game/client/player_look.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/game/client/player_look.cc b/game/client/player_look.cc
index e1e4c8e..767c171 100644
--- a/game/client/player_look.cc
+++ b/game/client/player_look.cc
@@ -18,8 +18,8 @@
#include "client/session.hh"
#include "client/settings.hh"
-constexpr static float PITCH_MIN = -1.0f * cxpr::radians(90.0f);
-constexpr static float PITCH_MAX = +1.0f * cxpr::radians(90.0f);
+constexpr static float PITCH_MIN = -1.0f * vx::radians(90.0f);
+constexpr static float PITCH_MAX = +1.0f * vx::radians(90.0f);
// Mouse options
static ConfigBoolean mouse_raw_input(true);
@@ -47,7 +47,7 @@ static void add_angles(float pitch, float yaw)
head.angles[0] += pitch;
head.angles[1] += yaw;
- head.angles[0] = cxpr::clamp(head.angles[0], PITCH_MIN, PITCH_MAX);
+ head.angles[0] = vx::clamp(head.angles[0], PITCH_MIN, PITCH_MAX);
head.angles = cxangles::wrap_180(head.angles);
// Client-side head angles are not interpolated;
@@ -73,8 +73,8 @@ static void on_glfw_cursor_pos(const GlfwCursorPosEvent& event)
return;
}
- auto dx = -0.01f * static_cast<float>(mouse_sensitivity.get_value()) * cxpr::radians(event.pos.x - last_cursor.x);
- auto dy = -0.01f * static_cast<float>(mouse_sensitivity.get_value()) * cxpr::radians(event.pos.y - last_cursor.y);
+ auto dx = -0.01f * static_cast<float>(mouse_sensitivity.get_value()) * vx::radians(event.pos.x - last_cursor.x);
+ auto dy = -0.01f * static_cast<float>(mouse_sensitivity.get_value()) * vx::radians(event.pos.y - last_cursor.y);
add_angles(dy, dx);
last_cursor = event.pos;
@@ -105,7 +105,8 @@ void player_look::init(void)
settings::add_slider(1, gamepad_accel_yaw, settings_location::GAMEPAD_GAMEPLAY, "player_look.gamepad.accel_yaw", false);
settings::add_gamepad_axis(2, axis_pitch, settings_location::GAMEPAD_GAMEPLAY, "player_look.gp_axis.pitch");
settings::add_gamepad_axis(3, axis_yaw, settings_location::GAMEPAD_GAMEPLAY, "player_look.gp_axis.yaw");
- settings::add_slider(4, gamepad_fastlook_factor, settings_location::GAMEPAD_GAMEPLAY, "player_look.gamepad.fastlook_factor", true, "%.02f");
+ settings::add_slider(
+ 4, gamepad_fastlook_factor, settings_location::GAMEPAD_GAMEPLAY, "player_look.gamepad.fastlook_factor", true, "%.02f");
settings::add_gamepad_button(5, button_fastlook, settings_location::GAMEPAD_GAMEPLAY, "player_look.gp_button.fastlook");
fastlook_enabled = false;