refactor(renderer): texture look up does not need a String as key anymore

This commit is contained in:
lisk77 2025-11-17 17:58:48 +01:00
parent 4ed42b3de0
commit 8aec280447
2 changed files with 8 additions and 8 deletions

View file

@ -131,7 +131,7 @@ pub trait Collider {
pub trait Render {
fn is_visible(&self) -> bool;
fn set_visibility(&mut self, is_visible: bool);
fn get_texture(&self) -> String;
fn get_texture(&self) -> &str;
fn set_texture(&mut self, texture: &'static str);
}
@ -320,8 +320,8 @@ impl Render for Render2D {
self.is_visible = is_visible;
}
fn get_texture(&self) -> String {
self.texture_name.parse().unwrap()
fn get_texture(&self) -> &str {
self.texture_name
}
/// Use the actual file name of the texture instead of the path