add ability to load .dds, .tga, and .jpeg texture formats#1038
Merged
cart merged 3 commits intobevyengine:masterfrom Dec 10, 2020
Merged
add ability to load .dds, .tga, and .jpeg texture formats#1038cart merged 3 commits intobevyengine:masterfrom
.dds, .tga, and .jpeg texture formats#1038cart merged 3 commits intobevyengine:masterfrom
Conversation
d9753bb to
d45514a
Compare
Member
|
Two small notes:
const FILE_EXTENSIONS: &[&str] = &["png", "dds", "tga", "jpg", "jpeg"];
impl AssetLoader for ImageTextureLoader {
fn load<'a>(
&'a self,
bytes: &'a [u8],
load_context: &'a mut LoadContext,
) -> BoxedFuture<'a, Result<()>> {
Box::pin(async move {
use bevy_core::AsBytes;
// Find the image type we expect. A file with the extension "png" should
// probably load as a PNG.
let ext = load_context.path().extension().unwrap().to_str().unwrap();
let img_format = image::ImageFormat::from_extension(ext)
.ok_or_else(|| {
format!(
"Unexpected image format {:?} for file {}, this is an error in `bevy_render`.",
ext,
load_context.path().display()
)
})
.unwrap(); |
added 3 commits
December 9, 2020 17:52
controled by non-defaulted features of the same name
d45514a to
58e2b16
Compare
Contributor
Author
|
That is much better, I updated the pull request. |
Closed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
controled by non-defaulted features of the same name