push file opening upwards, instead of duplicating it in each loader

This commit is contained in:
Glenn Maynard
2007-02-21 10:10:18 +00:00
parent f081f56388
commit acc0b14ee1
8 changed files with 61 additions and 85 deletions
+8 -1
View File
@@ -37,7 +37,14 @@ RageSoundReader_FileReader *RageSoundReader_FileReader::TryOpenFile( RString fil
if( !Sample )
return NULL;
OpenResult ret = Sample->Open(filename);
RageFile file;
if( !file.Open(filename) )
{
error = ssprintf( "Couldn't open file: %s", file.GetError().c_str() );
bKeepTrying = false;
}
OpenResult ret = Sample->Open( file.Copy() );
if( ret == OPEN_OK )
return Sample;