bevy/crates/bevy_sprite/src
Sludge 908c40dd88 Implement Clone for all pipeline types (#6653)
# Objective

Pipelines can be customized by wrapping an existing pipeline in a newtype and adding custom logic to its implementation of `SpecializedMeshPipeline::specialize`. To make that easier, the wrapped pipeline type needs to implement `Clone`.

For example, the current non-cloneable pipelines require wrapper pipelines to pull apart the wrapped pipeline like this:

```rust
impl FromWorld for Wireframe2dPipeline {
    fn from_world(world: &mut World) -> Self {
        let p = &world.resource::<Material2dPipeline<ColorMaterial>>();
        Self {
            mesh2d_pipeline: p.mesh2d_pipeline.clone(),
            material2d_layout: p.material2d_layout.clone(),
            vertex_shader: p.vertex_shader.clone(),
            fragment_shader: p.fragment_shader.clone(),
        }
    }
}
```

## Solution

Derive or implement `Clone` on all built-in pipeline types. This is easy to do since they mostly just contain cheaply clonable reference-counted types.

---

## Changelog

Implement `Clone` for all pipeline types.
2023-01-14 18:33:38 +00:00
..
mesh2d Implement Clone for all pipeline types (#6653) 2023-01-14 18:33:38 +00:00
render Fix various typos (#7096) 2023-01-06 00:43:30 +00:00
bundle.rs
collide_aabb.rs Add more documentation and tests to collide_aabb::collide() (#5910) 2022-09-12 01:25:34 +00:00
dynamic_texture_atlas_builder.rs Move sprite::Rect into bevy_math (#5686) 2022-09-02 12:35:23 +00:00
lib.rs Revert "Show prelude re-exports in docs (#6448)" (#6449) 2022-11-02 20:40:45 +00:00
sprite.rs Sprite: allow using a sub-region (Rect) of the image (#6014) 2022-09-18 22:49:27 +00:00
texture_atlas_builder.rs Move sprite::Rect into bevy_math (#5686) 2022-09-02 12:35:23 +00:00
texture_atlas.rs add ReflectAsset and ReflectHandle (#5923) 2022-10-28 20:42:33 +00:00