uidev: re-format code

This commit is contained in:
Aleksander
2025-09-13 12:18:27 +02:00
parent 1d8f8aca3e
commit c2628c0a15
7 changed files with 440 additions and 440 deletions

8
uidev/.editorconfig Normal file
View File

@@ -0,0 +1,8 @@
root = true
[*.rs]
indent_style = tab
indent_size = 2
charset = utf-8
trim_trailing_whitespace = false
insert_final_newline = false

2
uidev/rustfmt.toml Normal file
View File

@@ -0,0 +1,2 @@
tab_spaces = 2
hard_tabs = true

View File

@@ -13,8 +13,7 @@ use vulkano::{
format::Format, format::Format,
image::{ImageUsage, view::ImageView}, image::{ImageUsage, view::ImageView},
swapchain::{ swapchain::{
Surface, SurfaceInfo, Swapchain, SwapchainCreateInfo, SwapchainPresentInfo, Surface, SurfaceInfo, Swapchain, SwapchainCreateInfo, SwapchainPresentInfo, acquire_next_image,
acquire_next_image,
}, },
sync::GpuFuture, sync::GpuFuture,
}; };
@@ -242,8 +241,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
swapchain_create_info.image_extent = swapchain_size; swapchain_create_info.image_extent = swapchain_size;
(swapchain, images) = { (swapchain, images) = {
let (swapchain, images) = let (swapchain, images) = swapchain.recreate(swapchain_create_info.clone()).unwrap();
swapchain.recreate(swapchain_create_info.clone()).unwrap();
let image_views = images let image_views = images
.into_iter() .into_iter()
@@ -286,12 +284,8 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
profiler.start(); profiler.start();
{ {
let (image_index, _, acquire_future) = match acquire_next_image( let (image_index, _, acquire_future) =
swapchain.clone(), match acquire_next_image(swapchain.clone(), None).map_err(Validated::unwrap) {
None,
)
.map_err(Validated::unwrap)
{
Ok(r) => r, Ok(r) => r,
Err(VulkanError::OutOfDate) => { Err(VulkanError::OutOfDate) => {
recreate = true; recreate = true;
@@ -321,10 +315,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
.unwrap() .unwrap()
.then_swapchain_present( .then_swapchain_present(
gfx.queue_gfx.clone(), gfx.queue_gfx.clone(),
SwapchainPresentInfo::swapchain_image_index( SwapchainPresentInfo::swapchain_image_index(swapchain.clone(), image_index),
swapchain.clone(),
image_index,
),
) )
.then_signal_fence_and_flush() .then_signal_fence_and_flush()
.unwrap() .unwrap()

View File

@@ -15,10 +15,7 @@ pub struct TestbedAny {
} }
impl TestbedAny { impl TestbedAny {
pub fn new( pub fn new(name: &str, listeners: &mut EventListenerCollection<(), ()>) -> anyhow::Result<Self> {
name: &str,
listeners: &mut EventListenerCollection<(), ()>,
) -> anyhow::Result<Self> {
let path = format!("gui/{name}.xml"); let path = format!("gui/{name}.xml");
let globals = WguiGlobals::new(Box::new(assets::Asset {}))?; let globals = WguiGlobals::new(Box::new(assets::Asset {}))?;
@@ -37,7 +34,8 @@ impl TestbedAny {
impl Testbed for TestbedAny { impl Testbed for TestbedAny {
fn update(&mut self, width: f32, height: f32, timestep_alpha: f32) -> anyhow::Result<()> { fn update(&mut self, width: f32, height: f32, timestep_alpha: f32) -> anyhow::Result<()> {
self.layout self
.layout
.update(Vec2::new(width, height), timestep_alpha)?; .update(Vec2::new(width, height), timestep_alpha)?;
Ok(()) Ok(())
} }

View File

@@ -121,7 +121,8 @@ impl TestbedGeneric {
impl Testbed for TestbedGeneric { impl Testbed for TestbedGeneric {
fn update(&mut self, width: f32, height: f32, timestep_alpha: f32) -> anyhow::Result<()> { fn update(&mut self, width: f32, height: f32, timestep_alpha: f32) -> anyhow::Result<()> {
self.layout self
.layout
.update(Vec2::new(width, height), timestep_alpha)?; .update(Vec2::new(width, height), timestep_alpha)?;
Ok(()) Ok(())
} }