fix warnings

This commit is contained in:
IsseW 2022-10-09 23:42:38 +02:00
parent 0a6ac5f5f1
commit c8a08b4794
4 changed files with 12 additions and 32 deletions

View File

@ -180,11 +180,7 @@ pub fn apply_trees_to(
ForestKind::Redwood => {
break 'model TreeModel::Procedural(
ProceduralTree::generate(
TreeConfig::redwood(
&mut RandomPerm::new(seed),
scale,
calendar,
),
TreeConfig::redwood(&mut RandomPerm::new(seed), scale),
&mut RandomPerm::new(seed),
),
StructureBlock::PineLeaves,
@ -419,7 +415,6 @@ impl TreeConfig {
pub fn dead(rng: &mut impl Rng, scale: f32) -> Self {
let scale = scale * (0.8 + rng.gen::<f32>().powi(2) * 0.5);
let log_scale = 1.0 + scale.log2().max(0.0);
Self {
trunk_len: 9.0 * scale,
@ -671,7 +666,7 @@ impl TreeConfig {
}
}
pub fn redwood(rng: &mut impl Rng, scale: f32, calendar: Option<&Calendar>) -> Self {
pub fn redwood(rng: &mut impl Rng, scale: f32) -> Self {
let scale = scale * (1.0 + rng.gen::<f32>().powi(4) * 0.5);
let log_scale = 1.0 + scale.log2().max(0.0);

View File

@ -7,12 +7,7 @@
)]
#![allow(clippy::branches_sharing_code)] // TODO: evaluate
#![deny(clippy::clone_on_ref_ptr)]
#![feature(
option_zip,
arbitrary_enum_discriminant,
int_log,
map_first_last,
)]
#![feature(option_zip, arbitrary_enum_discriminant, int_log, map_first_last)]
mod all;
mod block;
@ -490,7 +485,7 @@ impl World {
Some(lod::Object {
kind: match tree.forest_kind {
all::ForestKind::Oak => lod::ObjectKind::Oak,
all::ForestKind::Pine | all::ForestKind::Frostpine => {
all::ForestKind::Pine | all::ForestKind::Frostpine | all::ForestKind::Redwood => {
lod::ObjectKind::Pine
},
_ => lod::ObjectKind::Oak,

View File

@ -1,8 +1,8 @@
mod castle;
mod citadel;
mod cliff_tower;
mod desert_city_multiplot;
mod desert_city_temple;
mod citadel;
pub mod dungeon;
mod giant_tree;
mod gnarling;
@ -11,9 +11,10 @@ mod sea_chapel;
mod workshop;
pub use self::{
castle::Castle, cliff_tower::CliffTower, desert_city_multiplot::DesertCityMultiPlot,
desert_city_temple::DesertCityTemple, dungeon::Dungeon, giant_tree::GiantTree,
gnarling::GnarlingFortification, house::House, sea_chapel::SeaChapel, workshop::Workshop, citadel::Citadel,
castle::Castle, citadel::Citadel, cliff_tower::CliffTower,
desert_city_multiplot::DesertCityMultiPlot, desert_city_temple::DesertCityTemple,
dungeon::Dungeon, giant_tree::GiantTree, gnarling::GnarlingFortification, house::House,
sea_chapel::SeaChapel, workshop::Workshop,
};
use super::*;

View File

@ -1,16 +1,5 @@
use super::*;
use crate::{
assets::AssetHandle,
site2::util::Dir,
util::{attempt, sampler::Sampler, RandomField, NEIGHBORS},
Land,
};
use common::{
generation::{ChunkSupplement, EntityInfo},
terrain::{Structure as PrefabStructure, StructuresGroup},
};
use kiddo::{distance::squared_euclidean, KdTree};
use lazy_static::lazy_static;
use crate::{util::NEIGHBORS, Land};
use rand::prelude::*;
use std::ops::{Add, Div, Mul};
use vek::*;
@ -24,7 +13,7 @@ const CELL_SIZE: i32 = 16;
pub struct Citadel {
name: String,
seed: u32,
_seed: u32,
origin: Vec3<i32>,
radius: i32,
grid: Grid<Option<Cell>>,
@ -83,7 +72,7 @@ impl Citadel {
Self {
name,
seed,
_seed: seed,
origin,
radius,
grid,