mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-07-03 06:09:07 +02:00
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:
parent
80781c9c20
commit
e39f48d8fe
3 changed files with 39 additions and 23 deletions
|
@ -28,8 +28,8 @@ impl<'a> TileRenderer<'a> {
|
|||
|
||||
let chunk_image = image::RgbaImage::from_fn(N, N, |x, z| {
|
||||
let coords = LayerBlockCoords {
|
||||
x: BlockX(x as u8),
|
||||
z: BlockZ(z as u8),
|
||||
x: BlockX::new(x),
|
||||
z: BlockZ::new(z),
|
||||
};
|
||||
image::Rgba(
|
||||
match (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue