Resolved warnings

This commit is contained in:
Joshua Barretto 2019-09-26 13:34:15 +01:00
parent b1d4ae7445
commit 81dc77c87b
4 changed files with 9 additions and 24 deletions

View File

@ -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<V: RectRasterableVol<Vox = Block> + 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<V: RectRasterableVol<Vox = Block> + ReadVol + Debug> Meshable<TerrainPipeline, FluidPipeline>
for VolGrid2d<V>
{

View File

@ -62,12 +62,12 @@ fn get_ao_quad<V: ReadVol>(
#[allow(unsafe_code)]
fn get_col_quad<V: ReadVol>(
vol: &V,
pos: Vec3<i32>,
shift: Vec3<i32>,
_vol: &V,
_pos: Vec3<i32>,
_shift: Vec3<i32>,
dirs: &[Vec3<i32>],
cols: &[[[Option<Rgb<f32>>; 3]; 3]; 3],
is_opaque: impl Fn(&V::Vox) -> bool,
_is_opaque: impl Fn(&V::Vox) -> bool,
) -> Vec4<Rgb<f32>> {
dirs.windows(2)
.map(|offs| {

View File

@ -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!()
}
}
*/

View File

@ -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,