diff options
| author | Micha White <botahamec@outlook.com> | 2022-11-19 12:49:52 -0500 |
|---|---|---|
| committer | Micha White <botahamec@outlook.com> | 2022-11-19 12:49:52 -0500 |
| commit | c12fc6806391eb583ea75fcc89e23caf5e4218a6 (patch) | |
| tree | feaa255da0dae1258d72db4c4f053554ad1e9e06 /alligator_resources/src/texture.rs | |
| parent | b8a8aa64e7eee45a9f17a3079c836a251cc1b873 (diff) | |
Don't unload memory textures
Diffstat (limited to 'alligator_resources/src/texture.rs')
| -rw-r--r-- | alligator_resources/src/texture.rs | 7 |
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> { |
