From d0fbd68055e3f4a796330cc8acc6c0954b5327ff Mon Sep 17 00:00:00 2001 From: untodesu Date: Thu, 11 Sep 2025 15:48:53 +0500 Subject: Run clang-format across the project --- game/client/gui/crosshair.cc | 86 ++++++++++++++++++++++---------------------- 1 file changed, 43 insertions(+), 43 deletions(-) (limited to 'game/client/gui/crosshair.cc') diff --git a/game/client/gui/crosshair.cc b/game/client/gui/crosshair.cc index 29b5fe5..b5650a9 100644 --- a/game/client/gui/crosshair.cc +++ b/game/client/gui/crosshair.cc @@ -1,43 +1,43 @@ -#include "client/pch.hh" - -#include "client/gui/crosshair.hh" - -#include "core/math/constexpr.hh" - -#include "core/resource/resource.hh" - -#include "client/resource/texture_gui.hh" - -#include "client/globals.hh" -#include "client/session.hh" - -static resource_ptr texture; - -void gui::crosshair::init(void) -{ - texture = resource::load( - "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"); - std::terminate(); - } -} - -void gui::crosshair::shutdown(void) -{ - texture = nullptr; -} - -void gui::crosshair::layout(void) -{ - auto viewport = ImGui::GetMainViewport(); - auto draw_list = ImGui::GetForegroundDrawList(); - - auto scaled_width = math::max(texture->size.x, globals::gui_scale * texture->size.x / 2); - auto scaled_height = math::max(texture->size.y, globals::gui_scale * texture->size.y / 2); - auto start = ImVec2( - static_cast(0.5f * viewport->Size.x) - (scaled_width / 2), static_cast(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); -} +#include "client/pch.hh" + +#include "client/gui/crosshair.hh" + +#include "core/math/constexpr.hh" + +#include "core/resource/resource.hh" + +#include "client/resource/texture_gui.hh" + +#include "client/globals.hh" +#include "client/session.hh" + +static resource_ptr texture; + +void gui::crosshair::init(void) +{ + texture = resource::load("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"); + std::terminate(); + } +} + +void gui::crosshair::shutdown(void) +{ + texture = nullptr; +} + +void gui::crosshair::layout(void) +{ + auto viewport = ImGui::GetMainViewport(); + auto draw_list = ImGui::GetForegroundDrawList(); + + auto scaled_width = math::max(texture->size.x, globals::gui_scale * texture->size.x / 2); + auto scaled_height = math::max(texture->size.y, globals::gui_scale * texture->size.y / 2); + auto start = ImVec2(static_cast(0.5f * viewport->Size.x) - (scaled_width / 2), + static_cast(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); +} -- cgit