src/gl/compiler.cpp

changeset 305
d891da20abca
parent 297
bc92f97498f7
child 309
d862721d19a3
--- a/src/gl/compiler.cpp	Tue Jun 28 22:18:11 2022 +0300
+++ b/src/gl/compiler.cpp	Wed Jun 29 14:11:58 2022 +0300
@@ -224,10 +224,10 @@
 template<typename Fn>
 void iterateModelPolygons(Model* model, DocumentManager* context, Fn&& fn)
 {
-	PolygonCache* cache = findPolygonCacheForModel(model, context);
+	PolygonCache* const cache = findPolygonCacheForModel(model, context);
 	if (cache != nullptr) {
-		const PolygonCache::vector_type* polygons = getCachedPolygons(cache, model, context);
-		for (const WithId<PolygonElement>& polygon : *polygons) {
+		recacheIfNeeded(cache, model, context);
+		for (const WithId<PolygonElement>& polygon : cache->polygons) {
 			fn(polygon);
 		}
 	}

mercurial