mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-07-01 05:29:05 +02:00
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:
parent
1432df7c93
commit
1812e5c6d6
5 changed files with 32 additions and 34 deletions
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue