summaryrefslogtreecommitdiffstats
path: root/game/client/crosshair.cc
diff options
context:
space:
mode:
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);
}