fix
This commit is contained in:
@@ -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()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user