src/gl/compiler.cpp

changeset 305
d891da20abca
parent 297
bc92f97498f7
child 309
d862721d19a3
equal deleted inserted replaced
304:5d280bceb713 305:d891da20abca
222 } 222 }
223 223
224 template<typename Fn> 224 template<typename Fn>
225 void iterateModelPolygons(Model* model, DocumentManager* context, Fn&& fn) 225 void iterateModelPolygons(Model* model, DocumentManager* context, Fn&& fn)
226 { 226 {
227 PolygonCache* cache = findPolygonCacheForModel(model, context); 227 PolygonCache* const cache = findPolygonCacheForModel(model, context);
228 if (cache != nullptr) { 228 if (cache != nullptr) {
229 const PolygonCache::vector_type* polygons = getCachedPolygons(cache, model, context); 229 recacheIfNeeded(cache, model, context);
230 for (const WithId<PolygonElement>& polygon : *polygons) { 230 for (const WithId<PolygonElement>& polygon : cache->polygons) {
231 fn(polygon); 231 fn(polygon);
232 } 232 }
233 } 233 }
234 } 234 }
235 235

mercurial