mirror of
https://github.com/FyroxEngine/Fyrox.git
synced 2026-10-12 02:02:20 +00:00
updated deps
- attempt to fix hot reloading
This commit is contained in:
+5
-5
@@ -16,16 +16,16 @@ include = ["/src/**/*", "/Cargo.toml", "/LICENSE", "/README.md", "/resources/**/
|
|||||||
fyrox = { version = "1.0.0-rc.1", path = "../fyrox", default-features = false }
|
fyrox = { version = "1.0.0-rc.1", path = "../fyrox", default-features = false }
|
||||||
fyrox-build-tools = { version = "1.0.0-rc.1", path = "../fyrox-build-tools" }
|
fyrox-build-tools = { version = "1.0.0-rc.1", path = "../fyrox-build-tools" }
|
||||||
lazy_static = "1.4.0"
|
lazy_static = "1.4.0"
|
||||||
ron = "0.8.0"
|
ron = "0.11"
|
||||||
serde = "^1.0.0"
|
serde = "^1.0.0"
|
||||||
toml = { version = "0.8.10", default-features = false, features = ["parse"] }
|
toml = { version = "0.9", default-features = false, features = ["parse"] }
|
||||||
toml_edit = "0.22.6"
|
toml_edit = "0.23"
|
||||||
strum = "0.27"
|
strum = "0.27"
|
||||||
strum_macros = "0.27"
|
strum_macros = "0.27"
|
||||||
open = "5"
|
open = "5"
|
||||||
opener = { version = "0.7.2", default-features = false, features = ["reveal"] }
|
opener = { version = "0.8", default-features = false, features = ["reveal"] }
|
||||||
rust-fuzzy-search = "0.1.1"
|
rust-fuzzy-search = "0.1.1"
|
||||||
cargo_metadata = "0.19"
|
cargo_metadata = "0.22"
|
||||||
serde_json = "1.0.113"
|
serde_json = "1.0.113"
|
||||||
image = { version = "0.25.1", default-features = false, features = ["gif", "jpeg", "png", "tga", "tiff", "bmp"] }
|
image = { version = "0.25.1", default-features = false, features = ["gif", "jpeg", "png", "tga", "tiff", "bmp"] }
|
||||||
imageproc = "0.25.0"
|
imageproc = "0.25.0"
|
||||||
|
|||||||
@@ -200,7 +200,11 @@ fn export(
|
|||||||
TargetPlatform::Android => "executor-android",
|
TargetPlatform::Android => "executor-android",
|
||||||
};
|
};
|
||||||
|
|
||||||
let Some(package) = metadata.packages.iter().find(|p| p.name == package_name) else {
|
let Some(package) = metadata
|
||||||
|
.packages
|
||||||
|
.iter()
|
||||||
|
.find(|p| p.name.as_ref() == package_name)
|
||||||
|
else {
|
||||||
return Err(format!(
|
return Err(format!(
|
||||||
"The project does not have `{package_name}` package."
|
"The project does not have `{package_name}` package."
|
||||||
));
|
));
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ impl<T: EntityId> StateAction<T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
StateAction::EnableRandomAnimation(animation_handles) => {
|
StateAction::EnableRandomAnimation(animation_handles) => {
|
||||||
if let Some(animation) = animation_handles.iter().choose(&mut rand::thread_rng()) {
|
if let Some(animation) = animation_handles.iter().choose(&mut rand::rng()) {
|
||||||
if let Some(animation) = animations.try_get_mut(*animation) {
|
if let Some(animation) = animations.try_get_mut(*animation) {
|
||||||
animation.set_enabled(true);
|
animation.set_enabled(true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,4 +16,4 @@ include = ["/src/**/*", "/Cargo.toml", "/LICENSE", "/README.md"]
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
nalgebra = { version = "0.34", features = ["bytemuck"] }
|
nalgebra = { version = "0.34", features = ["bytemuck"] }
|
||||||
fxhash = "0.2.1"
|
fxhash = "0.2.1"
|
||||||
rand = "0.8.5"
|
rand = "0.9.2"
|
||||||
|
|||||||
@@ -396,7 +396,7 @@ impl<V> ProbabilitySet<V> {
|
|||||||
if self.total <= 0.0 {
|
if self.total <= 0.0 {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
let mut p = rng.gen_range(0.0..self.total);
|
let mut p = rng.random_range(0.0..self.total);
|
||||||
for (f, v) in self.iter() {
|
for (f, v) in self.iter() {
|
||||||
if p < f {
|
if p < f {
|
||||||
return Some(v);
|
return Some(v);
|
||||||
|
|||||||
@@ -517,7 +517,7 @@ impl<Pos: WavePosition + Debug, Pat: Clone + Hash + Eq + Debug> WfcPropagator<Po
|
|||||||
if cell.pattern_possibilities.len() <= 1 || cell.entropy >= min_entropy {
|
if cell.pattern_possibilities.len() <= 1 || cell.entropy >= min_entropy {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
let noise = rng.gen_range(0.0..=self.limits.maximum_noise);
|
let noise = rng.random_range(0.0..=self.limits.maximum_noise);
|
||||||
let entropy = cell.entropy + noise;
|
let entropy = cell.entropy + noise;
|
||||||
if entropy < min_entropy {
|
if entropy < min_entropy {
|
||||||
min_entropy = entropy;
|
min_entropy = entropy;
|
||||||
@@ -540,7 +540,7 @@ impl<Pos: WavePosition + Debug, Pat: Clone + Hash + Eq + Debug> WfcPropagator<Po
|
|||||||
Con: WfcConstrain<Pattern = Pat, Offset = Pos::Offset>,
|
Con: WfcConstrain<Pattern = Pat, Offset = Pos::Offset>,
|
||||||
{
|
{
|
||||||
let cell = self.wave.get(position)?;
|
let cell = self.wave.get(position)?;
|
||||||
let mut target = rng.gen_range(0.0..cell.sum);
|
let mut target = rng.random_range(0.0..cell.sum);
|
||||||
for pattern in cell.pattern_possibilities.keys() {
|
for pattern in cell.pattern_possibilities.keys() {
|
||||||
let p = constraint.probability_of(pattern) as Entropy;
|
let p = constraint.probability_of(pattern) as Entropy;
|
||||||
target -= p;
|
target -= p;
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ fyrox-core-derive = { path = "../fyrox-core-derive", version = "1.0.0-rc.1" }
|
|||||||
fyrox-math = { path = "../fyrox-math", version = "1.0.0-rc.1" }
|
fyrox-math = { path = "../fyrox-math", version = "1.0.0-rc.1" }
|
||||||
base64 = "0.22.1"
|
base64 = "0.22.1"
|
||||||
byteorder = "1.4.3"
|
byteorder = "1.4.3"
|
||||||
rand = "0.8.4"
|
rand = "0.9.2"
|
||||||
memoffset = "0.9.0"
|
memoffset = "0.9.0"
|
||||||
lazy_static = "1.4.0"
|
lazy_static = "1.4.0"
|
||||||
nalgebra = { version = "0.34", features = ["bytemuck"] }
|
nalgebra = { version = "0.34", features = ["bytemuck"] }
|
||||||
|
|||||||
@@ -19,7 +19,8 @@
|
|||||||
// SOFTWARE.
|
// SOFTWARE.
|
||||||
|
|
||||||
use crate::num_traits::Num;
|
use crate::num_traits::Num;
|
||||||
use rand::{distributions::uniform::SampleUniform, Rng};
|
use rand::distr::uniform::SampleUniform;
|
||||||
|
use rand::Rng;
|
||||||
use std::ops::Range;
|
use std::ops::Range;
|
||||||
|
|
||||||
fn min<T>(a: T, b: T) -> T
|
fn min<T>(a: T, b: T) -> T
|
||||||
@@ -61,7 +62,7 @@ impl<T: Num + PartialOrd + SampleUniform + Copy> RangeExt<T> for Range<T> {
|
|||||||
if start == end {
|
if start == end {
|
||||||
start
|
start
|
||||||
} else {
|
} else {
|
||||||
rng.gen_range(Range { start, end })
|
rng.random_range(Range { start, end })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,13 +83,13 @@ impl<T: Num + PartialOrd + SampleUniform + Copy> RangeExt<T> for Range<T> {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use rand::thread_rng;
|
use rand::rng;
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_random() {
|
fn test_random() {
|
||||||
let mut rng = thread_rng();
|
let mut rng = rng();
|
||||||
|
|
||||||
let res = (1..10).random(&mut rng);
|
let res = (1..10).random(&mut rng);
|
||||||
assert!((1..=10).contains(&res));
|
assert!((1..=10).contains(&res));
|
||||||
|
|||||||
@@ -27,8 +27,8 @@ fyrox-graphics-gl = { path = "../fyrox-graphics-gl", version = "1.0.0-rc.1" }
|
|||||||
fyrox-texture = { path = "../fyrox-texture", version = "1.0.0-rc.1" }
|
fyrox-texture = { path = "../fyrox-texture", version = "1.0.0-rc.1" }
|
||||||
fyrox-autotile = { path = "../fyrox-autotile", version = "1.0.0-rc.1" }
|
fyrox-autotile = { path = "../fyrox-autotile", version = "1.0.0-rc.1" }
|
||||||
fyrox-material = { path = "../fyrox-material", version = "1.0.0-rc.1" }
|
fyrox-material = { path = "../fyrox-material", version = "1.0.0-rc.1" }
|
||||||
rapier2d = { version = "0.28", features = ["debug-render"] }
|
rapier2d = { version = "0.29", features = ["debug-render"] }
|
||||||
rapier3d = { version = "0.28", features = ["debug-render"] }
|
rapier3d = { version = "0.29", features = ["debug-render"] }
|
||||||
image = { version = "0.25.1", default-features = false, features = ["gif", "jpeg", "png", "tga", "tiff", "bmp"] }
|
image = { version = "0.25.1", default-features = false, features = ["gif", "jpeg", "png", "tga", "tiff", "bmp"] }
|
||||||
inflate = "0.4.5"
|
inflate = "0.4.5"
|
||||||
serde = { version = "1", features = ["derive"] }
|
serde = { version = "1", features = ["derive"] }
|
||||||
@@ -36,7 +36,7 @@ lazy_static = "1.4.0"
|
|||||||
rayon = "1.5.1"
|
rayon = "1.5.1"
|
||||||
bitflags = "2.2.1"
|
bitflags = "2.2.1"
|
||||||
walkdir = "2.3.2"
|
walkdir = "2.3.2"
|
||||||
ron = "0.8.0"
|
ron = "0.11.0"
|
||||||
fxhash = "0.2.1"
|
fxhash = "0.2.1"
|
||||||
strum = "0.27"
|
strum = "0.27"
|
||||||
strum_macros = "0.27"
|
strum_macros = "0.27"
|
||||||
@@ -73,10 +73,12 @@ approx = "0.5.1"
|
|||||||
# make a list of features used by these crates and compare them for both game.txt and editor.txt. If features
|
# make a list of features used by these crates and compare them for both game.txt and editor.txt. If features
|
||||||
# don't match, add a new dependency of the corresponding crate below with such features and the issue should
|
# don't match, add a new dependency of the corresponding crate below with such features and the issue should
|
||||||
# be fixed.
|
# be fixed.
|
||||||
hashbrown = { version = "0.14.3", features = ["raw"] }
|
hashbrown = { version = "0.15", features = ["default", "default-hasher"] }
|
||||||
imageproc = "0.25.0"
|
imageproc = "0.25.0"
|
||||||
|
serde_core = { version = "1.0.225", features = ["default"] }
|
||||||
|
wide = { version = "0.7.33", features = ["std", "default"] }
|
||||||
serde_json = { version = "1", features = ["raw_value", "default", "std", "unbounded_depth"] }
|
serde_json = { version = "1", features = ["raw_value", "default", "std", "unbounded_depth"] }
|
||||||
uuid = { version = "1.7.0", features = ["v4"] }
|
uuid = { version = "1", features = ["v4", "default", "js"] }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
enable_profiler = ["fyrox-core/enable_profiler"]
|
enable_profiler = ["fyrox-core/enable_profiler"]
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ impl ScreenSpaceAmbientOcclusionRenderer {
|
|||||||
let occlusion =
|
let occlusion =
|
||||||
server.create_2d_render_target("SsaoTexture", PixelKind::R32F, width, height)?;
|
server.create_2d_render_target("SsaoTexture", PixelKind::R32F, width, height)?;
|
||||||
|
|
||||||
let mut rng = crate::rand::thread_rng();
|
let mut rng = crate::rand::rng();
|
||||||
|
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
blur: Blur::new(server, width, height)?,
|
blur: Blur::new(server, width, height)?,
|
||||||
@@ -90,9 +90,9 @@ impl ScreenSpaceAmbientOcclusionRenderer {
|
|||||||
let k = i as f32 / KERNEL_SIZE as f32;
|
let k = i as f32 / KERNEL_SIZE as f32;
|
||||||
let scale = lerpf(0.1, 1.0, k * k);
|
let scale = lerpf(0.1, 1.0, k * k);
|
||||||
*v = Vector3::new(
|
*v = Vector3::new(
|
||||||
rng.gen_range(-1.0..1.0),
|
rng.random_range(-1.0..1.0),
|
||||||
rng.gen_range(-1.0..1.0),
|
rng.random_range(-1.0..1.0),
|
||||||
rng.gen_range(0.0..1.0),
|
rng.random_range(0.0..1.0),
|
||||||
)
|
)
|
||||||
// Make sphere
|
// Make sphere
|
||||||
.try_normalize(f32::EPSILON)
|
.try_normalize(f32::EPSILON)
|
||||||
@@ -106,8 +106,8 @@ impl ScreenSpaceAmbientOcclusionRenderer {
|
|||||||
const RGB_PIXEL_SIZE: usize = 3;
|
const RGB_PIXEL_SIZE: usize = 3;
|
||||||
let mut pixels = [0u8; RGB_PIXEL_SIZE * NOISE_SIZE * NOISE_SIZE];
|
let mut pixels = [0u8; RGB_PIXEL_SIZE * NOISE_SIZE * NOISE_SIZE];
|
||||||
for pixel in pixels.chunks_exact_mut(RGB_PIXEL_SIZE) {
|
for pixel in pixels.chunks_exact_mut(RGB_PIXEL_SIZE) {
|
||||||
pixel[0] = rng.gen_range(0u8..255u8); // R
|
pixel[0] = rng.random_range(0u8..255u8); // R
|
||||||
pixel[1] = rng.gen_range(0u8..255u8); // G
|
pixel[1] = rng.random_range(0u8..255u8); // G
|
||||||
pixel[2] = 0u8; // B
|
pixel[2] = 0u8; // B
|
||||||
}
|
}
|
||||||
server.create_texture(GpuTextureDescriptor {
|
server.create_texture(GpuTextureDescriptor {
|
||||||
|
|||||||
@@ -78,7 +78,6 @@ use std::{
|
|||||||
cmp::Ordering,
|
cmp::Ordering,
|
||||||
fmt::{Debug, Formatter},
|
fmt::{Debug, Formatter},
|
||||||
hash::Hash,
|
hash::Hash,
|
||||||
num::NonZeroUsize,
|
|
||||||
sync::Arc,
|
sync::Arc,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -637,13 +636,7 @@ impl PhysicsWorld {
|
|||||||
.integration_parameters
|
.integration_parameters
|
||||||
.normalized_max_corrective_velocity,
|
.normalized_max_corrective_velocity,
|
||||||
normalized_prediction_distance: self.integration_parameters.prediction_distance,
|
normalized_prediction_distance: self.integration_parameters.prediction_distance,
|
||||||
num_solver_iterations: NonZeroUsize::new(
|
num_solver_iterations: self.integration_parameters.num_solver_iterations,
|
||||||
self.integration_parameters.num_solver_iterations,
|
|
||||||
)
|
|
||||||
.unwrap(),
|
|
||||||
num_additional_friction_iterations: self
|
|
||||||
.integration_parameters
|
|
||||||
.num_additional_friction_iterations,
|
|
||||||
num_internal_pgs_iterations: self
|
num_internal_pgs_iterations: self
|
||||||
.integration_parameters
|
.integration_parameters
|
||||||
.num_internal_pgs_iterations,
|
.num_internal_pgs_iterations,
|
||||||
@@ -1048,7 +1041,7 @@ impl PhysicsWorld {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let mut builder = RigidBodyBuilder::new(rigid_body_node.body_type().into())
|
let mut builder = RigidBodyBuilder::new(rigid_body_node.body_type().into())
|
||||||
.position(isometry_from_global_transform(
|
.pose(isometry_from_global_transform(
|
||||||
&rigid_body_node.global_transform(),
|
&rigid_body_node.global_transform(),
|
||||||
))
|
))
|
||||||
.ccd_enabled(rigid_body_node.is_ccd_enabled())
|
.ccd_enabled(rigid_body_node.is_ccd_enabled())
|
||||||
|
|||||||
@@ -73,7 +73,6 @@ use std::{
|
|||||||
cmp::Ordering,
|
cmp::Ordering,
|
||||||
fmt::{Debug, Formatter},
|
fmt::{Debug, Formatter},
|
||||||
hash::Hash,
|
hash::Hash,
|
||||||
num::NonZeroUsize,
|
|
||||||
sync::Arc,
|
sync::Arc,
|
||||||
time::Duration,
|
time::Duration,
|
||||||
};
|
};
|
||||||
@@ -82,6 +81,7 @@ use strum_macros::{AsRefStr, EnumString, VariantNames};
|
|||||||
use fyrox_graph::{BaseSceneGraph, SceneGraphNode};
|
use fyrox_graph::{BaseSceneGraph, SceneGraphNode};
|
||||||
pub use rapier3d::geometry::shape::*;
|
pub use rapier3d::geometry::shape::*;
|
||||||
use rapier3d::parry::query::DefaultQueryDispatcher;
|
use rapier3d::parry::query::DefaultQueryDispatcher;
|
||||||
|
use rapier3d::prelude::FrictionModel;
|
||||||
|
|
||||||
/// Shape-dependent identifier.
|
/// Shape-dependent identifier.
|
||||||
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq)]
|
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq)]
|
||||||
@@ -873,10 +873,6 @@ pub struct IntegrationParameters {
|
|||||||
#[reflect(min_value = 0.0)]
|
#[reflect(min_value = 0.0)]
|
||||||
pub num_solver_iterations: usize,
|
pub num_solver_iterations: usize,
|
||||||
|
|
||||||
/// Number of addition friction resolution iteration run during the last solver sub-step (default: `4`).
|
|
||||||
#[reflect(min_value = 0.0)]
|
|
||||||
pub num_additional_friction_iterations: usize,
|
|
||||||
|
|
||||||
/// Number of internal Project Gauss Seidel (PGS) iterations run at each solver iteration (default: `1`).
|
/// Number of internal Project Gauss Seidel (PGS) iterations run at each solver iteration (default: `1`).
|
||||||
#[reflect(min_value = 0.0)]
|
#[reflect(min_value = 0.0)]
|
||||||
pub num_internal_pgs_iterations: usize,
|
pub num_internal_pgs_iterations: usize,
|
||||||
@@ -920,7 +916,6 @@ impl Default for IntegrationParameters {
|
|||||||
normalized_max_corrective_velocity: 10.0,
|
normalized_max_corrective_velocity: 10.0,
|
||||||
prediction_distance: 0.002,
|
prediction_distance: 0.002,
|
||||||
num_internal_pgs_iterations: 1,
|
num_internal_pgs_iterations: 1,
|
||||||
num_additional_friction_iterations: 4,
|
|
||||||
num_solver_iterations: 4,
|
num_solver_iterations: 4,
|
||||||
min_island_size: 128,
|
min_island_size: 128,
|
||||||
max_ccd_substeps: 4,
|
max_ccd_substeps: 4,
|
||||||
@@ -1124,13 +1119,7 @@ impl PhysicsWorld {
|
|||||||
.integration_parameters
|
.integration_parameters
|
||||||
.normalized_max_corrective_velocity,
|
.normalized_max_corrective_velocity,
|
||||||
normalized_prediction_distance: self.integration_parameters.prediction_distance,
|
normalized_prediction_distance: self.integration_parameters.prediction_distance,
|
||||||
num_solver_iterations: NonZeroUsize::new(
|
num_solver_iterations: self.integration_parameters.num_solver_iterations,
|
||||||
self.integration_parameters.num_solver_iterations,
|
|
||||||
)
|
|
||||||
.unwrap(),
|
|
||||||
num_additional_friction_iterations: self
|
|
||||||
.integration_parameters
|
|
||||||
.num_additional_friction_iterations,
|
|
||||||
num_internal_pgs_iterations: self
|
num_internal_pgs_iterations: self
|
||||||
.integration_parameters
|
.integration_parameters
|
||||||
.num_internal_pgs_iterations,
|
.num_internal_pgs_iterations,
|
||||||
@@ -1139,6 +1128,7 @@ impl PhysicsWorld {
|
|||||||
.num_internal_stabilization_iterations,
|
.num_internal_stabilization_iterations,
|
||||||
min_island_size: self.integration_parameters.min_island_size as usize,
|
min_island_size: self.integration_parameters.min_island_size as usize,
|
||||||
max_ccd_substeps: self.integration_parameters.max_ccd_substeps as usize,
|
max_ccd_substeps: self.integration_parameters.max_ccd_substeps as usize,
|
||||||
|
friction_model: FrictionModel::default(),
|
||||||
};
|
};
|
||||||
|
|
||||||
self.pipeline.step(
|
self.pipeline.step(
|
||||||
@@ -1596,7 +1586,7 @@ impl PhysicsWorld {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let mut builder = RigidBodyBuilder::new(rigid_body_node.body_type().into())
|
let mut builder = RigidBodyBuilder::new(rigid_body_node.body_type().into())
|
||||||
.position(isometry_from_global_transform(
|
.pose(isometry_from_global_transform(
|
||||||
&rigid_body_node.global_transform(),
|
&rigid_body_node.global_transform(),
|
||||||
))
|
))
|
||||||
.ccd_enabled(rigid_body_node.is_ccd_enabled())
|
.ccd_enabled(rigid_body_node.is_ccd_enabled())
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ use crate::{
|
|||||||
visitor::prelude::*,
|
visitor::prelude::*,
|
||||||
},
|
},
|
||||||
material::{self, Material, MaterialResource},
|
material::{self, Material, MaterialResource},
|
||||||
rand::{prelude::StdRng, Error, RngCore, SeedableRng},
|
rand::{prelude::StdRng, RngCore, SeedableRng},
|
||||||
renderer::{self, bundle::RenderContext},
|
renderer::{self, bundle::RenderContext},
|
||||||
scene::{
|
scene::{
|
||||||
base::{Base, BaseBuilder},
|
base::{Base, BaseBuilder},
|
||||||
@@ -109,11 +109,6 @@ impl RngCore for ParticleSystemRng {
|
|||||||
fn fill_bytes(&mut self, dest: &mut [u8]) {
|
fn fill_bytes(&mut self, dest: &mut [u8]) {
|
||||||
self.rng.fill_bytes(dest)
|
self.rng.fill_bytes(dest)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
|
||||||
fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error> {
|
|
||||||
self.rng.try_fill_bytes(dest)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Visit for ParticleSystemRng {
|
impl Visit for ParticleSystemRng {
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ use fyrox_core::swap_hash_map_entry;
|
|||||||
use crate::{
|
use crate::{
|
||||||
core::{algebra::Vector2, reflect::prelude::*, visitor::prelude::*},
|
core::{algebra::Vector2, reflect::prelude::*, visitor::prelude::*},
|
||||||
fxhash::FxHashMap,
|
fxhash::FxHashMap,
|
||||||
rand::{seq::IteratorRandom, thread_rng},
|
rand::{rng, seq::IteratorRandom},
|
||||||
};
|
};
|
||||||
use std::{
|
use std::{
|
||||||
cmp::Ordering,
|
cmp::Ordering,
|
||||||
@@ -317,7 +317,7 @@ impl TileSource for RandomTileSource<'_> {
|
|||||||
self.0.transformation()
|
self.0.transformation()
|
||||||
}
|
}
|
||||||
fn get_at(&self, _position: Vector2<i32>) -> Option<StampElement> {
|
fn get_at(&self, _position: Vector2<i32>) -> Option<StampElement> {
|
||||||
self.0.values().choose(&mut thread_rng()).cloned()
|
self.0.values().choose(&mut rng()).cloned()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -332,7 +332,7 @@ impl TileSource for PartialRandomTileSource<'_> {
|
|||||||
self.0.transformation()
|
self.0.transformation()
|
||||||
}
|
}
|
||||||
fn get_at(&self, _position: Vector2<i32>) -> Option<StampElement> {
|
fn get_at(&self, _position: Vector2<i32>) -> Option<StampElement> {
|
||||||
let pos = self.1.iter().choose(&mut thread_rng())?;
|
let pos = self.1.iter().choose(&mut rng())?;
|
||||||
self.0.get_at(pos)
|
self.0.get_at(pos)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -653,11 +653,11 @@ mod test {
|
|||||||
let mut paths_count = 0;
|
let mut paths_count = 0;
|
||||||
|
|
||||||
for _ in 0..1000 {
|
for _ in 0..1000 {
|
||||||
let sx = rand::thread_rng().gen_range(0..(size - 1));
|
let sx = rand::rng().random_range(0..(size - 1));
|
||||||
let sy = rand::thread_rng().gen_range(0..(size - 1));
|
let sy = rand::rng().random_range(0..(size - 1));
|
||||||
|
|
||||||
let tx = rand::thread_rng().gen_range(0..(size - 1));
|
let tx = rand::rng().random_range(0..(size - 1));
|
||||||
let ty = rand::thread_rng().gen_range(0..(size - 1));
|
let ty = rand::rng().random_range(0..(size - 1));
|
||||||
|
|
||||||
let from = sy * size + sx;
|
let from = sy * size + sx;
|
||||||
let to = ty * size + tx;
|
let to = ty * size + tx;
|
||||||
@@ -784,11 +784,11 @@ mod test {
|
|||||||
);
|
);
|
||||||
|
|
||||||
for _ in 0..1000 {
|
for _ in 0..1000 {
|
||||||
let sx = rand::thread_rng().gen_range(0..(size - 1));
|
let sx = rand::rng().random_range(0..(size - 1));
|
||||||
let sy = rand::thread_rng().gen_range(0..(size - 1));
|
let sy = rand::rng().random_range(0..(size - 1));
|
||||||
|
|
||||||
let tx = rand::thread_rng().gen_range(0..(size - 1));
|
let tx = rand::rng().random_range(0..(size - 1));
|
||||||
let ty = rand::thread_rng().gen_range(0..(size - 1));
|
let ty = rand::rng().random_range(0..(size - 1));
|
||||||
|
|
||||||
let from = sy * size + sx;
|
let from = sy * size + sx;
|
||||||
let to = ty * size + tx;
|
let to = ty * size + tx;
|
||||||
@@ -870,12 +870,12 @@ mod test {
|
|||||||
|
|
||||||
for _ in 0..1000 {
|
for _ in 0..1000 {
|
||||||
// generates a random start point on the left half of the grid
|
// generates a random start point on the left half of the grid
|
||||||
let sx = rand::thread_rng().gen_range(0..((size / 2) - 1));
|
let sx = rand::rng().random_range(0..((size / 2) - 1));
|
||||||
let sy = rand::thread_rng().gen_range(0..(size - 1));
|
let sy = rand::rng().random_range(0..(size - 1));
|
||||||
|
|
||||||
// generates a random end point on the right half of the grid
|
// generates a random end point on the right half of the grid
|
||||||
let tx = rand::thread_rng().gen_range((size / 2)..(size - 1));
|
let tx = rand::rng().random_range((size / 2)..(size - 1));
|
||||||
let ty = rand::thread_rng().gen_range(0..(size - 1));
|
let ty = rand::rng().random_range(0..(size - 1));
|
||||||
|
|
||||||
let from = sy * size + sx;
|
let from = sy * size + sx;
|
||||||
let to = ty * size + tx;
|
let to = ty * size + tx;
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ fxhash = "0.2.1"
|
|||||||
lazy_static = "1.4.0"
|
lazy_static = "1.4.0"
|
||||||
uuid = "1"
|
uuid = "1"
|
||||||
serde = { version = "1", features = ["derive"] }
|
serde = { version = "1", features = ["derive"] }
|
||||||
ron = "0.8.0"
|
ron = "0.11.0"
|
||||||
regex = "1"
|
regex = "1"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ rust-version = "1.86"
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
fyrox-core = { path = "../fyrox-core", version = "1.0.0-rc.1", features = ["serde"] }
|
fyrox-core = { path = "../fyrox-core", version = "1.0.0-rc.1", features = ["serde"] }
|
||||||
fxhash = "0.2.1"
|
fxhash = "0.2.1"
|
||||||
ron = "0.8.0"
|
ron = "0.11.0"
|
||||||
serde = { version = "1", features = ["derive"] }
|
serde = { version = "1", features = ["derive"] }
|
||||||
walkdir = "2.3.2"
|
walkdir = "2.3.2"
|
||||||
rayon = "1.7.0"
|
rayon = "1.7.0"
|
||||||
@@ -28,7 +28,7 @@ use fyrox_core::io::FileError;
|
|||||||
use fyrox_core::reflect::Reflect;
|
use fyrox_core::reflect::Reflect;
|
||||||
use ron::ser::PrettyConfig;
|
use ron::ser::PrettyConfig;
|
||||||
use serde::{de::DeserializeOwned, Serialize};
|
use serde::{de::DeserializeOwned, Serialize};
|
||||||
use std::io::ErrorKind;
|
use std::io::{ErrorKind, Write};
|
||||||
use std::{fs::File, path::Path};
|
use std::{fs::File, path::Path};
|
||||||
|
|
||||||
/// Extension of import options file.
|
/// Extension of import options file.
|
||||||
@@ -47,8 +47,9 @@ pub trait ImportOptions:
|
|||||||
{
|
{
|
||||||
/// Saves import options into a specified file.
|
/// Saves import options into a specified file.
|
||||||
fn save_internal(&self, path: &Path) -> bool {
|
fn save_internal(&self, path: &Path) -> bool {
|
||||||
if let Ok(file) = File::create(path) {
|
if let Ok(mut file) = File::create(path) {
|
||||||
if ron::ser::to_writer_pretty(file, self, PrettyConfig::default()).is_ok() {
|
if let Ok(string) = ron::ser::to_string_pretty(self, PrettyConfig::default()) {
|
||||||
|
Log::verify(file.write_all(string.as_bytes()));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -30,7 +30,7 @@ strum = "0.27"
|
|||||||
strum_macros = "0.27"
|
strum_macros = "0.27"
|
||||||
serde = { version = "1", features = ["derive"] }
|
serde = { version = "1", features = ["derive"] }
|
||||||
bytemuck = { version = "1.23.2", features = ["derive"] }
|
bytemuck = { version = "1.23.2", features = ["derive"] }
|
||||||
uuid = { version = "1.7.0", features = ["v4"] }
|
uuid = { version = "1", features = ["v4", "default"] }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
enable_profiler = ["fyrox-core/enable_profiler"]
|
enable_profiler = ["fyrox-core/enable_profiler"]
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ fyrox = { version = "1.0.0-rc.1", path = "../fyrox" }
|
|||||||
fyrox-template-core = { version = "1.0.0-rc.1", path = "../template-core" }
|
fyrox-template-core = { version = "1.0.0-rc.1", path = "../template-core" }
|
||||||
fyrox-build-tools = { version = "1.0.0-rc.1", path = "../fyrox-build-tools" }
|
fyrox-build-tools = { version = "1.0.0-rc.1", path = "../fyrox-build-tools" }
|
||||||
serde = { version = "1", features = ["derive"] }
|
serde = { version = "1", features = ["derive"] }
|
||||||
ron = "0.8.1"
|
ron = "0.11.0"
|
||||||
open = "5.0.1"
|
open = "5.0.1"
|
||||||
cargo_metadata = "0.19.0"
|
cargo_metadata = "0.22.0"
|
||||||
serde_json = "1.0.133"
|
serde_json = "1.0.133"
|
||||||
directories = "5.0.1"
|
directories = "5.0.1"
|
||||||
@@ -879,7 +879,7 @@ impl ProjectManager {
|
|||||||
{
|
{
|
||||||
self.settings.projects.push(Project {
|
self.settings.projects.push(Project {
|
||||||
manifest_path,
|
manifest_path,
|
||||||
name: game_package.name.clone(),
|
name: game_package.name.as_str().to_string(),
|
||||||
hot_reload: false,
|
hot_reload: false,
|
||||||
});
|
});
|
||||||
self.refresh(ui);
|
self.refresh(ui);
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ impl UpgradeTool {
|
|||||||
let is_git = dependency
|
let is_git = dependency
|
||||||
.source
|
.source
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.is_some_and(|s| s.contains("https://github.com/FyroxEngine/Fyrox"));
|
.is_some_and(|s| s.repr.contains("https://github.com/FyroxEngine/Fyrox"));
|
||||||
let selected_version = if is_local {
|
let selected_version = if is_local {
|
||||||
Version::Local
|
Version::Local
|
||||||
} else if is_git {
|
} else if is_git {
|
||||||
|
|||||||
@@ -137,9 +137,9 @@ fn to_pretty_version(version_req: &VersionReq) -> String {
|
|||||||
pub fn fyrox_version_string(metadata: &Metadata) -> Option<String> {
|
pub fn fyrox_version_string(metadata: &Metadata) -> Option<String> {
|
||||||
fyrox_dependency(metadata).and_then(|dependency| {
|
fyrox_dependency(metadata).and_then(|dependency| {
|
||||||
if let Some(source) = dependency.source.as_ref() {
|
if let Some(source) = dependency.source.as_ref() {
|
||||||
if source.contains("registry+") {
|
if source.repr.contains("registry+") {
|
||||||
return Some(to_pretty_version(&dependency.req));
|
return Some(to_pretty_version(&dependency.req));
|
||||||
} else if source.contains("git+") {
|
} else if source.repr.contains("git+") {
|
||||||
return Some("nightly".to_string());
|
return Some("nightly".to_string());
|
||||||
}
|
}
|
||||||
} else if let Some(path) = dependency.path.as_ref() {
|
} else if let Some(path) = dependency.path.as_ref() {
|
||||||
|
|||||||
@@ -15,11 +15,11 @@ rust-version = "1.86"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
uuid = { version = "1", features = ["v4"] }
|
uuid = { version = "1", features = ["v4"] }
|
||||||
convert_case = "0.6.0"
|
convert_case = "0.8.0"
|
||||||
toml = "0.8.10"
|
toml = "0.9.6"
|
||||||
toml_edit = "0.22.6"
|
toml_edit = "0.23.5"
|
||||||
regex = "1.7.3"
|
regex = "1.7.3"
|
||||||
unicode-xid = "0.2.6"
|
unicode-xid = "0.2.6"
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
toml_edit = "0.22.6"
|
toml_edit = "0.23.5"
|
||||||
Reference in New Issue
Block a user