From b36d91fd76f23fb62c69e071cc58915d164e4582 Mon Sep 17 00:00:00 2001 From: Relintai Date: Sun, 8 Aug 2021 13:40:03 +0200 Subject: [PATCH] Don't forget to add props (prop textures) to the cache. --- library/terraman_library_merger_pcm.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/library/terraman_library_merger_pcm.cpp b/library/terraman_library_merger_pcm.cpp index 84c345e..d9bc5f6 100644 --- a/library/terraman_library_merger_pcm.cpp +++ b/library/terraman_library_merger_pcm.cpp @@ -289,6 +289,16 @@ void TerramanLibraryMergerPCM::_prop_material_cache_get_key(Ref chun cache->material_add(nm); } +#ifdef PROPS_PRESENT + for (int i = 0; i < chunk->prop_get_count(); ++i) { + Ref prop = chunk->prop_get(i); + + ERR_CONTINUE(!prop.is_valid()); + + cache->prop_add_textures(prop); + } +#endif + _prop_material_cache[hash] = cache; //unlock here, so if a different thread need the cache it will be able to immediately access the materials and surfaces when it gets it.