Updated to Bevy 0.15.1

This commit is contained in:
2025-01-13 21:43:50 -05:00
parent 8e2dc04a6f
commit 5b4e96177c
28 changed files with 1232 additions and 1090 deletions

View File

@@ -6,14 +6,14 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
bevy = "0.14.2"
bevy = "0.15.1"
noise = "0.9.0"
serde = { version = "1.0.203", features = ["derive"] }
serde_json = "1.0.115"
asset_loader = { path = "../asset_loader" }
rayon = "1.10.0"
bevy-inspector-egui = "0.25.0"
bevy_asset_loader = { version = "0.21.0", features = [
bevy-inspector-egui = "0.28.1"
bevy_asset_loader = { version = "0.22.0", features = [
"standard_dynamic_assets",
"3d",
] }

View File

@@ -1,16 +1,12 @@
use std::ops::Add;
use bevy::{math::VectorSpace, prelude::*};
use bevy::{asset::AssetLoader, math::VectorSpace, prelude::*};
use image::ImageBuffer;
use rayon::prelude::*;
use crate::hex_utils::HexCoord;
use super::{
biome_map::BiomeMap,
chunk::Chunk,
map::Map,
};
use super::{biome_map::BiomeMap, chunk::Chunk, map::Map};
pub fn render_image(
size: UVec2,
@@ -40,7 +36,7 @@ pub fn update_image(
let idx = (y * w + x) as usize;
let v = data[idx];
let t = v.remap(min, max, 0.0, 1.0);
let col = LinearRgba::lerp(&color1, color2, t);
let col = LinearRgba::lerp(color1, color2, t);
*pixel = to_pixel(&col);
});
}
@@ -95,10 +91,10 @@ fn get_height_color_blend(base_color: Hsla, height: f32, height2: f32, smooth: f
d /= smooth;
if d > 0.0 {
let c2: LinearRgba = color.with_lightness(color.lightness + 0.1).into();
color = LinearRgba::lerp(&color.into(), c2, d).into();
color = LinearRgba::lerp(color.into(), c2, d).into();
} else {
let c2: LinearRgba = color.with_lightness(color.lightness - 0.1).into();
color = LinearRgba::lerp(&color.into(), c2, d.abs()).into();
color = LinearRgba::lerp(color.into(), c2, d.abs()).into();
}
}
}