mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-23 00:28:08 +02:00
- WeightedRule optimization - part 1
- comments, style
This commit is contained in:
@ -1497,11 +1497,7 @@ void CRmgTemplateZone::initTerrainType (CMapGenerator* gen)
|
||||
|
||||
void CRmgTemplateZone::paintZoneTerrain (CMapGenerator* gen, ETerrainType terrainType)
|
||||
{
|
||||
std::vector<int3> tiles;
|
||||
for (auto tile : tileinfo)
|
||||
{
|
||||
tiles.push_back (tile);
|
||||
}
|
||||
std::vector<int3> tiles(tileinfo.begin(), tileinfo.end());
|
||||
gen->editManager->getTerrainSelection().setSelection(tiles);
|
||||
gen->editManager->drawTerrain(terrainType, &gen->rand);
|
||||
}
|
||||
@ -2305,7 +2301,6 @@ ObjectInfo CRmgTemplateZone::getRandomObject(CMapGenerator* gen, CTreasurePileIn
|
||||
|
||||
bool fitsBlockmap = true;
|
||||
|
||||
|
||||
std::set<int3> blockedOffsets = oi.templ.getBlockedOffsets();
|
||||
blockedOffsets.insert (newVisitableOffset);
|
||||
for (auto blockingTile : blockedOffsets)
|
||||
@ -2327,13 +2322,11 @@ ObjectInfo CRmgTemplateZone::getRandomObject(CMapGenerator* gen, CTreasurePileIn
|
||||
|
||||
total += oi.probability;
|
||||
|
||||
//FIXME: apparently this is quite expensive operation
|
||||
//FIXME: apparently this is quite expensive operation, but "reserve" doesn't improve speed
|
||||
thresholds.push_back (std::make_pair (total, oi));
|
||||
}
|
||||
}
|
||||
|
||||
//logGlobal->infoStream() << boost::format ("Number of objects visitable from bottom: %d") % objectsVisitableFromBottom;
|
||||
|
||||
if (thresholds.empty())
|
||||
{
|
||||
ObjectInfo oi;
|
||||
|
Reference in New Issue
Block a user