mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Clarify operator precedence
According to cppcheck's `clarifyCalculation` error: ``` src\game\client\components\hud.cpp:196:49: style: Clarify calculation precedence for '&' and '?'. [clarifyCalculation] float ImageSize = GameFlags & GAMEFLAG_FLAGS ? 16.0f : Split; ^ src\game\editor\layer_tiles.cpp:544:94: style: Clarify calculation precedence for '&' and '?'. [clarifyCalculation] m_pTiles[y * m_Width + x].m_Flags ^= m_pTiles[y * m_Width + x].m_Flags & TILEFLAG_ROTATE ? TILEFLAG_HFLIP : TILEFLAG_VFLIP; ^ src\game\editor\layer_tiles.cpp:560:94: style: Clarify calculation precedence for '&' and '?'. [clarifyCalculation] m_pTiles[y * m_Width + x].m_Flags ^= m_pTiles[y * m_Width + x].m_Flags & TILEFLAG_ROTATE ? TILEFLAG_VFLIP : TILEFLAG_HFLIP; ^ ```
This commit is contained in:
parent
f46c9f9079
commit
0f2590801d
|
@ -193,7 +193,7 @@ void CHud::RenderScoreHud()
|
|||
static float s_TextWidth100 = TextRender()->TextWidth(0, 14.0f, "100", -1, -1.0f);
|
||||
float ScoreWidthMax = maximum(maximum(m_aScoreInfo[0].m_ScoreTextWidth, m_aScoreInfo[1].m_ScoreTextWidth), s_TextWidth100);
|
||||
float Split = 3.0f;
|
||||
float ImageSize = GameFlags & GAMEFLAG_FLAGS ? 16.0f : Split;
|
||||
float ImageSize = (GameFlags & GAMEFLAG_FLAGS) ? 16.0f : Split;
|
||||
for(int t = 0; t < 2; t++)
|
||||
{
|
||||
// draw box
|
||||
|
|
|
@ -541,7 +541,7 @@ void CLayerTiles::BrushFlipX()
|
|||
if(!Rotate && !IsRotatableTile(m_pTiles[y * m_Width + x].m_Index))
|
||||
m_pTiles[y * m_Width + x].m_Flags = 0;
|
||||
else
|
||||
m_pTiles[y * m_Width + x].m_Flags ^= m_pTiles[y * m_Width + x].m_Flags & TILEFLAG_ROTATE ? TILEFLAG_HFLIP : TILEFLAG_VFLIP;
|
||||
m_pTiles[y * m_Width + x].m_Flags ^= (m_pTiles[y * m_Width + x].m_Flags & TILEFLAG_ROTATE) ? TILEFLAG_HFLIP : TILEFLAG_VFLIP;
|
||||
}
|
||||
|
||||
void CLayerTiles::BrushFlipY()
|
||||
|
@ -557,7 +557,7 @@ void CLayerTiles::BrushFlipY()
|
|||
if(!Rotate && !IsRotatableTile(m_pTiles[y * m_Width + x].m_Index))
|
||||
m_pTiles[y * m_Width + x].m_Flags = 0;
|
||||
else
|
||||
m_pTiles[y * m_Width + x].m_Flags ^= m_pTiles[y * m_Width + x].m_Flags & TILEFLAG_ROTATE ? TILEFLAG_VFLIP : TILEFLAG_HFLIP;
|
||||
m_pTiles[y * m_Width + x].m_Flags ^= (m_pTiles[y * m_Width + x].m_Flags & TILEFLAG_ROTATE) ? TILEFLAG_VFLIP : TILEFLAG_HFLIP;
|
||||
}
|
||||
|
||||
void CLayerTiles::BrushRotate(float Amount)
|
||||
|
|
Loading…
Reference in a new issue