summaryrefslogtreecommitdiffstats
path: root/game/client/crosshair.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/crosshair.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/crosshair.cc')
-rw-r--r--game/client/crosshair.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/game/client/crosshair.cc b/game/client/crosshair.cc
index 72ece45..84a9a73 100644
--- a/game/client/crosshair.cc
+++ b/game/client/crosshair.cc
@@ -13,7 +13,8 @@ static resource_ptr<TextureGUI> texture;
void crosshair::init(void)
{
- texture = resource::load<TextureGUI>("textures/gui/hud_crosshair.png", TEXTURE_GUI_LOAD_CLAMP_S | TEXTURE_GUI_LOAD_CLAMP_T | TEXTURE_GUI_LOAD_VFLIP);
+ texture = resource::load<TextureGUI>(
+ "textures/gui/hud_crosshair.png", TEXTURE_GUI_LOAD_CLAMP_S | TEXTURE_GUI_LOAD_CLAMP_T | TEXTURE_GUI_LOAD_VFLIP);
if(texture == nullptr) {
spdlog::critical("crosshair: texture load failed");
@@ -31,9 +32,10 @@ void crosshair::layout(void)
auto viewport = ImGui::GetMainViewport();
auto draw_list = ImGui::GetForegroundDrawList();
- auto scaled_width = cxpr::max<int>(texture->size.x, globals::gui_scale * texture->size.x / 2);
- auto scaled_height = cxpr::max<int>(texture->size.y, globals::gui_scale * texture->size.y / 2);
- auto start = ImVec2(static_cast<int>(0.5f * viewport->Size.x) - (scaled_width / 2), static_cast<int>(0.5f * viewport->Size.y) - (scaled_height / 2));
+ auto scaled_width = vx::max<int>(texture->size.x, globals::gui_scale * texture->size.x / 2);
+ auto scaled_height = vx::max<int>(texture->size.y, globals::gui_scale * texture->size.y / 2);
+ auto start = ImVec2(
+ static_cast<int>(0.5f * viewport->Size.x) - (scaled_width / 2), static_cast<int>(0.5f * viewport->Size.y) - (scaled_height / 2));
auto end = ImVec2(start.x + scaled_width, start.y + scaled_height);
draw_list->AddImage(texture->handle, start, end);
}