Move image work to the image manager

This commit is contained in:
Tim Visée
2017-12-30 23:56:43 +01:00
parent e70b50f58e
commit c113a9ebaf

View File

@@ -11,9 +11,6 @@ mod pix_canvas;
mod pix_client; mod pix_client;
mod rect; mod rect;
use std::thread;
use std::time::Duration;
use arg_handler::ArgHandler; use arg_handler::ArgHandler;
use image_manager::ImageManager; use image_manager::ImageManager;
use pix_canvas::PixCanvas; use pix_canvas::PixCanvas;
@@ -48,16 +45,6 @@ fn start<'a>(arg_handler: &ArgHandler<'a>) {
&arg_handler.size(), &arg_handler.size(),
); );
// Animate images // Start the work in the image manager, to walk through the frames
loop { image_manager.work(&mut canvas, arg_handler.fps());
// 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
)
);
}
} }