From 58ce5985d4505f40c1569a5a0bba932b6d8b0d28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Mon, 9 Sep 2024 17:17:17 +0200 Subject: [PATCH] Use operator `!=` instead of `mem_comp` for colors --- src/engine/shared/console.cpp | 2 +- src/game/client/ui.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/engine/shared/console.cpp b/src/engine/shared/console.cpp index 3e18b23d6..42bd71d8a 100644 --- a/src/engine/shared/console.cpp +++ b/src/engine/shared/console.cpp @@ -341,7 +341,7 @@ void CConsole::Print(int Level, const char *pFrom, const char *pStr, ColorRGBA P { LEVEL LogLevel = IConsole::ToLogLevel(Level); // if console colors are not enabled or if the color is pure white, use default terminal color - if(g_Config.m_ConsoleEnableColors && mem_comp(&PrintColor, &gs_ConsoleDefaultColor, sizeof(ColorRGBA)) != 0) + if(g_Config.m_ConsoleEnableColors && PrintColor != gs_ConsoleDefaultColor) { log_log_color(LogLevel, ColorToLogColor(PrintColor), pFrom, "%s", pStr); } diff --git a/src/game/client/ui.cpp b/src/game/client/ui.cpp index d5e5536a3..3a0a611cd 100644 --- a/src/game/client/ui.cpp +++ b/src/game/client/ui.cpp @@ -57,7 +57,7 @@ void CUIElement::SUIElementRect::Reset() void CUIElement::SUIElementRect::Draw(const CUIRect *pRect, ColorRGBA Color, int Corners, float Rounding) { bool NeedsRecreate = false; - if(m_UIRectQuadContainer == -1 || m_Width != pRect->w || m_Height != pRect->h || mem_comp(&m_QuadColor, &Color, sizeof(Color)) != 0) + if(m_UIRectQuadContainer == -1 || m_Width != pRect->w || m_Height != pRect->h || m_QuadColor != Color) { m_pParent->Ui()->Graphics()->DeleteQuadContainer(m_UIRectQuadContainer); NeedsRecreate = true;