Skip to content

Commit

Permalink
fancy
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-blackbird committed Nov 10, 2022
1 parent 3d1ac11 commit 2ef4b4f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions examples/stress_tests/many_debug_lines.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ fn main() {
.add_plugin(FrameTimeDiagnosticsPlugin::default())
.insert_resource(Config {
line_count: 50_000,
simple: false,
fancy: false,
})
.insert_resource(DebugDrawConfig {
always_on_top: false,
Expand All @@ -26,7 +26,7 @@ fn main() {
#[derive(Resource, Debug)]
struct Config {
line_count: u32,
simple: bool,
fancy: bool,
}

fn system(
Expand All @@ -42,10 +42,10 @@ fn system(
config.line_count = config.line_count.saturating_sub(10_000);
}
if input.just_pressed(KeyCode::Space) {
config.simple = !config.simple;
config.fancy = !config.fancy;
}

if config.simple {
if !config.fancy {
for _ in 0..config.line_count {
draw.line(Vec3::NEG_Y, Vec3::Y, Color::BLACK);
}
Expand All @@ -64,7 +64,7 @@ fn system(

fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
commands.spawn(Camera3dBundle {
transform: Transform::from_xyz(1., 3., 5.).looking_at(Vec3::ZERO, Vec3::Y),
transform: Transform::from_xyz(3., 1., 5.).looking_at(Vec3::ZERO, Vec3::Y),
..default()
});

Expand All @@ -90,7 +90,7 @@ fn ui_system(mut query: Query<&mut Text>, config: Res<Config>, diag: Res<Diagnos
FPS: {:.0}\n\n\
Controls:\n\
Up/Down: Raise or lower the line count.\n\
Spacebar: Toggle simple mode.",
Spacebar: Toggle fancy mode.",
config.line_count, fps,
);
}

0 comments on commit 2ef4b4f

Please sign in to comment.