mirror of
https://github.com/Garux/netradiant-custom.git
synced 2026-09-28 00:00:03 +02:00
add and use path_extension_is()
This commit is contained in:
@@ -693,10 +693,9 @@ scene::Node& loadPicoModel( Assimp::Importer& importer, ArchiveFile& file ){
|
||||
if( scene != nullptr ){
|
||||
if( scene->mFlags & AI_SCENE_FLAGS_INCOMPLETE )
|
||||
globalWarningStream() << "AI_SCENE_FLAGS_INCOMPLETE\n";
|
||||
const char *ext = path_get_extension( file.getName() );
|
||||
const auto rootPath = StringOutputStream()( PathFilenameless( file.getName() ) );
|
||||
const auto matName = StringOutputStream()( PathExtensionless( file.getName() ) );
|
||||
return ( new PicoModelNode( AssScene{ scene, rootPath, string_equal_nocase( ext, "mdl" )? matName.c_str() : nullptr } ) )->node();
|
||||
return ( new PicoModelNode( AssScene{ scene, rootPath, path_extension_is( file.getName(), "mdl" )? matName.c_str() : nullptr } ) )->node();
|
||||
}
|
||||
else{
|
||||
return ( new PicoModelNode() )->node();
|
||||
|
||||
@@ -1580,7 +1580,7 @@ void BuildShaderList( TextInputStream& shaderlist ){
|
||||
{
|
||||
// each token should be a shader filename
|
||||
shaderFile << token;
|
||||
if( !string_equal_nocase( path_get_extension( token ), g_shadersExtension ) )
|
||||
if( !path_extension_is( token, g_shadersExtension ) )
|
||||
shaderFile << "." << g_shadersExtension;
|
||||
|
||||
ShaderList_addShaderFile( shaderFile.c_str() );
|
||||
|
||||
@@ -187,7 +187,7 @@ public:
|
||||
if ( subname[0] == '/' ) {
|
||||
++subname;
|
||||
}
|
||||
if ( m_extension[0] == '*' || extension_equal( path_get_extension( subname ), m_extension ) ) {
|
||||
if ( m_extension[0] == '*' || path_extension_is( subname, m_extension ) ) {
|
||||
pathlist_append_unique( m_matches, subname );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user