diff options
| author | untodesu <kirill@untode.su> | 2025-06-25 00:44:36 +0500 |
|---|---|---|
| committer | untodesu <kirill@untode.su> | 2025-06-25 00:44:36 +0500 |
| commit | 88c01588aa0830e219eaa62588839e4d1e2883ce (patch) | |
| tree | 602bb27dd3399aab4aae8c19630e3b7a8dac824b /game/client/splash.cc | |
| parent | 99cf6cca8dbbc1e563c10cf0167432d3d8af9783 (diff) | |
| download | voxelius-88c01588aa0830e219eaa62588839e4d1e2883ce.tar.bz2 voxelius-88c01588aa0830e219eaa62588839e4d1e2883ce.zip | |
Clang-format the entire source code
Diffstat (limited to 'game/client/splash.cc')
| -rw-r--r-- | game/client/splash.cc | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/game/client/splash.cc b/game/client/splash.cc index 1de1e93..96159d2 100644 --- a/game/client/splash.cc +++ b/game/client/splash.cc @@ -1,10 +1,11 @@ #include "client/pch.hh" + #include "client/splash.hh" #include "core/cmdline.hh" #include "core/constexpr.hh" -#include "core/feature.hh" #include "core/epoch.hh" +#include "core/feature.hh" #include "core/resource.hh" #include "client/glfw.hh" @@ -17,7 +18,7 @@ constexpr static ImGuiWindowFlags WINDOW_FLAGS = ImGuiWindowFlags_NoBackground | constexpr static int SPLASH_COUNT = 4; constexpr static std::size_t DELAY_MICROSECONDS = 2000000; -constexpr static const char *SPLASH_PATH = "textures/gui/client_splash.png"; +constexpr static const char* SPLASH_PATH = "textures/gui/client_splash.png"; static resource_ptr<TextureGUI> texture; static float texture_aspect; @@ -26,17 +27,17 @@ static float texture_alpha; static std::uint64_t end_time; static std::string current_text; -static void on_glfw_key(const GlfwKeyEvent &event) +static void on_glfw_key(const GlfwKeyEvent& event) { end_time = UINT64_C(0); } -static void on_glfw_mouse_button(const GlfwMouseButtonEvent &event) +static void on_glfw_mouse_button(const GlfwMouseButtonEvent& event) { end_time = UINT64_C(0); } -static void on_glfw_scroll(const GlfwScrollEvent &event) +static void on_glfw_scroll(const GlfwScrollEvent& event) { end_time = UINT64_C(0); } @@ -58,9 +59,12 @@ void client_splash::init(void) texture_alpha = 0.0f; if(texture) { - if(texture->size.x > texture->size.y) + if(texture->size.x > texture->size.y) { texture_aspect = static_cast<float>(texture->size.x) / static_cast<float>(texture->size.y); - else texture_aspect = static_cast<float>(texture->size.y) / static_cast<float>(texture->size.x); + } else { + texture_aspect = static_cast<float>(texture->size.y) / static_cast<float>(texture->size.x); + } + texture_alpha = 1.0f; } } @@ -85,8 +89,9 @@ void client_splash::init_late(void) const std::uint64_t curtime = epoch::microseconds(); const std::uint64_t remains = end_time - curtime; - if(curtime >= end_time) + if(curtime >= end_time) { break; + } texture_alpha = cxpr::smoothstep(0.25f, 0.6f, static_cast<float>(remains) / static_cast<float>(DELAY_MICROSECONDS)); @@ -117,7 +122,7 @@ void client_splash::render(void) ImGui_ImplOpenGL3_NewFrame(); ImGui_ImplGlfw_NewFrame(); ImGui::NewFrame(); - + glDisable(GL_DEPTH_TEST); glBindFramebuffer(GL_FRAMEBUFFER, 0); glViewport(0, 0, globals::width, globals::height); |
