summaryrefslogtreecommitdiff
path: root/src/texture.rs
diff options
context:
space:
mode:
authorMicha White <botahamec@outlook.com>2022-10-04 09:59:44 -0400
committerMicha White <botahamec@outlook.com>2022-10-04 09:59:44 -0400
commit1169cf72ec435a495e1449bdf222bc0ccfd6f62a (patch)
tree3e080b1731de16e3c9bb0c7e8844d21341258dc9 /src/texture.rs
parent511d3873f5f567c97eecd69d186bb4f93f927d58 (diff)
Small optimization
Diffstat (limited to 'src/texture.rs')
-rw-r--r--src/texture.rs3
1 files changed, 3 insertions, 0 deletions
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)
}