mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-18 03:21:27 +02:00
Fixed obstacles filling and passability view
This commit is contained in:
parent
a2c63e7ed2
commit
a4686c81ee
@ -245,14 +245,12 @@ void MapController::commitObstacleFill(int level)
|
||||
sel.second.placeObstacles(_map.get(), CRandomGenerator::getDefault());
|
||||
}
|
||||
|
||||
for(auto & t : selection)
|
||||
{
|
||||
_mapHandler->invalidate(t.x, t.y, t.z);
|
||||
}
|
||||
_mapHandler->invalidateObjects();
|
||||
|
||||
_scenes[level]->selectionTerrainView.clear();
|
||||
_scenes[level]->selectionTerrainView.draw();
|
||||
_scenes[level]->objectsView.draw();
|
||||
_scenes[level]->passabilityView.update();
|
||||
|
||||
_miniscenes[level]->updateViews();
|
||||
main->mapChanged();
|
||||
@ -264,6 +262,7 @@ void MapController::commitObjectChange(int level)
|
||||
//_mapHandler->invalidate(o);
|
||||
_scenes[level]->objectsView.draw();
|
||||
_scenes[level]->selectionObjectsView.draw();
|
||||
_scenes[level]->passabilityView.update();
|
||||
|
||||
_miniscenes[level]->updateViews();
|
||||
main->mapChanged();
|
||||
@ -307,6 +306,7 @@ void MapController::commitObjectShiftOrCreate(int level)
|
||||
_scenes[level]->selectionObjectsView.selectionMode = 0;
|
||||
_scenes[level]->objectsView.draw();
|
||||
_scenes[level]->selectionObjectsView.draw();
|
||||
_scenes[level]->passabilityView.update();
|
||||
|
||||
_miniscenes[level]->updateViews();
|
||||
main->mapChanged();
|
||||
|
@ -425,7 +425,6 @@ void MapHandler::invalidate(int x, int y, int z)
|
||||
}
|
||||
|
||||
++obj;
|
||||
//invalidate(obj->obj);
|
||||
}
|
||||
|
||||
stable_sort(objects.begin(), objects.end(), objectBlitOrderSorter);
|
||||
@ -494,6 +493,14 @@ std::vector<int3> MapHandler::geTilesUnderObject(CGObjectInstance * obj) const
|
||||
return result;
|
||||
}
|
||||
|
||||
void MapHandler::invalidateObjects()
|
||||
{
|
||||
for(auto obj : map->objects)
|
||||
{
|
||||
invalidate(obj);
|
||||
}
|
||||
}
|
||||
|
||||
void MapHandler::invalidate(const std::vector<int3> & tiles)
|
||||
{
|
||||
for(auto & currTile : tiles)
|
||||
|
@ -90,6 +90,7 @@ public:
|
||||
void invalidate(int x, int y, int z); //invalidates all objects in particular tile
|
||||
void invalidate(CGObjectInstance *); //invalidates object rects
|
||||
void invalidate(const std::vector<int3> &); //invalidates all tiles
|
||||
void invalidateObjects(); //invalidates all objects on the map
|
||||
std::vector<int3> geTilesUnderObject(CGObjectInstance *) const;
|
||||
|
||||
/// draws all objects on current tile (higher-level logic, unlike other draw*** methods)
|
||||
|
Loading…
x
Reference in New Issue
Block a user