From f42407244128307af8dd645975cc4e70954f486e Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sun, 30 Jul 2006 18:43:09 +0000 Subject: [PATCH] simplify --- stepmania/src/Model.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/stepmania/src/Model.cpp b/stepmania/src/Model.cpp index 5276f7e588..8121a35788 100644 --- a/stepmania/src/Model.cpp +++ b/stepmania/src/Model.cpp @@ -253,15 +253,13 @@ void Model::LoadMaterialsFromMilkshapeAscii( const RString &_sPath ) RString sTexturePath = sDir + sDiffuseTexture; FixSlashesInPlace( sTexturePath ); CollapsePath( sTexturePath ); - if( IsAFile(sTexturePath) ) - { - Material.diffuse.Load( sTexturePath ); - } - else + if( !IsAFile(sTexturePath) ) { RString sError = ssprintf( "'%s' references a texture '%s' that does not exist", sPath.c_str(), sTexturePath.c_str() ); RageException::Throw( sError ); } + + Material.diffuse.Load( sTexturePath ); } // alpha texture @@ -280,15 +278,13 @@ void Model::LoadMaterialsFromMilkshapeAscii( const RString &_sPath ) RString sTexturePath = sDir + sAlphaTexture; FixSlashesInPlace( sTexturePath ); CollapsePath( sTexturePath ); - if( IsAFile(sTexturePath) ) - { - Material.alpha.Load( sTexturePath ); - } - else + if( !IsAFile(sTexturePath) ) { RString sError = ssprintf( "'%s' references a texture '%s' that does not exist", sPath.c_str(), sTexturePath.c_str() ); RageException::Throw( sError ); } + + Material.alpha.Load( sTexturePath ); } } }