Assign the new cache immediately, also comment out debug print.

This commit is contained in:
Relintai 2021-08-02 22:37:19 +02:00
parent 16fe978c41
commit d23e2747fb

View File

@ -89,8 +89,6 @@ void TerramanLibraryMergerPCM::_material_cache_get_key(Ref<TerraChunk> chunk) {
hstr += String::num(surfaces[i]) + "|"; hstr += String::num(surfaces[i]) + "|";
} }
print_error("New cache: " + hstr);
int hash = static_cast<int>(hstr.hash()); int hash = static_cast<int>(hstr.hash());
chunk->material_cache_key_set(hash); chunk->material_cache_key_set(hash);
@ -102,6 +100,8 @@ void TerramanLibraryMergerPCM::_material_cache_get_key(Ref<TerraChunk> chunk) {
Ref<TerraMaterialCachePCM> cache; Ref<TerraMaterialCachePCM> cache;
cache.instance(); cache.instance();
_material_cache[hash] = cache;
//print_error("New cache: " + hstr);
cache->set_texture_flags(get_texture_flags()); cache->set_texture_flags(get_texture_flags());
cache->set_max_atlas_size(get_max_atlas_size()); cache->set_max_atlas_size(get_max_atlas_size());
@ -141,8 +141,6 @@ void TerramanLibraryMergerPCM::_material_cache_get_key(Ref<TerraChunk> chunk) {
} }
cache->refresh_rects(); cache->refresh_rects();
_material_cache[hash] = cache;
} }
Ref<TerraMaterialCache> TerramanLibraryMergerPCM::_material_cache_get(const int key) { Ref<TerraMaterialCache> TerramanLibraryMergerPCM::_material_cache_get(const int key) {