types: use const generics for more generic coordinate types

Enum support in const generics would be even nicer, but for now the
integer generic is the best Rust can do.
This commit is contained in:
Matthias Schiffer 2023-08-02 00:14:37 +02:00
parent 80781c9c20
commit e39f48d8fe
Signed by: neocturne
GPG key ID: 16EF3F64CB201D9C
3 changed files with 39 additions and 23 deletions

View file

@ -57,8 +57,8 @@ impl<'a> RegionProcessor<'a> {
image::GrayAlphaImage::from_fn(N, N, |x, z| {
let v: f32 = block_light[LayerBlockCoords {
x: BlockX(x as u8),
z: BlockZ(z as u8),
x: BlockX::new(x),
z: BlockZ::new(z),
}]
.into();
image::LumaA([0, (192.0 * (1.0 - v / 15.0)) as u8])