bevy/examples/asset
Lege19 3978ba9783
Allowed creating uninitialized images (for use as storage textures) (#17760)
# Objective
https://github.com/bevyengine/bevy/issues/17746
## Solution
- Change `Image.data` from being a `Vec<u8>` to a `Option<Vec<u8>>`
- Added functions to help with creating images
## Testing

- Did you test these changes? If so, how?
All current tests pass
Tested a variety of existing examples to make sure they don't crash
(they don't)
- If relevant, what platforms did you test these changes on, and are
there any important ones you can't test?
Linux x86 64-bit NixOS 
---
## Migration Guide
Code that directly access `Image` data will now need to use unwrap or
handle the case where no data is provided.
Behaviour of new_fill slightly changed, but not in a way that is likely
to affect anything. It no longer panics and will fill the whole texture
instead of leaving black pixels if the data provided is not a nice
factor of the size of the image.

---------

Co-authored-by: IceSentry <IceSentry@users.noreply.github.com>
2025-02-10 22:22:07 +00:00
..
files Fix asset_settings example regression (#15945) 2024-10-16 14:16:23 +00:00
processing Remove labeled_assets from LoadedAsset and ErasedLoadedAsset (#15481) 2025-02-10 21:06:37 +00:00
alter_mesh.rs simplify example, replace get_single to Single Query (#16187) 2024-11-01 18:25:42 +00:00
alter_sprite.rs Allowed creating uninitialized images (for use as storage textures) (#17760) 2025-02-10 22:22:07 +00:00
asset_decompression.rs Remove labeled_assets from LoadedAsset and ErasedLoadedAsset (#15481) 2025-02-10 21:06:37 +00:00
asset_loading.rs Migrate cameras to required components (#15641) 2024-10-05 01:59:52 +00:00
asset_settings.rs Don't reëxport bevy_image from bevy_render (#16163) 2024-11-10 06:54:38 +00:00
custom_asset_reader.rs Prefer Display over Debug (#16112) 2024-12-27 00:40:06 +00:00
custom_asset.rs Move #![warn(clippy::allow_attributes, clippy::allow_attributes_without_reason)] to the workspace Cargo.toml (#17374) 2025-01-15 01:14:58 +00:00
embedded_asset.rs Migrate bevy_sprite to required components (#15489) 2024-10-09 16:17:26 +00:00
extra_source.rs Migrate bevy_sprite to required components (#15489) 2024-10-09 16:17:26 +00:00
hot_asset_reloading.rs Migrate cameras to required components (#15641) 2024-10-05 01:59:52 +00:00
multi_asset_sync.rs Relationships (non-fragmenting, one-to-many) (#17398) 2025-01-18 22:20:30 +00:00
repeated_texture.rs Don't reëxport bevy_image from bevy_render (#16163) 2024-11-10 06:54:38 +00:00