Move image work to the image manager
This commit is contained in:
17
src/main.rs
17
src/main.rs
@@ -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
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user