From d23e2747fb3ec334ac36c270be8a5463c0ee1857 Mon Sep 17 00:00:00 2001 From: Relintai Date: Mon, 2 Aug 2021 22:37:19 +0200 Subject: [PATCH] Assign the new cache immediately, also comment out debug print. --- library/terraman_library_merger_pcm.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/library/terraman_library_merger_pcm.cpp b/library/terraman_library_merger_pcm.cpp index 6a6ee2b..b36a217 100644 --- a/library/terraman_library_merger_pcm.cpp +++ b/library/terraman_library_merger_pcm.cpp @@ -89,8 +89,6 @@ void TerramanLibraryMergerPCM::_material_cache_get_key(Ref chunk) { hstr += String::num(surfaces[i]) + "|"; } - print_error("New cache: " + hstr); - int hash = static_cast(hstr.hash()); chunk->material_cache_key_set(hash); @@ -102,6 +100,8 @@ void TerramanLibraryMergerPCM::_material_cache_get_key(Ref chunk) { Ref cache; cache.instance(); + _material_cache[hash] = cache; + //print_error("New cache: " + hstr); cache->set_texture_flags(get_texture_flags()); cache->set_max_atlas_size(get_max_atlas_size()); @@ -141,8 +141,6 @@ void TerramanLibraryMergerPCM::_material_cache_get_key(Ref chunk) { } cache->refresh_rects(); - - _material_cache[hash] = cache; } Ref TerramanLibraryMergerPCM::_material_cache_get(const int key) {