summaryrefslogtreecommitdiffstats
path: root/game/client/status_lines.cc
diff options
context:
space:
mode:
Diffstat (limited to 'game/client/status_lines.cc')
-rw-r--r--game/client/status_lines.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/game/client/status_lines.cc b/game/client/status_lines.cc
index f39ba6f..ea7293c 100644
--- a/game/client/status_lines.cc
+++ b/game/client/status_lines.cc
@@ -1,11 +1,12 @@
#include "client/pch.hh"
+
#include "client/status_lines.hh"
#include "client/globals.hh"
#include "client/imdraw_ext.hh"
static float line_offsets[STATUS_COUNT];
-static ImFont *line_fonts[STATUS_COUNT];
+static ImFont* line_fonts[STATUS_COUNT];
static ImVec4 line_text_colors[STATUS_COUNT];
static ImVec4 line_shadow_colors[STATUS_COUNT];
@@ -40,8 +41,8 @@ void status_lines::layout(void)
for(unsigned int i = 0U; i < STATUS_COUNT; ++i) {
auto offset = line_offsets[i] * globals::gui_scale;
- auto &text = line_strings[i];
- auto *font = line_fonts[i];
+ auto& text = line_strings[i];
+ auto* font = line_fonts[i];
auto size = font->CalcTextSizeA(font->FontSize, FLT_MAX, 0.0f, text.c_str(), text.c_str() + text.size());
auto pos = ImVec2(0.5f * (viewport->Size.x - size.x), viewport->Size.y - offset);
@@ -50,8 +51,8 @@ void status_lines::layout(void)
auto fadeout = line_fadeouts[i];
auto alpha = std::exp(-1.0f * std::pow(1.0e-6f * static_cast<float>(globals::curtime - spawn) / fadeout, 10.0f));
- auto &color = line_text_colors[i];
- auto &shadow = line_shadow_colors[i];
+ auto& color = line_text_colors[i];
+ auto& shadow = line_shadow_colors[i];
auto color_U32 = ImGui::GetColorU32(ImVec4(color.x, color.y, color.z, color.w * alpha));
auto shadow_U32 = ImGui::GetColorU32(ImVec4(shadow.x, shadow.y, shadow.z, color.w * alpha));
@@ -59,7 +60,7 @@ void status_lines::layout(void)
}
}
-void status_lines::set(unsigned int line, const std::string &text, const ImVec4 &color, float fadeout)
+void status_lines::set(unsigned int line, const std::string& text, const ImVec4& color, float fadeout)
{
line_text_colors[line] = ImVec4(color.x, color.y, color.z, color.w);
line_shadow_colors[line] = ImVec4(color.x * 0.1f, color.y * 0.1f, color.z * 0.1f, color.w);