From abbe2ce1de67ddbd15ce05dc6f9ef64a8e391387 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Thu, 27 Apr 2023 20:47:56 +0200 Subject: [PATCH] Use `Height` variable to reduce duplicate code --- src/game/client/components/killmessages.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/game/client/components/killmessages.cpp b/src/game/client/components/killmessages.cpp index 4f59f75a0..5eb4a9a1b 100644 --- a/src/game/client/components/killmessages.cpp +++ b/src/game/client/components/killmessages.cpp @@ -152,8 +152,8 @@ void CKillMessages::OnMessage(int MsgType, void *pRawMsg) Kill.m_VictimTextWidth = Kill.m_KillerTextWidth = 0.f; - float Width = 400 * 3.0f * Graphics()->ScreenAspect(); float Height = 400 * 3.0f; + float Width = Height * Graphics()->ScreenAspect(); float ScreenX0, ScreenY0, ScreenX1, ScreenY1; Graphics()->GetScreen(&ScreenX0, &ScreenY0, &ScreenX1, &ScreenY1); @@ -219,8 +219,8 @@ void CKillMessages::OnMessage(int MsgType, void *pRawMsg) Kill.m_VictimTextWidth = Kill.m_KillerTextWidth = 0.f; - float Width = 400 * 3.0f * Graphics()->ScreenAspect(); float Height = 400 * 3.0f; + float Width = Height * Graphics()->ScreenAspect(); float ScreenX0, ScreenY0, ScreenX1, ScreenY1; Graphics()->GetScreen(&ScreenX0, &ScreenY0, &ScreenX1, &ScreenY1); @@ -251,8 +251,8 @@ void CKillMessages::OnRender() if(!g_Config.m_ClShowKillMessages) return; - float Width = 400 * 3.0f * Graphics()->ScreenAspect(); float Height = 400 * 3.0f; + float Width = Height * Graphics()->ScreenAspect(); Graphics()->MapScreen(0, 0, Width * 1.5f, Height * 1.5f); Graphics()->SetColor(1.f, 1.f, 1.f, 1.f);