From 7e2673f852037e758c595f833605b246260d9463 Mon Sep 17 00:00:00 2001 From: Mark Date: Mon, 25 Dec 2023 08:33:31 -0800 Subject: [PATCH] Minor cleanup --- src/render/mod.rs | 4 +--- src/render/texturearray/array.rs | 2 +- src/ship.rs | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/render/mod.rs b/src/render/mod.rs index 6ca52e2..127315a 100644 --- a/src/render/mod.rs +++ b/src/render/mod.rs @@ -8,9 +8,7 @@ pub use gpustate::GPUState; /// A handle to a sprite texture #[derive(Debug, Clone, Copy)] -pub struct SpriteTexture { - pub name: &'static str, -} +pub struct SpriteTexture(pub &'static str); // 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 f45edda..b69bb29 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.name); + return self.get_texture(sprite.0); } fn get_texture(&self, name: &str) -> Texture { diff --git a/src/ship.rs b/src/ship.rs index a44f6b6..7f86187 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); } fn height(&self) -> Pfloat {