Skip to content

Commit

Permalink
Load assets from root path when loading directly (#478)
Browse files Browse the repository at this point in the history
  • Loading branch information
lberrymage committed Sep 11, 2020
1 parent 5447592 commit e7d2545
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -33,6 +33,7 @@
- [iOS: use shaderc-rs for glsl to spirv compilation][324]
- [Changed the default node size to Auto instead of Undefined to match the Stretch implementation.][304]
- Many improvements to Bevy's CI [#325][325], [#349][349], [#357][357], [#373][373], [#423][423]
- [Load assets from root path when loading directly][478]

### Fixed

Expand Down Expand Up @@ -83,6 +84,7 @@
[423]: https://github.com/bevyengine/bevy/pull/423
[428]: https://github.com/bevyengine/bevy/pull/428
[433]: https://github.com/bevyengine/bevy/pull/433
[478]: https://github.com/bevyengine/bevy/pull/478


## Version 0.1.3 (2020-8-22)
Expand Down
3 changes: 2 additions & 1 deletion crates/bevy_asset/src/asset_server.rs
Expand Up @@ -239,7 +239,8 @@ impl AssetServer {

// TODO: add type checking here. people shouldn't be able to request a Handle<Texture> for a Mesh asset
pub fn load<T, P: AsRef<Path>>(&self, path: P) -> Result<Handle<T>, AssetServerError> {
self.load_untyped(path).map(Handle::from)
self.load_untyped(self.get_root_path()?.join(path))
.map(Handle::from)
}

pub fn load_sync<T: Resource, P: AsRef<Path>>(
Expand Down

0 comments on commit e7d2545

Please sign in to comment.