From 6bf68e77e26b39d8715b2fd670deda926f0fdd7e Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Thu, 26 Sep 2019 13:34:15 +0100 Subject: [PATCH] Resolved warnings --- voxygen/src/mesh/terrain.rs | 13 +------------ voxygen/src/mesh/vol.rs | 8 ++++---- world/src/generator/town/mod.rs | 5 ++++- world/src/generator/town/vol.rs | 7 ------- 4 files changed, 9 insertions(+), 24 deletions(-) diff --git a/voxygen/src/mesh/terrain.rs b/voxygen/src/mesh/terrain.rs index d06c6a47a5..bb38183b15 100644 --- a/voxygen/src/mesh/terrain.rs +++ b/voxygen/src/mesh/terrain.rs @@ -3,7 +3,7 @@ use crate::{ render::{self, FluidPipeline, Mesh, TerrainPipeline}, }; use common::{ - terrain::{Block, BlockKind}, + terrain::Block, vol::{ReadVol, RectRasterableVol, Vox}, volumes::vol_grid_2d::VolGrid2d, }; @@ -124,17 +124,6 @@ fn calc_light + ReadVol + Debug>( } } -fn block_shadow_density(kind: BlockKind) -> (f32, f32) { - // (density, cap) - match kind { - BlockKind::Normal => (0.085, 0.3), - BlockKind::Dense => (0.3, 0.0), - BlockKind::Water => (0.15, 0.0), - kind if kind.is_air() => (0.0, 0.0), - _ => (1.0, 0.0), - } -} - impl + ReadVol + Debug> Meshable for VolGrid2d { diff --git a/voxygen/src/mesh/vol.rs b/voxygen/src/mesh/vol.rs index 4a5983520c..1aca68ad81 100644 --- a/voxygen/src/mesh/vol.rs +++ b/voxygen/src/mesh/vol.rs @@ -62,12 +62,12 @@ fn get_ao_quad( #[allow(unsafe_code)] fn get_col_quad( - vol: &V, - pos: Vec3, - shift: Vec3, + _vol: &V, + _pos: Vec3, + _shift: Vec3, dirs: &[Vec3], cols: &[[[Option>; 3]; 3]; 3], - is_opaque: impl Fn(&V::Vox) -> bool, + _is_opaque: impl Fn(&V::Vox) -> bool, ) -> Vec4> { dirs.windows(2) .map(|offs| { diff --git a/world/src/generator/town/mod.rs b/world/src/generator/town/mod.rs index 37dbaad405..7073cd92e4 100644 --- a/world/src/generator/town/mod.rs +++ b/world/src/generator/town/mod.rs @@ -412,7 +412,7 @@ impl TownVol { false } }) { - self.set(cell, CellKind::Well.into()); + let _ = self.set(cell, CellKind::Well.into()); } } } @@ -694,6 +694,8 @@ lazy_static! { }; } +/* +// TODO struct ModuleModel { near: u64, mask: u64, @@ -711,3 +713,4 @@ impl ModuleModel { unimplemented!() } } +*/ diff --git a/world/src/generator/town/vol.rs b/world/src/generator/town/vol.rs index 27bcdd1a7a..22446a8d4e 100644 --- a/world/src/generator/town/vol.rs +++ b/world/src/generator/town/vol.rs @@ -58,13 +58,6 @@ pub struct TownCell { } impl TownCell { - pub fn is_road(&self) -> bool { - match self.kind { - CellKind::Road => true, - _ => false, - } - } - pub fn is_space(&self) -> bool { match self.kind { CellKind::Empty => true,