-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Closed
Labels
A-AssetsLoad files from disk to use for things like images, models, and soundsLoad files from disk to use for things like images, models, and soundsP-CrashA sudden unexpected crashA sudden unexpected crashS-Needs-InvestigationThis issue requires detective work to figure out what's going wrongThis issue requires detective work to figure out what's going wrong
Description
in 0.2.1, trying to open a file with no extension causes a panic somewhere in the asset loading pipeline, even when the asset loader used has an empty string in it's extensions(&self) -> &[&str]] value. Not all files have an extension, so it should be possible to open these files, even if it means creating your own AssetLoader. Below is the asset loader that doesn't work. I don't even think it runs, if I place a panic with a specific message in the from_bytes function, the other panics happen before.
#[derive(Default)]
struct Test;
impl AssetLoader<Test> for Test
{
fn from_bytes(&self, _asset_path: &Path, bytes: Vec<u8>) -> Result<Test, Error>
{
Ok(Test)
}
fn extensions(&self) -> &[&str]
{
&[""]
}
}(as an aside, I think it should be possible to open files that don't match their loader's extensions, as some more general types could accept almost any type, like a loader for Vec<u8> or String)
Metadata
Metadata
Assignees
Labels
A-AssetsLoad files from disk to use for things like images, models, and soundsLoad files from disk to use for things like images, models, and soundsP-CrashA sudden unexpected crashA sudden unexpected crashS-Needs-InvestigationThis issue requires detective work to figure out what's going wrongThis issue requires detective work to figure out what's going wrong
Type
Projects
Status
Assets-wide Bugs