remove debug code

This commit is contained in:
yuni 2024-04-02 07:22:40 +02:00
parent d3df885e65
commit 868668ab43

View file

@ -1,4 +1,4 @@
use crate::{actor, nature, settings, hud}; use crate::{actor, nature, settings};
use bevy::prelude::*; use bevy::prelude::*;
use bevy::render::render_resource::{AsBindGroup, ShaderRef}; use bevy::render::render_resource::{AsBindGroup, ShaderRef};
use bevy::math::{DVec3, I64Vec3}; use bevy::math::{DVec3, I64Vec3};
@ -184,7 +184,6 @@ fn spawn_despawn_asteroids(
asset_server: Res<AssetServer>, asset_server: Res<AssetServer>,
mut q_asteroid: Query<(Entity, &mut Visibility), With<Asteroid>>, mut q_asteroid: Query<(Entity, &mut Visibility), With<Asteroid>>,
mut last_player_cell: Local<I64Vec3>, mut last_player_cell: Local<I64Vec3>,
mut log: ResMut<hud::Log>,
) { ) {
if !timer.0.tick(time.delta()).just_finished() || q_player.is_empty() { if !timer.0.tick(time.delta()).just_finished() || q_player.is_empty() {
//if q_player.is_empty() { //if q_player.is_empty() {
@ -201,10 +200,6 @@ fn spawn_despawn_asteroids(
} }
*last_player_cell = player_cell; *last_player_cell = player_cell;
let mut spawned = 0;
let mut spawned_near = 0;
let mut despawned = 0;
// Parameters // Parameters
let view_radius: f64 = ASTEROID_VIEW_RADIUS; let view_radius: f64 = ASTEROID_VIEW_RADIUS;
let step: f64 = ASTEROID_SPAWN_STEP; let step: f64 = ASTEROID_SPAWN_STEP;
@ -230,7 +225,6 @@ fn spawn_despawn_asteroids(
entity: asteroid.entity, entity: asteroid.entity,
origin: origin.clone(), origin: origin.clone(),
}); });
despawned += 1;
despawning_worked = true; despawning_worked = true;
break; break;
} }
@ -290,8 +284,6 @@ fn spawn_despawn_asteroids(
if dist > 6.0 { if dist > 6.0 {
continue; continue;
} }
dbg!(size_density, dist);
spawned_near += 1;
} }
let size: f32 = ASTEROID_SIZE_FACTOR * size_density; let size: f32 = ASTEROID_SIZE_FACTOR * size_density;
@ -336,13 +328,9 @@ fn spawn_despawn_asteroids(
entity: entity_commands.id(), entity: entity_commands.id(),
//viewdistance: 99999999.0, //viewdistance: 99999999.0,
}); });
spawned += 1;
} }
} }
} }
if spawned != 0 || despawned != 0 {
//log.notice(format!("spawned: {spawned} (near: {spawned_near}), despawned: {despawned}"));
}
} }
fn handle_despawn( fn handle_despawn(