Commit 2d860ed3 authored by chili's avatar chili
Browse files

check return value of GetTexture (specular)

parent 054d8661
...@@ -281,8 +281,10 @@ std::unique_ptr<Mesh> Model::ParseMesh( Graphics& gfx,const aiMesh& mesh,const a ...@@ -281,8 +281,10 @@ std::unique_ptr<Mesh> Model::ParseMesh( Graphics& gfx,const aiMesh& mesh,const a
material.GetTexture( aiTextureType_DIFFUSE,0,&texFileName ); material.GetTexture( aiTextureType_DIFFUSE,0,&texFileName );
bindablePtrs.push_back( std::make_unique<Bind::Texture>( gfx,Surface::FromFile( base + texFileName.C_Str() ) ) ); bindablePtrs.push_back( std::make_unique<Bind::Texture>( gfx,Surface::FromFile( base + texFileName.C_Str() ) ) );
material.GetTexture( aiTextureType_SPECULAR,0,&texFileName ); if( material.GetTexture( aiTextureType_SPECULAR,0,&texFileName ) == aiReturn_SUCCESS )
bindablePtrs.push_back( std::make_unique<Bind::Texture>( gfx,Surface::FromFile( base + texFileName.C_Str() ),1 ) ); {
bindablePtrs.push_back( std::make_unique<Bind::Texture>( gfx,Surface::FromFile( base + texFileName.C_Str() ),1 ) );
}
bindablePtrs.push_back( std::make_unique<Bind::Sampler>( gfx ) ); bindablePtrs.push_back( std::make_unique<Bind::Sampler>( gfx ) );
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment