aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLibravatar Silas Bartha <[email protected]>2024-04-26 01:23:11 -0400
committerLibravatar Silas Bartha <[email protected]>2024-04-26 01:23:11 -0400
commitccf6a082ac040c42e428fde771834b2043735cb5 (patch)
treecbe788ead3a76feeb0baeeae63f77323b236e670 /src
parent7427c127662d91c7218639a2fb4d8fb7c9981611 (diff)
Switched to asset server reference for adding threshold map texturev0.1.2
Diffstat (limited to 'src')
-rw-r--r--src/components.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/components.rs b/src/components.rs
index 99bf946..d22524c 100644
--- a/src/components.rs
+++ b/src/components.rs
@@ -10,7 +10,10 @@ use bevy::{
pub struct DitherPostProcessSettings(Handle<Image>);
impl DitherPostProcessSettings {
- pub fn new(level: u32,images: &mut ResMut<Assets<Image>>) -> Self {
+ pub fn new(
+ level: u32,
+ asset_server: &AssetServer,
+ ) -> Self {
let power = level + 1;
let map_size: u32 = 1 << power;
let mut buffer = Vec::<u8>::new();
@@ -52,7 +55,7 @@ impl DitherPostProcessSettings {
image.texture_descriptor.usage =
TextureUsages::COPY_DST | TextureUsages::STORAGE_BINDING | TextureUsages::TEXTURE_BINDING;
- let handle = images.add(image);
+ let handle = asset_server.add(image);
Self(handle)
}