From c48b54f3fb7bbe9046915eb99eca02fa84dc55c9 Mon Sep 17 00:00:00 2001 From: tcmal Date: Sun, 25 Aug 2024 17:44:22 +0100 Subject: feat(render): multithreaded texture loading also a bunch of supporting changes --- stockton-levels/src/q3/light_maps.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'stockton-levels/src/q3/light_maps.rs') diff --git a/stockton-levels/src/q3/light_maps.rs b/stockton-levels/src/q3/light_maps.rs index 605b7c2..6e07d33 100644 --- a/stockton-levels/src/q3/light_maps.rs +++ b/stockton-levels/src/q3/light_maps.rs @@ -15,10 +15,10 @@ * with this program. If not, see . */ -use super::Q3BSPFile; +use super::Q3BspFile; use crate::coords::CoordSystem; use crate::traits::light_maps::*; -use crate::types::{ParseError, Result, RGB}; +use crate::types::{ParseError, Result, Rgb}; /// The size of one LightMap const LIGHTMAP_SIZE: usize = 128 * 128 * 3; @@ -33,12 +33,12 @@ pub fn from_data(data: &[u8]) -> Result> { let mut maps = Vec::with_capacity(length as usize); for n in 0..length { let raw = &data[n * LIGHTMAP_SIZE..(n + 1) * LIGHTMAP_SIZE]; - let mut map: [[RGB; 128]; 128] = [[RGB::white(); 128]; 128]; + let mut map: [[Rgb; 128]; 128] = [[Rgb::white(); 128]; 128]; for (x, outer) in map.iter_mut().enumerate() { for (y, inner) in outer.iter_mut().enumerate() { let offset = (x * 128 * 3) + (y * 3); - *inner = RGB::from_slice(&raw[offset..offset + 3]); + *inner = Rgb::from_slice(&raw[offset..offset + 3]); } } maps.push(LightMap { map }) @@ -47,7 +47,7 @@ pub fn from_data(data: &[u8]) -> Result> { Ok(maps.into_boxed_slice()) } -impl HasLightMaps for Q3BSPFile { +impl HasLightMaps for Q3BspFile { type LightMapsIter<'a> = std::slice::Iter<'a, LightMap>; fn lightmaps_iter(&self) -> Self::LightMapsIter<'_> { -- cgit v1.2.3