switch size data types to u16
The binary protocol is limited to using u16's so limit everything to that.
This commit is contained in:
@@ -28,7 +28,7 @@ impl ImageManager {
|
||||
}
|
||||
|
||||
/// Instantiate the image manager, and load the images from the given paths.
|
||||
pub fn load(paths: &[&str], size: (u32, u32)) -> ImageManager {
|
||||
pub fn load(paths: &[&str], size: (u16, u16)) -> ImageManager {
|
||||
// Show a status message
|
||||
println!("Load and process {} image(s)...", paths.len());
|
||||
|
||||
@@ -84,7 +84,7 @@ impl ImageManager {
|
||||
}
|
||||
|
||||
/// Load the image at the given path, and size it correctly
|
||||
fn load_image(path: &str, size: (u32, u32)) -> DynamicImage {
|
||||
fn load_image(path: &str, size: (u16, u16)) -> DynamicImage {
|
||||
// Create a path instance
|
||||
let path = Path::new(&path);
|
||||
|
||||
@@ -97,5 +97,5 @@ fn load_image(path: &str, size: (u32, u32)) -> DynamicImage {
|
||||
let image = image::open(&path).unwrap();
|
||||
|
||||
// Resize the image to fit the screen
|
||||
image.resize_exact(size.0, size.1, FilterType::Gaussian)
|
||||
image.resize_exact(size.0 as u32, size.1 as u32, FilterType::Gaussian)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user