@@ -74,7 +74,7 @@ impl Gltf {
74
74
new_node. children = new_node. children . map ( |children| {
75
75
children
76
76
. iter ( )
77
- . map ( |child_index| self . clone_node ( child_index. clone ( ) , None , None , None ) )
77
+ . map ( |child_index| self . clone_node ( * child_index, None , None , None ) )
78
78
. collect ( )
79
79
} ) ;
80
80
if let Some ( position) = position {
@@ -721,7 +721,7 @@ impl Gltf {
721
721
. write_all ( & color. b . to_le_bytes ( ) )
722
722
. expect ( "failed to write colors to buffer" ) ;
723
723
buffer_vec
724
- . write_all ( & ( 1.0 as f32 ) . to_le_bytes ( ) )
724
+ . write_all ( & 1.0_f32 . to_le_bytes ( ) )
725
725
. expect ( "failed to write colors to buffer" ) ;
726
726
// buffer_vec
727
727
// .write_all(&color.a.to_le_bytes())
@@ -1090,42 +1090,4 @@ impl Gltf {
1090
1090
self . root . nodes . push ( node) ;
1091
1091
Some ( json:: Index :: new ( self . root . nodes . len ( ) as u32 - 1 ) )
1092
1092
}
1093
-
1094
- pub fn visit_texturing_property (
1095
- & mut self ,
1096
- nif : & Nif ,
1097
- texturing_property : & NiTexturingProperty ,
1098
- ) -> Option < String > {
1099
- if !texturing_property. has_base_texture || texturing_property. base_texture . is_none ( ) {
1100
- return None ;
1101
- }
1102
-
1103
- let diffuse_tex_desc = texturing_property. base_texture . as_ref ( ) . unwrap ( ) ;
1104
-
1105
- let diffuse_source = nif
1106
- . blocks
1107
- . get ( diffuse_tex_desc. source_ref as usize )
1108
- . expect ( "invalid property ref" ) ;
1109
-
1110
- match diffuse_source {
1111
- Block :: NiSourceTexture ( source_texture) => self . visit_source_texture ( source_texture) ,
1112
- _ => None ,
1113
- }
1114
- }
1115
-
1116
- pub fn visit_source_texture ( & mut self , source_texture : & NiSourceTexture ) -> Option < String > {
1117
- if source_texture. use_external == 0 {
1118
- return None ;
1119
- }
1120
-
1121
- Some (
1122
- source_texture
1123
- . file_name
1124
- . value
1125
- . replace ( ".tga" , ".dds" )
1126
- . replace ( ".TGA" , ".dds" )
1127
- . replace ( ".bmp" , ".dds" )
1128
- . replace ( ".BMP" , ".dds" ) ,
1129
- )
1130
- }
1131
1093
}
0 commit comments