From b5167ff79ce7b3e968ec229119dfaa8d07a5fe52 Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Sun, 21 Aug 2022 14:55:31 +0200 Subject: [PATCH] Cleaning --- src/programs/viewer.rs | 2 +- src/renderer.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/programs/viewer.rs b/src/programs/viewer.rs index ac61b08..183f71d 100644 --- a/src/programs/viewer.rs +++ b/src/programs/viewer.rs @@ -168,7 +168,7 @@ fn main() { camera.z_near = 0.0001; - let mut controls: Box = if matches.is_present("first person") { + let mut controls: Box = if matches.is_present("first person") { Box::new(FirstPersonControls::new()) } else { Box::new(OrbitControls::new( diff --git a/src/renderer.rs b/src/renderer.rs index 3bdc004..dc7b7b5 100644 --- a/src/renderer.rs +++ b/src/renderer.rs @@ -8,7 +8,7 @@ use image; use image::{DynamicImage, ImageBuffer, Rgba}; use glium::draw_parameters::{Blend, DepthTest}; -use glium::glutin::{ContextCurrentState, PossiblyCurrent as Pc}; +use glium::glutin::PossiblyCurrent as Pc; use glium::index::{NoIndices, PrimitiveType}; use glium::program::ProgramCreationInput; use glium::texture::{RawImage2d, SrgbTexture2d, Texture2dDataSink}; @@ -138,7 +138,7 @@ impl Renderer { /// Creates a SrgbTexture from a path to an image. pub fn make_texture(&self, path: &str) -> SrgbTexture2d { let image = match image::open(path) { - Ok(r) => r.to_rgba(), + Ok(r) => r.to_rgba8(), Err(e) => panic!("Error while opening file {}: {}", path, e), };