From ae78b3fa893dc4f8b7dde7f9f8411074b6b10c19 Mon Sep 17 00:00:00 2001 From: Rob Parrett Date: Mon, 12 Aug 2024 09:53:23 -0700 Subject: [PATCH] Upgrade to Bevy 0.14 --- Cargo.toml | 9 ++++++--- src/terrain.rs | 4 ++-- src/util/mod.rs | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index a48f841..6af3856 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,10 +14,14 @@ documentation = "https://docs.rs/bevy_generative" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -bevy = { version = "0.13.0", default-features = false, features = ["bevy_core_pipeline", "bevy_pbr", "bevy_ui"] } +bevy = { version = "0.14.0", default-features = false, features = [ + "bevy_core_pipeline", + "bevy_pbr", + "bevy_ui", +] } colorgrad = "0.6.2" gltf = "1.3.0" -image = "0.24.7" +image = "0.25" noise = { version = "0.9.0", git = "https://github.com/Razaekel/noise-rs.git" } rfd = "0.12.1" serde = "1.0.195" @@ -34,4 +38,3 @@ opt-level = 1 [profile.release] lto = "thin" - diff --git a/src/terrain.rs b/src/terrain.rs index 53d7f8e..36f69c0 100644 --- a/src/terrain.rs +++ b/src/terrain.rs @@ -171,8 +171,8 @@ fn generate_terrain( let mut indices: Vec = Vec::with_capacity(triangle_count); let mut colors: Vec<[f32; 4]> = Vec::with_capacity(vertices_count); - let rows = terrain.size[0] * terrain.resolution + 1; - let cols = terrain.size[1] * terrain.resolution + 1; + let rows = terrain.size[0] * terrain.resolution; + let cols = terrain.size[1] * terrain.resolution; let width = terrain.size[0] as f32 + 1.0; let depth = terrain.size[1] as f32 + 1.0; for row in 0..rows { diff --git a/src/util/mod.rs b/src/util/mod.rs index 084ec98..393ae9f 100644 --- a/src/util/mod.rs +++ b/src/util/mod.rs @@ -24,7 +24,7 @@ pub fn export_asset(image_buffer: ImageBuffer, Vec>) { &image_buffer, image_buffer.width(), image_buffer.height(), - color_type, + color_type.into(), ) .expect("Failed to write to png");