This commit is contained in:
2026-03-20 15:57:24 +00:00
parent 21e9dc1f34
commit 11d4b6a8a0
2 changed files with 13 additions and 208 deletions
+13 -7
View File
@@ -9,8 +9,8 @@ use crate::{
constants::{SEED, TILE_SIZE},
world::{
tiles::{ChunkData, FloorTileData, TileMap},
ChunkForrestryEvent, ChunkTerrainEvent, FloorTilePrefab, TileOcclusionEvent, CHUNK_SIZE,
Z_ABOVE, Z_BELOW, ChunkMap,
ChunkForrestryEvent, ChunkMap, ChunkTerrainEvent, FloorTilePrefab, TileOcclusionEvent,
CHUNK_SIZE, Z_ABOVE, Z_BELOW,
},
};
@@ -280,10 +280,12 @@ pub fn spawn_terrain_tasks(
for event in events.read() {
let chunk_pos = event.chunk_position;
let blobs_clone = blobs.clone();
task_pool.spawn(async move {
let blob = generate_terrain_blob(chunk_pos);
blobs_clone.lock().unwrap().push(blob);
}).detach();
task_pool
.spawn(async move {
let blob = generate_terrain_blob(chunk_pos);
blobs_clone.lock().unwrap().push(blob);
})
.detach();
}
println!("{} terrain tasks spawned in {:.2?}", count, start.elapsed());
@@ -331,7 +333,11 @@ pub fn apply_terrain_blobs(
}
if applied_count > 0 {
println!("{} terrain blobs applied in {:.2?}", applied_count, start.elapsed());
println!(
"{} terrain blobs applied in {:.2?}",
applied_count,
start.elapsed()
);
}
}