From 8cd5e3e5620f97073af79bcdd417691af4961d6b Mon Sep 17 00:00:00 2001 From: mitchellhansen Date: Sun, 11 Aug 2019 15:56:24 -0700 Subject: [PATCH] Finally appeased the compiler. Need to do some real cleaning up on the relationship between canvas and vk processor --- src/canvas.rs | 12 ++++++------ src/vkprocessor.rs | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/canvas.rs b/src/canvas.rs index 442cd43b..dcec91bf 100644 --- a/src/canvas.rs +++ b/src/canvas.rs @@ -279,11 +279,11 @@ impl Canvas { ).unwrap().0 ); - for (k, v) in self.textured_drawables.iter() { + for (k, v) in self.textured_drawables.drain() { self.textured_vertex_buffer.insert( k.clone(), ImmutableBuffer::from_iter( - self.textured_drawables.get(k).iter().cloned(), + v.iter().cloned(), BufferUsage::vertex_buffer(), self.queue.clone(), ).unwrap().0 @@ -357,9 +357,9 @@ impl Canvas { pub fn draw_commands(&self, - command_buffer: &mut AutoCommandBufferBuilder, + mut command_buffer: AutoCommandBufferBuilder, framebuffers: Vec>, - image_num: usize) { + image_num: usize) -> AutoCommandBufferBuilder { // Specify the color to clear the framebuffer with i.e. blue let clear_values = vec!(ClearValue::Float([0.0, 0.0, 1.0, 1.0])); @@ -391,9 +391,9 @@ impl Canvas { } } - command_buffer = command_buffer + command_buffer .end_render_pass() - .unwrap(); + .unwrap() } } diff --git a/src/vkprocessor.rs b/src/vkprocessor.rs index e0d445d3..d1855a73 100644 --- a/src/vkprocessor.rs +++ b/src/vkprocessor.rs @@ -412,7 +412,7 @@ impl<'a> VkProcessor<'a> { I can't replace canvas. */ - self.canvas.draw_commands(&mut command_buffer, framebuffers, image_num); + let mut command_buffer = self.canvas.draw_commands(command_buffer, framebuffers, image_num); //self.canvas = mem::replace(&mut self.canvas,