simplify
This commit is contained in:
+6
-10
@@ -253,15 +253,13 @@ void Model::LoadMaterialsFromMilkshapeAscii( const RString &_sPath )
|
|||||||
RString sTexturePath = sDir + sDiffuseTexture;
|
RString sTexturePath = sDir + sDiffuseTexture;
|
||||||
FixSlashesInPlace( sTexturePath );
|
FixSlashesInPlace( sTexturePath );
|
||||||
CollapsePath( sTexturePath );
|
CollapsePath( sTexturePath );
|
||||||
if( IsAFile(sTexturePath) )
|
if( !IsAFile(sTexturePath) )
|
||||||
{
|
|
||||||
Material.diffuse.Load( sTexturePath );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
RString sError = ssprintf( "'%s' references a texture '%s' that does not exist", sPath.c_str(), sTexturePath.c_str() );
|
RString sError = ssprintf( "'%s' references a texture '%s' that does not exist", sPath.c_str(), sTexturePath.c_str() );
|
||||||
RageException::Throw( sError );
|
RageException::Throw( sError );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Material.diffuse.Load( sTexturePath );
|
||||||
}
|
}
|
||||||
|
|
||||||
// alpha texture
|
// alpha texture
|
||||||
@@ -280,15 +278,13 @@ void Model::LoadMaterialsFromMilkshapeAscii( const RString &_sPath )
|
|||||||
RString sTexturePath = sDir + sAlphaTexture;
|
RString sTexturePath = sDir + sAlphaTexture;
|
||||||
FixSlashesInPlace( sTexturePath );
|
FixSlashesInPlace( sTexturePath );
|
||||||
CollapsePath( sTexturePath );
|
CollapsePath( sTexturePath );
|
||||||
if( IsAFile(sTexturePath) )
|
if( !IsAFile(sTexturePath) )
|
||||||
{
|
|
||||||
Material.alpha.Load( sTexturePath );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
RString sError = ssprintf( "'%s' references a texture '%s' that does not exist", sPath.c_str(), sTexturePath.c_str() );
|
RString sError = ssprintf( "'%s' references a texture '%s' that does not exist", sPath.c_str(), sTexturePath.c_str() );
|
||||||
RageException::Throw( sError );
|
RageException::Throw( sError );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Material.alpha.Load( sTexturePath );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user