diff options
Diffstat (limited to 'alligator_resources/src')
| -rw-r--r-- | alligator_resources/src/texture.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/alligator_resources/src/texture.rs b/alligator_resources/src/texture.rs index 4b55f95..9e29d08 100644 --- a/alligator_resources/src/texture.rs +++ b/alligator_resources/src/texture.rs @@ -392,7 +392,9 @@ impl TextureManager { let mut texture = Texture::from_path(path, priority); let size = texture.allocated_size(); - if priority == Priority::Urgent || self.can_load(size, texture.priority()) { + if priority != Priority::Unnecessary + && (priority == Priority::Urgent || self.can_load(size, texture.priority())) + { match texture.load_texture() { Ok(_) => { self.textures.insert(id, texture); @@ -415,7 +417,10 @@ impl TextureManager { let size = texture.allocated_size(); let priority = texture.priority(); - if !texture.is_loaded() && (priority == Priority::Urgent || self.can_load(size, priority)) { + if priority != Priority::Unnecessary + && !texture.is_loaded() + && (priority == Priority::Urgent || self.can_load(size, priority)) + { let texture = self.textures.get_mut(&id).expect("invalid texture id"); texture.load_texture()?; } |
