From 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc Mon Sep 17 00:00:00 2001 From: Joshua Yanovski Date: Thu, 20 Aug 2020 07:59:43 +0200 Subject: [PATCH] Fix view example as well. --- world/examples/view.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/world/examples/view.rs b/world/examples/view.rs index b137e8abbe..a8e5db830e 100644 --- a/world/examples/view.rs +++ b/world/examples/view.rs @@ -6,11 +6,13 @@ const W: usize = 640; const H: usize = 480; fn main() { - let world = World::generate(0, WorldOpts { + let (world, index) = World::generate(0, WorldOpts { seed_elements: true, ..WorldOpts::default() }); + let index = index.as_index_ref(); + let sampler = world.sample_columns(); let mut win = @@ -28,7 +30,7 @@ fn main() { let pos = focus + Vec2::new(i as i32, j as i32) * scale; let (alt, place) = sampler - .get((pos, world.index())) + .get((pos, index)) .map(|sample| { ( sample.alt.sub(64.0).add(gain).mul(0.7).max(0.0).min(255.0) as u8,