s/throw RageException/RageException::Throw/
This commit is contained in:
@@ -35,7 +35,7 @@ void Course::LoadFromCRSFile( CString sPath, CArray<Song*,Song*> &apSongs )
|
||||
{
|
||||
MsdFile msd;
|
||||
if( !msd.ReadFile(sPath) )
|
||||
throw RageException( "Error opening CRS file '%s'.", sPath.GetString() );
|
||||
RageException::Throw( "Error opening CRS file '%s'.", sPath.GetString() );
|
||||
|
||||
CString sDir, sFName, sExt;
|
||||
splitrelpath( sPath, sDir, sFName, sExt );
|
||||
|
||||
@@ -41,7 +41,7 @@ Font::Font( const CString &sASCIITexturePath )
|
||||
m_pTexture = TEXTUREMAN->LoadTexture( m_sTexturePath, RageTexturePrefs() );
|
||||
ASSERT( m_pTexture != NULL );
|
||||
if( m_pTexture->GetNumFrames() != 16*16 )
|
||||
throw RageException( "The font '%s' has only %d frames. All fonts must have 16*16 frames.", m_sTexturePath.GetString() );
|
||||
RageException::Throw( "The font '%s' has only %d frames. All fonts must have 16*16 frames.", m_sTexturePath.GetString() );
|
||||
|
||||
for( i=0; i<256; i++ )
|
||||
m_iCharToFrameNo[i] = i;
|
||||
@@ -57,7 +57,7 @@ Font::Font( const CString &sASCIITexturePath )
|
||||
// load character widths
|
||||
for( i=0; i<256; i++ )
|
||||
if( !ini.GetValueI( "Char Widths", ssprintf("%d",i), m_iFrameNoToWidth[i] ) )
|
||||
throw RageException( "Error reading width value '%d' from '%s'.", i, sIniPath.GetString() );
|
||||
RageException::Throw( "Error reading width value '%d' from '%s'.", i, sIniPath.GetString() );
|
||||
|
||||
m_bCapitalsOnly = false;
|
||||
ini.GetValueB( "Char Widths", "CapitalsOnly", m_bCapitalsOnly );
|
||||
@@ -125,7 +125,7 @@ Font::Font( const CString &sTexturePath, const CString& sCharacters )
|
||||
//
|
||||
// sanity check
|
||||
if( sCharacters.GetLength() != m_pTexture->GetNumFrames() )
|
||||
throw RageException( "The image '%s' doesn't have the correct number of frames. It has %d frames but should have %d frames.",
|
||||
RageException::Throw( "The image '%s' doesn't have the correct number of frames. It has %d frames but should have %d frames.",
|
||||
m_sTexturePath.GetString(), m_pTexture->GetNumFrames(), sCharacters.GetLength() );
|
||||
|
||||
// set the char to frame number map
|
||||
@@ -159,7 +159,7 @@ int Font::GetLineWidthInSourcePixels( const char *szLine, int iLength )
|
||||
const char c = szLine[i];
|
||||
const int iFrameNo = m_iCharToFrameNo[ (unsigned char)c ];
|
||||
if( iFrameNo == -1 ) // this font doesn't impelemnt this character
|
||||
throw RageException( "The font '%s' does not implement the character '%c'", m_sTexturePath.GetString(), c );
|
||||
RageException::Throw( "The font '%s' does not implement the character '%c'", m_sTexturePath.GetString(), c );
|
||||
|
||||
iLineWidth += m_iFrameNoToWidth[iFrameNo];
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ bool BMSLoader::LoadFromBMSFile( const CString &sPath, Notes &out )
|
||||
|
||||
ifstream file(sPath);
|
||||
if( file.bad() )
|
||||
throw RageException( "Failed to open %s for reading.", sPath.GetString() );
|
||||
RageException::Throw( "Failed to open %s for reading.", sPath.GetString() );
|
||||
|
||||
CString line;
|
||||
while( getline(file, line) ) // foreach line
|
||||
@@ -116,7 +116,7 @@ bool BMSLoader::LoadFromBMSFile( const CString &sPath, Notes &out )
|
||||
out.m_NotesType = NOTES_TYPE_DANCE_DOUBLE;
|
||||
break;
|
||||
default:
|
||||
throw RageException( "Invalid value '%d' for '#player'", atoi(value_data) );
|
||||
RageException::Throw( "Invalid value '%d' for '#player'", atoi(value_data) );
|
||||
}
|
||||
}
|
||||
if( -1 != value_name.Find("#title") )
|
||||
@@ -226,7 +226,7 @@ bool BMSLoader::LoadFromBMSFile( const CString &sPath, Notes &out )
|
||||
iTransformNewToOld[5] = DANCE_NOTE_PAD1_RIGHT;
|
||||
break;
|
||||
default:
|
||||
throw RageException( "Invalid NotesType." );
|
||||
RageException::Throw( "Invalid NotesType." );
|
||||
}
|
||||
|
||||
NoteData* pNoteData2 = new NoteData;
|
||||
@@ -256,7 +256,7 @@ bool BMSLoader::LoadFromDir( CString sDir, Song &out )
|
||||
GetApplicableFiles( sDir, arrayBMSFileNames );
|
||||
|
||||
if( arrayBMSFileNames.empty() )
|
||||
throw RageException( "Couldn't find any BMS files in '%s'", sDir.GetString() );
|
||||
RageException::Throw( "Couldn't find any BMS files in '%s'", sDir.GetString() );
|
||||
|
||||
// load the Notes from the rest of the BMS files
|
||||
unsigned i;
|
||||
@@ -276,7 +276,7 @@ bool BMSLoader::LoadFromDir( CString sDir, Song &out )
|
||||
|
||||
ifstream file(sPath);
|
||||
if( file.bad() )
|
||||
throw RageException( "Failed to open %s for reading.", sPath.GetString() );
|
||||
RageException::Throw( "Failed to open %s for reading.", sPath.GetString() );
|
||||
|
||||
CString line;
|
||||
while( getline(file, line) ) // foreach line
|
||||
@@ -413,7 +413,7 @@ bool BMSLoader::LoadFromDir( CString sDir, Song &out )
|
||||
// open the song file again and and look for this tag's value
|
||||
ifstream file(sPath);
|
||||
if( file.bad() )
|
||||
throw RageException( "Failed to open %s for reading.", sPath.GetString() );
|
||||
RageException::Throw( "Failed to open %s for reading.", sPath.GetString() );
|
||||
|
||||
CString line;
|
||||
while( getline(file, line) ) // foreach line
|
||||
@@ -474,7 +474,7 @@ bool BMSLoader::LoadFromDir( CString sDir, Song &out )
|
||||
// open the song file again and and look for this tag's value
|
||||
ifstream file(sPath);
|
||||
if( file.bad() )
|
||||
throw RageException( "Failed to open %s for reading.", sPath.GetString() );
|
||||
RageException::Throw( "Failed to open %s for reading.", sPath.GetString() );
|
||||
|
||||
CString line;
|
||||
while( getline(file, line) ) // foreach line
|
||||
|
||||
@@ -250,7 +250,7 @@ bool DWILoader::LoadFromDWIFile( CString sPath, Song &out )
|
||||
MsdFile msd;
|
||||
bool bResult = msd.ReadFile( sPath );
|
||||
if( !bResult )
|
||||
throw RageException( "Error opening file '%s' for reading.", sPath.GetString() );
|
||||
RageException::Throw( "Error opening file '%s' for reading.", sPath.GetString() );
|
||||
|
||||
for( unsigned i=0; i<msd.m_iNumValues; i++ )
|
||||
{
|
||||
@@ -378,7 +378,7 @@ bool DWILoader::LoadFromDir( CString sPath, Song &out )
|
||||
GetApplicableFiles( sPath, aFileNames );
|
||||
|
||||
if( aFileNames.size() > 1 )
|
||||
throw RageException( "There is more than one DWI file in '%s'. There should be only one!", sPath.GetString() );
|
||||
RageException::Throw( "There is more than one DWI file in '%s'. There should be only one!", sPath.GetString() );
|
||||
|
||||
/* We should have exactly one; if we had none, we shouldn't have been
|
||||
* called to begin with. */
|
||||
|
||||
@@ -16,7 +16,7 @@ bool KSFLoader::LoadFromKSFFile( const CString &sPath, Notes &out )
|
||||
MsdFile msd;
|
||||
bool bResult = msd.ReadFile( sPath );
|
||||
if( !bResult )
|
||||
throw RageException( "Error opening file '%s'.", sPath.GetString() );
|
||||
RageException::Throw( "Error opening file '%s'.", sPath.GetString() );
|
||||
|
||||
int iTickCount = -1; // this is the value we read for TICKCOUNT
|
||||
CString iStep; // this is the value we read for STEP
|
||||
@@ -159,7 +159,7 @@ bool KSFLoader::LoadFromDir( CString sDir, Song &out )
|
||||
GetDirListing( sDir + CString("*.ksf"), arrayKSFFileNames );
|
||||
|
||||
if( arrayKSFFileNames.empty() )
|
||||
throw RageException( "Couldn't find any KSF files in '%s'", sDir.GetString() );
|
||||
RageException::Throw( "Couldn't find any KSF files in '%s'", sDir.GetString() );
|
||||
|
||||
// load the Notes from the rest of the KSF files
|
||||
unsigned i;
|
||||
@@ -175,7 +175,7 @@ bool KSFLoader::LoadFromDir( CString sDir, Song &out )
|
||||
MsdFile msd;
|
||||
bool bResult = msd.ReadFile( sPath );
|
||||
if( !bResult )
|
||||
throw RageException( "Error opening file '%s'.", sPath.GetString() );
|
||||
RageException::Throw( "Error opening file '%s'.", sPath.GetString() );
|
||||
|
||||
for( i=0; i < msd.m_iNumValues; i++ )
|
||||
{
|
||||
|
||||
@@ -57,7 +57,7 @@ bool SMLoader::LoadFromSMFile( CString sPath, Song &out )
|
||||
MsdFile msd;
|
||||
bool bResult = msd.ReadFile( sPath );
|
||||
if( !bResult )
|
||||
throw RageException( "Error opening file '%s'.", sPath.GetString() );
|
||||
RageException::Throw( "Error opening file '%s'.", sPath.GetString() );
|
||||
|
||||
for( unsigned i=0; i<msd.m_iNumValues; i++ )
|
||||
{
|
||||
@@ -221,7 +221,7 @@ bool SMLoader::LoadFromDir( CString sPath, Song &out )
|
||||
GetApplicableFiles( sPath, aFileNames );
|
||||
|
||||
if( aFileNames.size() > 1 )
|
||||
throw RageException( "There is more than one SM file in '%s'. There should be only one!", sPath.GetString() );
|
||||
RageException::Throw( "There is more than one SM file in '%s'. There should be only one!", sPath.GetString() );
|
||||
|
||||
/* We should have exactly one; if we had none, we shouldn't have been
|
||||
* called to begin with. */
|
||||
|
||||
@@ -222,7 +222,7 @@ bool NotesWriterDWI::Write( CString sPath, const Song &out )
|
||||
{
|
||||
FILE* fp = fopen( sPath, "w" );
|
||||
if( fp == NULL )
|
||||
throw RageException( "Error opening song file '%s' for writing.", sPath.GetString() );
|
||||
RageException::Throw( "Error opening song file '%s' for writing.", sPath.GetString() );
|
||||
|
||||
if(out.GetFullTitle().GetLength() != 0)
|
||||
fprintf( fp, "#TITLE:%s;\n", out.GetFullTitle().GetString() );
|
||||
|
||||
@@ -95,7 +95,7 @@ bool NotesWriterSM::Write(CString sPath, const Song &out, bool bSavingCache)
|
||||
|
||||
FILE* fp = fopen( sPath, "w" );
|
||||
if( fp == NULL )
|
||||
throw RageException( "Error opening song file '%s' for writing.", sPath.GetString() );
|
||||
RageException::Throw( "Error opening song file '%s' for writing.", sPath.GetString() );
|
||||
|
||||
WriteGlobalTags(fp, out);
|
||||
if(bSavingCache) {
|
||||
|
||||
Reference in New Issue
Block a user