forked from bevyengine/bevy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move
SUPPORTED_FILE_EXTENSIONS
to ImageLoader
and remove unsuppor…
…ted formats. (bevyengine#15917) # Objective Fixes bevyengine#15730. ## Solution As part of bevyengine#15586, we made a constant to store all the supported image formats. However since the `ImageFormat` does actually include Hdr and OpenExr, it also included the `"hdr"` and `"exr"` file extensions. These are supported by separate loaders though: `HdrTextureLoader` and `ExrTextureLoader`. This led to a warning about duplicate asset loaders. Therefore, instead of having the constant for `ImageFormat`, I made the constant just for `ImageLoader`. This lets us correctly remove `"hdr"` and `"exr"` from the image formats supported by `ImageLoader`, returning us to having a single asset loader for every image format. Note: we could have just removed `hdr` and `exr` from `ImageFormat::SUPPORTED_FILE_EXTENSIONS`, but this would be very confusing. Then the list of `ImageFormat`s would not match the list of supported formats! ## Testing - I ran the `sprite` example and got no warning! I also replaced the sprite in that example with an HDR file and everything worked as expected.
- Loading branch information
Showing
3 changed files
with
133 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters