From 2cbb13ea58122eed2f77c89a23ee3711f4248104 Mon Sep 17 00:00:00 2001 From: Relintai Date: Sun, 8 Aug 2021 14:02:36 +0200 Subject: [PATCH] TerraPropJob will now make use of the prop material cache. --- world/jobs/terra_prop_job.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/world/jobs/terra_prop_job.cpp b/world/jobs/terra_prop_job.cpp index 244d368..e774989 100644 --- a/world/jobs/terra_prop_job.cpp +++ b/world/jobs/terra_prop_job.cpp @@ -297,6 +297,19 @@ void TerraPropJob::phase_setup() { //Let's just wait OS::get_singleton()->delay_usec(100); } + +#if MESH_DATA_RESOURCE_PRESENT + for (int i = 0; i < _chunk->mesh_data_resource_get_count(); ++i) { + Ref tex = _chunk->mesh_data_resource_get_texture(i); + + if (!tex.is_valid()) + continue; + + Rect2 r = cache->additional_texture_get_uv_rect(tex); + + _chunk->mesh_data_resource_set_uv_rect(i, r); + } +#endif } next_phase();