mutable reference external api is unnecessary

This commit is contained in:
Quaternions 2024-02-15 01:41:26 -08:00
parent 45b2af405b
commit f91de2d669
2 changed files with 4 additions and 4 deletions

View File

@ -6,7 +6,7 @@ fn valve_transform(v:[f32;3])->integer::Planar64Vec3{
}
pub fn convert_bsp<AcquireRenderConfigId,AcquireMeshId>(
bsp:&vbsp::Bsp,
acquire_render_config_id:&mut AcquireRenderConfigId,
mut acquire_render_config_id:AcquireRenderConfigId,
mut acquire_mesh_id:AcquireMeshId
)->PartialMap1
where
@ -151,7 +151,7 @@ impl PartialMap1{
pub fn add_prop_meshes<AcquireRenderConfigId>(
self,
prop_meshes:impl IntoIterator<Item=(model::MeshId,crate::data::ModelData)>,
acquire_render_config_id:&mut AcquireRenderConfigId,
mut acquire_render_config_id:AcquireRenderConfigId,
)->PartialMap2
where
AcquireRenderConfigId:FnMut(Option<&str>)->model::RenderConfigId,
@ -160,7 +160,7 @@ impl PartialMap1{
attributes:self.attributes,
prop_meshes:prop_meshes.into_iter().filter_map(|(mesh_id,model_data)|
//this will generate new render ids and texture ids
match convert_mesh(model_data,acquire_render_config_id){
match convert_mesh(model_data,&mut acquire_render_config_id){
Ok(mesh)=>Some((mesh_id,mesh)),
Err(e)=>{
println!("error converting mesh: {e}");

View File

@ -26,7 +26,7 @@ pub fn read<R:std::io::Read>(mut input:R)->Result<Bsp,ReadError>{
pub fn convert<AcquireRenderConfigId,AcquireMeshId>(
bsp:&Bsp,
acquire_render_config_id:&mut AcquireRenderConfigId,
acquire_render_config_id:AcquireRenderConfigId,
acquire_mesh_id:AcquireMeshId
)->bsp::PartialMap1
where