summaryrefslogtreecommitdiff
path: root/alligator_resources/src/texture.rs
diff options
context:
space:
mode:
Diffstat (limited to 'alligator_resources/src/texture.rs')
-rw-r--r--alligator_resources/src/texture.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/alligator_resources/src/texture.rs b/alligator_resources/src/texture.rs
index 22cad17..1bb7cb8 100644
--- a/alligator_resources/src/texture.rs
+++ b/alligator_resources/src/texture.rs
@@ -147,7 +147,7 @@ struct Texture {
impl Texture {
fn from_buffer(texture: Rgba16Texture) -> Self {
Self {
- priority: Priority::Urgent,
+ priority: Priority::Urgent, // indicates that it can't be unloaded
buffer: TextureBuffer::Memory(Arc::new(texture)),
}
}
@@ -164,7 +164,10 @@ impl Texture {
}
fn set_priority(&mut self, priority: Priority) {
- self.priority = priority;
+ // memory textures should always be urgent
+ if let TextureBuffer::Disk(_) = self.buffer {
+ self.priority = priority;
+ }
}
fn load_texture(&mut self) -> Result<&Rgba16Texture, LoadError> {