From 33c1fb46f745738c7f743f4cb5893bc875cda357 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 21 Dec 2002 18:36:10 +0000 Subject: [PATCH] s/throw RageException/RageException::Throw/ --- stepmania/src/Course.cpp | 2 +- stepmania/src/Font.cpp | 8 ++++---- stepmania/src/NotesLoaderBMS.cpp | 14 +++++++------- stepmania/src/NotesLoaderDWI.cpp | 4 ++-- stepmania/src/NotesLoaderKSF.cpp | 6 +++--- stepmania/src/NotesLoaderSM.cpp | 4 ++-- stepmania/src/NotesWriterDWI.cpp | 2 +- stepmania/src/NotesWriterSM.cpp | 2 +- 8 files changed, 21 insertions(+), 21 deletions(-) diff --git a/stepmania/src/Course.cpp b/stepmania/src/Course.cpp index 5c89115f6b..d304b3c3c3 100644 --- a/stepmania/src/Course.cpp +++ b/stepmania/src/Course.cpp @@ -35,7 +35,7 @@ void Course::LoadFromCRSFile( CString sPath, CArray &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 ); diff --git a/stepmania/src/Font.cpp b/stepmania/src/Font.cpp index 7ff6cbc1f1..cbf1361537 100644 --- a/stepmania/src/Font.cpp +++ b/stepmania/src/Font.cpp @@ -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]; } diff --git a/stepmania/src/NotesLoaderBMS.cpp b/stepmania/src/NotesLoaderBMS.cpp index b702b7e27e..8a5bfe0afb 100644 --- a/stepmania/src/NotesLoaderBMS.cpp +++ b/stepmania/src/NotesLoaderBMS.cpp @@ -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 diff --git a/stepmania/src/NotesLoaderDWI.cpp b/stepmania/src/NotesLoaderDWI.cpp index 90ece4d467..7895842910 100644 --- a/stepmania/src/NotesLoaderDWI.cpp +++ b/stepmania/src/NotesLoaderDWI.cpp @@ -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 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. */ diff --git a/stepmania/src/NotesLoaderKSF.cpp b/stepmania/src/NotesLoaderKSF.cpp index ad3ebed7df..ccd4e9f866 100644 --- a/stepmania/src/NotesLoaderKSF.cpp +++ b/stepmania/src/NotesLoaderKSF.cpp @@ -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++ ) { diff --git a/stepmania/src/NotesLoaderSM.cpp b/stepmania/src/NotesLoaderSM.cpp index 75afd55d04..5acb2ee6e0 100644 --- a/stepmania/src/NotesLoaderSM.cpp +++ b/stepmania/src/NotesLoaderSM.cpp @@ -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 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. */ diff --git a/stepmania/src/NotesWriterDWI.cpp b/stepmania/src/NotesWriterDWI.cpp index b9dde204c9..b4a2a9f2fb 100644 --- a/stepmania/src/NotesWriterDWI.cpp +++ b/stepmania/src/NotesWriterDWI.cpp @@ -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() ); diff --git a/stepmania/src/NotesWriterSM.cpp b/stepmania/src/NotesWriterSM.cpp index 005ed5c72b..3011962868 100644 --- a/stepmania/src/NotesWriterSM.cpp +++ b/stepmania/src/NotesWriterSM.cpp @@ -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) {