mirror of
https://github.com/Relintai/terraman_2d.git
synced 2025-03-10 18:33:26 +01:00
Store the texture's rid to the chunk.
This commit is contained in:
parent
d47a87934b
commit
1767f09088
@ -82,6 +82,8 @@ void Terrain2DTerrain2DJob::phase_library_setup() {
|
||||
Ref<Terrain2DMaterialCache> cache = lib->material_cache_get(_chunk->material_cache_key_get());
|
||||
|
||||
if (!cache.is_valid()) {
|
||||
//todo library texture get
|
||||
|
||||
next_phase();
|
||||
return;
|
||||
}
|
||||
@ -92,6 +94,16 @@ void Terrain2DTerrain2DJob::phase_library_setup() {
|
||||
//Let's just wait
|
||||
OS::get_singleton()->delay_usec(100);
|
||||
}
|
||||
|
||||
Ref<Terrain2DChunkDefault> cd = _chunk;
|
||||
|
||||
if (cd.is_valid()) {
|
||||
Ref<Texture> tex = cache->texture_get_merged();
|
||||
|
||||
if (tex.is_valid()) {
|
||||
cd->mesh_rid_set(Terrain2DChunkDefault::MESH_INDEX_TERRAIN, Terrain2DChunkDefault::MESH_TYPE_INDEX_TEXTURE_RID, tex->get_rid());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user