From 1169cf72ec435a495e1449bdf222bc0ccfd6f62a Mon Sep 17 00:00:00 2001 From: Micha White Date: Tue, 4 Oct 2022 09:59:44 -0400 Subject: Small optimization --- src/texture.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/texture.rs') diff --git a/src/texture.rs b/src/texture.rs index 9184304..f5d1c34 100644 --- a/src/texture.rs +++ b/src/texture.rs @@ -64,6 +64,7 @@ pub struct TextureAtlases<'a> { packer: MultiTexturePacker<'a, image::RgbaImage, TextureId>, width: u32, height: u32, + changed: bool, } impl<'a> Default for TextureAtlases<'a> { @@ -85,6 +86,7 @@ impl<'a> TextureAtlases<'a> { }), width, height, + changed: false, } } @@ -99,6 +101,7 @@ impl<'a> TextureAtlases<'a> { self.packer .pack_own(id, img) .map_err(TextureError::TextureTooLarge)?; + self.changed = true; Ok(id) } -- cgit v1.2.3