use crate::textures::{TextureManager, TextureSize}; use std::error::Error; use log::debug; #[derive(Debug)] pub struct TextureLoader { size: TextureSize } impl TextureManager for TextureLoader { fn load(size: TextureSize) -> Result> where Self: Sized { debug!("Using slow texture loader, textures will be loaded on-the-fly"); Ok(TextureLoader { size }) } fn get_texture(&self, texture_id: &str) -> Option { Some(format!("/assets/final/{}/{}.png", self.size.to_string(), texture_id)) } }