From c113a9ebafc55e3e4576cea2eadba4431fed71ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Vis=C3=A9e?= Date: Sat, 30 Dec 2017 23:56:43 +0100 Subject: [PATCH] Move image work to the image manager --- src/main.rs | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/src/main.rs b/src/main.rs index b1bb836..0536091 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,9 +11,6 @@ mod pix_canvas; mod pix_client; mod rect; -use std::thread; -use std::time::Duration; - use arg_handler::ArgHandler; use image_manager::ImageManager; use pix_canvas::PixCanvas; @@ -48,16 +45,6 @@ fn start<'a>(arg_handler: &ArgHandler<'a>) { &arg_handler.size(), ); - // Animate images - loop { - // Tick to use the next image - image_manager.tick(&mut canvas); - - // Sleep until we need to show the next image - thread::sleep( - Duration::from_millis( - (1000f32 / (arg_handler.fps() as f32)) as u64 - ) - ); - } + // Start the work in the image manager, to walk through the frames + image_manager.work(&mut canvas, arg_handler.fps()); }