lol idk #1

Open
Quaternions wants to merge 826 commits from StrafesNET/strafe-project:master into master
Showing only changes of commit f58cf4ec2a - Show all commits

View File

@ -41,7 +41,15 @@ impl Loader{
impl Loader{
pub fn load_textures(&self)->Result<Textures,std::io::Error>{
Ok(Textures::new(Vec::new()))
let mut texture_data=vec![Vec::<u8>::new();self.texture_loader.texture_paths.len()];
for (texture_path,texture_id) in &self.texture_loader.texture_paths{
let path=std::path::PathBuf::from(format!("textures/{}.dds",texture_path.display()));
if let Ok(mut file)=std::fs::File::open(path){
//TODO: parallel
file.read_to_end(texture_data.get_mut(texture_id.get() as usize).unwrap())?;
}
}
Ok(Textures::new(texture_data.into_iter().map(Texture::ImageDDS).collect()))
}
//load_meshes should look like load_textures
/*