mirror of
https://github.com/lubosz/overte.git
synced 2025-04-23 23:33:48 +02:00
Handle out-of-range in render::FetchItems
This commit is contained in:
parent
293e432fe9
commit
407c1bc626
1 changed files with 9 additions and 5 deletions
|
@ -97,13 +97,17 @@ void render::cullItems(const SceneContextPointer& sceneContext, const RenderCont
|
|||
|
||||
void FetchItems::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, ItemIDsBounds& outItems) {
|
||||
auto& scene = sceneContext->_scene;
|
||||
auto& items = scene->getMasterBucket().at(_filter);
|
||||
|
||||
outItems.clear();
|
||||
outItems.reserve(items.size());
|
||||
for (auto id : items) {
|
||||
auto& item = scene->getItem(id);
|
||||
outItems.emplace_back(ItemIDAndBounds(id, item.getBound()));
|
||||
|
||||
const auto& bucket = scene->getMasterBucket();
|
||||
const auto& items = bucket.find(_filter);
|
||||
if (items != bucket.end()) {
|
||||
outItems.reserve(items->second.size());
|
||||
for (auto& id : items->second) {
|
||||
auto& item = scene->getItem(id);
|
||||
outItems.emplace_back(ItemIDAndBounds(id, item.getBound()));
|
||||
}
|
||||
}
|
||||
|
||||
if (_probeNumItems) {
|
||||
|
|
Loading…
Reference in a new issue