Updated to Bevy 0.15.1
This commit is contained in:
@@ -9,5 +9,5 @@ edition = "2021"
|
||||
[dependencies]
|
||||
serde = "1.0.204"
|
||||
serde_json = "1.0.120"
|
||||
bevy = "0.14.2"
|
||||
bevy = "0.15.1"
|
||||
ron = "0.8.1"
|
||||
|
||||
@@ -29,12 +29,12 @@ macro_rules! create_asset_loader {
|
||||
|
||||
type Error = String;
|
||||
|
||||
async fn load<'a>(
|
||||
&'a self,
|
||||
reader: &'a mut Reader<'_>,
|
||||
_settings: &'a Self::Settings,
|
||||
load_context: &'a mut LoadContext<'_>,
|
||||
) -> Result<Self::Asset, Self::Error> {
|
||||
async fn load(
|
||||
&self,
|
||||
reader: & mut dyn bevy::asset::io::Reader,
|
||||
_: &Self::Settings,
|
||||
load_context: &mut LoadContext<'_>,
|
||||
) -> Result<Self::Asset, Self::Error> {
|
||||
let mut bytes = Vec::new();
|
||||
let read_result = reader.read_to_end(&mut bytes).await;
|
||||
if read_result.is_err() {
|
||||
|
||||
@@ -9,5 +9,5 @@ proc-macro = true
|
||||
[dependencies]
|
||||
serde = "1.0.204"
|
||||
serde_json = "1.0.120"
|
||||
bevy = "0.14.2"
|
||||
bevy = "0.15.1"
|
||||
ron = "0.8.1"
|
||||
|
||||
@@ -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",
|
||||
] }
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user