Skip to content

Commit

Permalink
Update assets_manager to 0.12
Browse files Browse the repository at this point in the history
  • Loading branch information
a1phyr committed Jul 3, 2024
1 parent 9b4a04f commit c29bfa1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ahash = ["assets_manager/ahash"]
hot-reloading = ["assets_manager/hot-reloading"]

[dependencies]
assets_manager = { version = "0.11", default-features = false, features = ["utils", "parking_lot", "zip", "image"] }
assets_manager = { version = "0.12", default-features = false, features = ["utils", "parking_lot", "zip"] }
ggez = { version = "0.9.0", default-features = false, features = ["audio"] }

directories = "5.0"
Expand Down
10 changes: 3 additions & 7 deletions src/assets.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
use assets_manager::{
asset::Storable, loader, AnyCache, Asset, BoxedError, OnceInitCell, ReloadWatcher,
};
use assets_manager::{loader, AnyCache, Asset, BoxedError, OnceInitCell, ReloadWatcher};
use parking_lot::Mutex;
use std::{borrow::Cow, io};

Expand All @@ -22,8 +20,6 @@ fn not_found_error() -> ggez::GameError {
#[derive(Debug, Clone, Copy)]
struct GgezValue<T>(T);

impl<T: Send + Sync + 'static> Storable for GgezValue<T> {}

fn default_load_fast<T: GgezAsset + Clone>(
cache: AnyCache,
context: &mut ggez::Context,
Expand Down Expand Up @@ -190,8 +186,8 @@ impl Asset for ImageAsset {
}

impl loader::Loader<ImageAsset> for GgezLoader {
fn load(content: Cow<[u8]>, ext: &str) -> Result<ImageAsset, BoxedError> {
let img: image::DynamicImage = loader::ImageLoader::load(content, ext)?;
fn load(content: Cow<[u8]>, _: &str) -> Result<ImageAsset, BoxedError> {
let img: image::DynamicImage = image::load_from_memory(&content)?;
let img = img.to_rgba8();

Ok(ImageAsset(img))
Expand Down

0 comments on commit c29bfa1

Please sign in to comment.