mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-09 17:48:19 +00:00
Merge pull request #8918 from Robyt3/Cleanup-Color-mem_comp
Use operator `!=` instead of `mem_comp` for colors
This commit is contained in:
commit
b5d662622c
|
@ -341,7 +341,7 @@ void CConsole::Print(int Level, const char *pFrom, const char *pStr, ColorRGBA P
|
||||||
{
|
{
|
||||||
LEVEL LogLevel = IConsole::ToLogLevel(Level);
|
LEVEL LogLevel = IConsole::ToLogLevel(Level);
|
||||||
// if console colors are not enabled or if the color is pure white, use default terminal color
|
// 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);
|
log_log_color(LogLevel, ColorToLogColor(PrintColor), pFrom, "%s", pStr);
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,7 +57,7 @@ void CUIElement::SUIElementRect::Reset()
|
||||||
void CUIElement::SUIElementRect::Draw(const CUIRect *pRect, ColorRGBA Color, int Corners, float Rounding)
|
void CUIElement::SUIElementRect::Draw(const CUIRect *pRect, ColorRGBA Color, int Corners, float Rounding)
|
||||||
{
|
{
|
||||||
bool NeedsRecreate = false;
|
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);
|
m_pParent->Ui()->Graphics()->DeleteQuadContainer(m_UIRectQuadContainer);
|
||||||
NeedsRecreate = true;
|
NeedsRecreate = true;
|
||||||
|
|
Loading…
Reference in a new issue