mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Merge #6545
6545: Use `IsEntitiesLayer` to reduce duplicate code r=heinrich5991 a=Robyt3 ## Checklist - [X] Tested the change ingame - [ ] Provided screenshots if it is a visual change - [ ] Tested in combination with possibly related configuration options - [ ] Written a unit test (especially base/) or added coverage to integration test - [ ] Considered possible null pointers and out of bounds array indexing - [ ] Changed no physics that affect existing maps - [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional) Co-authored-by: Robert Müller <robytemueller@gmail.com>
This commit is contained in:
commit
e917c12419
|
@ -2359,14 +2359,7 @@ void CEditor::DoMapEditor(CUIRect View)
|
|||
m_Map.m_pGameGroup->MapScreen();
|
||||
for(auto &pLayer : m_Map.m_pGameGroup->m_vpLayers)
|
||||
{
|
||||
if(
|
||||
pLayer->m_Visible &&
|
||||
(pLayer == m_Map.m_pGameLayer ||
|
||||
pLayer == m_Map.m_pFrontLayer ||
|
||||
pLayer == m_Map.m_pTeleLayer ||
|
||||
pLayer == m_Map.m_pSpeedupLayer ||
|
||||
pLayer == m_Map.m_pSwitchLayer ||
|
||||
pLayer == m_Map.m_pTuneLayer))
|
||||
if(pLayer->m_Visible && pLayer->IsEntitiesLayer())
|
||||
pLayer->Render();
|
||||
}
|
||||
}
|
||||
|
@ -3703,12 +3696,7 @@ void CEditor::RenderLayers(CUIRect LayersBox)
|
|||
FontSize--;
|
||||
|
||||
int Checked = IsLayerSelected ? 1 : 0;
|
||||
if(m_Map.m_vpGroups[g]->m_vpLayers[i] == m_Map.m_pGameLayer ||
|
||||
m_Map.m_vpGroups[g]->m_vpLayers[i] == m_Map.m_pFrontLayer ||
|
||||
m_Map.m_vpGroups[g]->m_vpLayers[i] == m_Map.m_pSwitchLayer ||
|
||||
m_Map.m_vpGroups[g]->m_vpLayers[i] == m_Map.m_pTuneLayer ||
|
||||
m_Map.m_vpGroups[g]->m_vpLayers[i] == m_Map.m_pSpeedupLayer ||
|
||||
m_Map.m_vpGroups[g]->m_vpLayers[i] == m_Map.m_pTeleLayer)
|
||||
if(m_Map.m_vpGroups[g]->m_vpLayers[i]->IsEntitiesLayer())
|
||||
{
|
||||
Checked += 6;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue