mirror of
				https://github.com/luanti-org/luanti.git
				synced 2025-11-03 16:55:24 +01:00 
			
		
		
		
	Fix gltf / glb loader oversights
- Avoid an unnecessary copy - Reject models requiring extensions Co-authored-by: DS <ds.desour@proton.me>
This commit is contained in:
		
				
					committed by
					
						
						Lars Müller
					
				
			
			
				
	
			
			
			
						parent
						
							521e678d39
						
					
				
				
					commit
					2fee37f31b
				
			@@ -320,6 +320,11 @@ IAnimatedMesh* SelfType::createMesh(io::IReadFile* file)
 | 
			
		||||
	if (!model.has_value()) {
 | 
			
		||||
		return nullptr;
 | 
			
		||||
	}
 | 
			
		||||
	if (model->extensionsRequired) {
 | 
			
		||||
		os::Printer::log("glTF loader",
 | 
			
		||||
				"model requires extensions, but we support none", ELL_ERROR);
 | 
			
		||||
		return nullptr;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (!(model->buffers.has_value()
 | 
			
		||||
			&& model->bufferViews.has_value()
 | 
			
		||||
 
 | 
			
		||||
@@ -98,7 +98,7 @@ private:
 | 
			
		||||
	public:
 | 
			
		||||
		MeshExtractor(tiniergltf::GlTF &&model,
 | 
			
		||||
				CSkinnedMesh *mesh) noexcept
 | 
			
		||||
			: m_gltf_model(model), m_irr_model(mesh) {};
 | 
			
		||||
			: m_gltf_model(std::move(model)), m_irr_model(mesh) {};
 | 
			
		||||
 | 
			
		||||
		/* Gets indices for the given mesh/primitive.
 | 
			
		||||
		 *
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user