diff options
| author | Freya Murphy <freya@freyacat.org> | 2025-11-10 23:28:25 -0500 |
|---|---|---|
| committer | Freya Murphy <freya@freyacat.org> | 2025-11-10 23:28:25 -0500 |
| commit | 9f721f96e4c711f517d5a53521f88b65d72081b5 (patch) | |
| tree | 5ef3be654c0f400159bf2bc23cc095bea3ed5f1d | |
| parent | graphics: add feature to include assets statically in the binary (diff) | |
| download | DungeonCrawl-9f721f96e4c711f517d5a53521f88b65d72081b5.tar.gz DungeonCrawl-9f721f96e4c711f517d5a53521f88b65d72081b5.tar.bz2 DungeonCrawl-9f721f96e4c711f517d5a53521f88b65d72081b5.zip | |
i forgor to fmt
| -rw-r--r-- | graphics/src/render.rs | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/graphics/src/render.rs b/graphics/src/render.rs index bbfa2b9..9129970 100644 --- a/graphics/src/render.rs +++ b/graphics/src/render.rs @@ -48,23 +48,20 @@ macro_rules! draw_text { #[cfg(not(feature = "static"))] macro_rules! load_texture { - ($handle:expr, $thread:expr, $filepath:expr) => ( + ($handle:expr, $thread:expr, $filepath:expr) => { $handle.load_texture($thread, $filepath)? - ) + }; } #[cfg(feature = "static")] macro_rules! load_texture { - ($handle:expr, $thread:expr, $filepath:expr) => ( - { - let bytes = include_bytes!(concat!("../../", $filepath)); - let len = $filepath.len(); - let ext = &$filepath[len-4..]; - let image = ::raylib::texture::Image::load_image_from_mem(ext, bytes)?; - $handle.load_texture_from_image($thread, &image)? - } - - ) + ($handle:expr, $thread:expr, $filepath:expr) => {{ + let bytes = include_bytes!(concat!("../../", $filepath)); + let len = $filepath.len(); + let ext = &$filepath[len - 4..]; + let image = ::raylib::texture::Image::load_image_from_mem(ext, bytes)?; + $handle.load_texture_from_image($thread, &image)? + }}; } /// The baseline size of all ingame sprites and tile textures |