diff --git a/src/render/mod.rs b/src/render/mod.rs index 127315a..4084fc6 100644 --- a/src/render/mod.rs +++ b/src/render/mod.rs @@ -7,8 +7,8 @@ mod vertexbuffer; pub use gpustate::GPUState; /// A handle to a sprite texture -#[derive(Debug, Clone, Copy)] -pub struct SpriteTexture(pub &'static str); +#[derive(Debug, Clone)] +pub struct SpriteTexture(pub String); // API correction matrix. // cgmath uses OpenGL's matrix format, which diff --git a/src/render/texturearray/array.rs b/src/render/texturearray/array.rs index b69bb29..bfaf42e 100644 --- a/src/render/texturearray/array.rs +++ b/src/render/texturearray/array.rs @@ -21,7 +21,7 @@ impl TextureArray { } pub fn get_sprite_texture(&self, sprite: SpriteTexture) -> Texture { - return self.get_texture(sprite.0); + return self.get_texture(&sprite.0); } fn get_texture(&self, name: &str) -> Texture { diff --git a/src/ship.rs b/src/ship.rs index 7f86187..ebc4016 100644 --- a/src/ship.rs +++ b/src/ship.rs @@ -12,7 +12,7 @@ impl ShipKind { Self::Gypsum => "ship::gypsum", }; - return SpriteTexture(name); + return SpriteTexture(name.to_owned()); } fn height(&self) -> Pfloat {