void TerrainMap::UpdateInfoLayer(int LayerChangeIndex) { TerrainTile *Temp = NULL; for (int x = 0; x < m_MapSizeX; x++) { for (int y = 0; y < m_MapSizeY; y++) { Temp = &m_Map[LayerChangeIndex]->Get_Tile(Vec2i(x, y)); if (Temp->Get_Collidable()) { m_InfoLayer[x][y] = Temp; } } } }
void TerrainMap::InitInfoLayer() { m_InfoLayer.resize(m_MapSizeX, std::vector<TerrainTile*>(m_MapSizeY, NULL)); TerrainTile *Temp = NULL; for (int i = 0; i < m_Map.size(); i++) { for (int x = 0; x < m_MapSizeX; x++) { for (int y = 0; y < m_MapSizeY; y++) { Temp = &m_Map[i]->Get_Tile(Vec2i(x, y)); if (Temp->Get_Collidable()) { m_InfoLayer[x][y] = Temp; } } } } }