Skip to content

Commit 8e0c75b

Browse files
committed
Fmt.
1 parent 3d837f0 commit 8e0c75b

File tree

6 files changed

+37
-33
lines changed

6 files changed

+37
-33
lines changed

crates/processing_ffi/src/color.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ impl From<LinearRgba> for Color {
2121
let srgb = bevy::color::Color::srgba(lin.red, lin.green, lin.blue, lin.alpha);
2222
srgb.into()
2323
}
24-
}
24+
}

crates/processing_ffi/src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
use bevy::prelude::Entity;
2-
use bevy::render::render_resource::{Extent3d, TextureFormat};
1+
use bevy::{
2+
prelude::Entity,
3+
render::render_resource::{Extent3d, TextureFormat},
4+
};
35
use processing::prelude::*;
46

57
use crate::color::Color;

crates/processing_render/src/image.rs

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,29 @@
1-
use crate::error::{ProcessingError, Result};
2-
use bevy::asset::io::embedded::GetAssetServer;
3-
use bevy::asset::{RenderAssetUsages, handle_internal_asset_events, LoadState};
4-
use bevy::ecs::entity::EntityHashMap;
5-
use bevy::ecs::system::{RunSystemOnce, SystemState};
6-
use bevy::prelude::*;
7-
use bevy::render::render_asset::{AssetExtractionSystems, RenderAssets};
8-
use bevy::render::render_resource::{
9-
Buffer, BufferDescriptor, BufferUsages, CommandEncoderDescriptor, Extent3d, MapMode, PollType,
10-
TexelCopyBufferInfo, TexelCopyBufferLayout, Texture, TextureDimension, TextureFormat,
1+
use std::path::PathBuf;
2+
3+
use bevy::{
4+
asset::{
5+
LoadState, RenderAssetUsages, handle_internal_asset_events, io::embedded::GetAssetServer,
6+
},
7+
ecs::{
8+
entity::EntityHashMap,
9+
system::{RunSystemOnce, SystemState},
10+
},
11+
prelude::*,
12+
render::{
13+
Extract, ExtractSchedule, MainWorld,
14+
render_asset::{AssetExtractionSystems, RenderAssets},
15+
render_resource::{
16+
Buffer, BufferDescriptor, BufferUsages, CommandEncoderDescriptor, Extent3d, MapMode,
17+
PollType, TexelCopyBufferInfo, TexelCopyBufferLayout, Texture, TextureDimension,
18+
TextureFormat,
19+
},
20+
renderer::{RenderDevice, RenderQueue},
21+
texture::GpuImage,
22+
},
1123
};
12-
use bevy::render::renderer::{RenderDevice, RenderQueue};
13-
use bevy::render::texture::GpuImage;
14-
use bevy::render::{Extract, ExtractSchedule, MainWorld};
1524
use half::f16;
16-
use std::path::PathBuf;
25+
26+
use crate::error::{ProcessingError, Result};
1727

1828
pub struct PImagePlugin;
1929

@@ -101,18 +111,14 @@ pub fn create(
101111
}
102112

103113
pub fn load(world: &mut World, path: PathBuf) -> Result<Entity> {
104-
fn load_inner(
105-
In(path): In<PathBuf>,
106-
world: &mut World,
107-
) -> Result<Entity> {
114+
fn load_inner(In(path): In<PathBuf>, world: &mut World) -> Result<Entity> {
108115
let handle = world.get_asset_server().load(path);
109116
while let LoadState::Loading = world.get_asset_server().load_state(&handle) {
110117
world
111118
.run_system_once(handle_internal_asset_events)
112119
.expect("Failed to run internal asset events system");
113120
}
114-
let images = world
115-
.resource::<Assets<Image>>();
121+
let images = world.resource::<Assets<Image>>();
116122
let image = images
117123
.get(&handle)
118124
.ok_or_else(|| ProcessingError::ImageNotFound)?;
@@ -308,4 +314,3 @@ pub fn destroy(world: &mut World, entity: Entity) -> Result<()> {
308314
.run_system_cached_with(destroy_inner, entity)
309315
.expect("Failed to run destroy system")
310316
}
311-

crates/processing_render/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@ pub mod error;
22
pub mod image;
33
pub mod render;
44

5-
use bevy::render::render_resource::{Extent3d, TextureFormat};
5+
use std::{cell::RefCell, ffi::c_void, num::NonZero, path::PathBuf, ptr::NonNull, sync::OnceLock};
6+
67
use bevy::{
78
app::{App, AppExit},
89
asset::AssetEventSystems,
910
camera::{CameraOutputMode, CameraProjection, RenderTarget, visibility::RenderLayers},
1011
log::tracing_subscriber,
1112
math::Vec3A,
1213
prelude::*,
14+
render::render_resource::{Extent3d, TextureFormat},
1315
window::{RawHandleWrapper, Window, WindowRef, WindowResolution, WindowWrapper},
1416
};
1517
use raw_window_handle::{
1618
DisplayHandle, HandleError, HasDisplayHandle, HasWindowHandle, RawDisplayHandle,
1719
RawWindowHandle, WindowHandle,
1820
};
1921
use render::{activate_cameras, clear_transient_meshes, flush_draw_commands};
20-
use std::path::PathBuf;
21-
use std::{cell::RefCell, ffi::c_void, num::NonZero, ptr::NonNull, sync::OnceLock};
2222
use tracing::debug;
2323

2424
use crate::{

crates/processing_render/src/render/mod.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
pub mod command;
2+
pub mod material;
23
pub mod mesh_builder;
34
pub mod primitive;
4-
pub mod material;
55

66
use bevy::{
77
camera::visibility::RenderLayers,
@@ -13,8 +13,7 @@ use command::{CommandBuffer, DrawCommand};
1313
use material::MaterialKey;
1414
use primitive::{TessellationMode, empty_mesh};
1515

16-
use crate::{Flush, SurfaceSize, render::primitive::rect};
17-
use crate::image::PImage;
16+
use crate::{Flush, SurfaceSize, image::PImage, render::primitive::rect};
1817

1918
#[derive(Component)]
2019
#[relationship(relationship_target = TransientMeshes)]

crates/processing_render/src/render/primitive/rect.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,7 @@ fn simple_rect(mesh: &mut Mesh, x: f32, y: f32, w: f32, h: f32, color: Color) {
100100
}
101101
}
102102

103-
if let Some(VertexAttributeValues::Float32x2(uvs)) =
104-
mesh.attribute_mut(Mesh::ATTRIBUTE_UV_0)
105-
{
103+
if let Some(VertexAttributeValues::Float32x2(uvs)) = mesh.attribute_mut(Mesh::ATTRIBUTE_UV_0) {
106104
uvs.push([0.0, 0.0]); // tl
107105
uvs.push([1.0, 0.0]); // tr
108106
uvs.push([1.0, 1.0]); // br

0 commit comments

Comments
 (0)