mirror of
https://github.com/vcmi/vcmi.git
synced 2025-09-16 09:26:28 +02:00
Huge optimization based on profiling - cut generation time by almost half (Jebus XL+U).
This commit is contained in:
@@ -60,6 +60,8 @@ void CMapGenerator::initTiles()
|
||||
tiles[i][j] = new CTileInfo[level];
|
||||
}
|
||||
}
|
||||
|
||||
zoneColouring.resize(boost::extents[map->twoLevel ? 2 : 1][map->width][map->height]);
|
||||
}
|
||||
|
||||
CMapGenerator::~CMapGenerator()
|
||||
@@ -697,6 +699,20 @@ CTileInfo CMapGenerator::getTile(const int3& tile) const
|
||||
return tiles[tile.x][tile.y][tile.z];
|
||||
}
|
||||
|
||||
TRmgTemplateZoneId CMapGenerator::getZoneID(const int3& tile) const
|
||||
{
|
||||
checkIsOnMap(tile);
|
||||
|
||||
return zoneColouring[tile.z][tile.x][tile.y];
|
||||
}
|
||||
|
||||
void CMapGenerator::setZoneID(const int3& tile, TRmgTemplateZoneId zid)
|
||||
{
|
||||
checkIsOnMap(tile);
|
||||
|
||||
zoneColouring[tile.z][tile.x][tile.y] = zid;
|
||||
}
|
||||
|
||||
bool CMapGenerator::isAllowedSpell(SpellID sid) const
|
||||
{
|
||||
assert(sid >= 0);
|
||||
|
Reference in New Issue
Block a user