Add type alias for f32 colors to minedmap-resource

Allow removing the dependency on a specific glam version from the main
crate.
This commit is contained in:
Matthias Schiffer 2023-12-29 20:13:03 +01:00
parent 1432df7c93
commit 1812e5c6d6
Signed by: neocturne
GPG key ID: 16EF3F64CB201D9C
5 changed files with 32 additions and 34 deletions

View file

@ -8,7 +8,6 @@ use std::{
};
use anyhow::{Context, Result};
use glam::Vec3;
use lru::LruCache;
use rayon::prelude::*;
use tokio::sync::OnceCell;
@ -17,7 +16,7 @@ use tracing::{debug, info};
use super::{common::*, region_group::RegionGroup};
use crate::{
io::{fs, storage},
resource::{block_color, needs_biome},
resource::{block_color, needs_biome, Colorf},
types::*,
util::coord_offset,
};
@ -128,7 +127,7 @@ impl<'a> TileRenderer<'a> {
chunk: &ProcessedChunk,
chunk_coords: ChunkCoords,
block_coords: LayerBlockCoords,
) -> Option<Vec3> {
) -> Option<Colorf> {
/// Helper for keys in the weight table
///
/// Hashing the value as a single u32 is more efficient than hashing
@ -182,7 +181,7 @@ impl<'a> TileRenderer<'a> {
return None;
}
let mut color = Vec3::ZERO;
let mut color = Colorf::ZERO;
let mut total = 0.0;
for ((region_x, region_z, index), w) in weights.into_values() {