mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Use const
pointers and static_cast
for tile data
This commit is contained in:
parent
b82ec33921
commit
39217e10a9
|
@ -3450,15 +3450,16 @@ void CGameContext::OnInit()
|
|||
|
||||
void CGameContext::CreateAllEntities(bool Initial)
|
||||
{
|
||||
CMapItemLayerTilemap *pTileMap = m_Layers.GameLayer();
|
||||
CTile *pTiles = (CTile *)Kernel()->RequestInterface<IMap>()->GetData(pTileMap->m_Data);
|
||||
const CMapItemLayerTilemap *pTileMap = m_Layers.GameLayer();
|
||||
const CTile *pTiles = static_cast<CTile *>(Kernel()->RequestInterface<IMap>()->GetData(pTileMap->m_Data));
|
||||
|
||||
CTile *pFront = nullptr;
|
||||
CSwitchTile *pSwitch = nullptr;
|
||||
const CTile *pFront = nullptr;
|
||||
if(m_Layers.FrontLayer())
|
||||
pFront = (CTile *)Kernel()->RequestInterface<IMap>()->GetData(m_Layers.FrontLayer()->m_Front);
|
||||
pFront = static_cast<CTile *>(Kernel()->RequestInterface<IMap>()->GetData(m_Layers.FrontLayer()->m_Front));
|
||||
|
||||
const CSwitchTile *pSwitch = nullptr;
|
||||
if(m_Layers.SwitchLayer())
|
||||
pSwitch = (CSwitchTile *)Kernel()->RequestInterface<IMap>()->GetData(m_Layers.SwitchLayer()->m_Switch);
|
||||
pSwitch = static_cast<CSwitchTile *>(Kernel()->RequestInterface<IMap>()->GetData(m_Layers.SwitchLayer()->m_Switch));
|
||||
|
||||
for(int y = 0; y < pTileMap->m_Height; y++)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue