diff --git a/stepmania/src/Actor.cpp b/stepmania/src/Actor.cpp index 00cd3b22f1..77c4c52640 100644 --- a/stepmania/src/Actor.cpp +++ b/stepmania/src/Actor.cpp @@ -202,7 +202,7 @@ void Actor::LoadFromNode( const RString& sDir, const XNode* pNode ) /* If parameters are specified here, save their values to the actor. */ RString sName; if( !pChild->GetAttrValue( "Name", sName ) ) - RageException::Throw( ssprintf("Input node in '%s' is missing the attribute 'Name'", sDir.c_str()) ); + RageException::Throw( "Input node in \"%s\" is missing the attribute \"Name\".", sDir.c_str() ); bool bOptional = false; pChild->GetAttrValue( "Optional", bOptional ); @@ -213,7 +213,7 @@ void Actor::LoadFromNode( const RString& sDir, const XNode* pNode ) ActorUtil::GetParam( L, sName ); if( lua_isnil(L, -1) && !bOptional ) - RageException::Throw( "Actor in \"%s\" requires parameter \"%s\" that is not set", sDir.c_str(), sName.c_str() ); + RageException::Throw( "Actor in \"%s\" requires parameter \"%s\" that is not set.", sDir.c_str(), sName.c_str() ); lua_settable( L, -3 ); lua_pop( L, 1 ); diff --git a/stepmania/src/ActorUtil.cpp b/stepmania/src/ActorUtil.cpp index 6ddfc4d4b2..89307fe2e3 100644 --- a/stepmania/src/ActorUtil.cpp +++ b/stepmania/src/ActorUtil.cpp @@ -65,7 +65,7 @@ retry: switch( Dialog::AbortRetryIgnore( sError, "BROKEN_FILE_REFERENCE" ) ) { case Dialog::abort: - RageException::Throw( sError ); + RageException::Throw( "%s", sError.c_str() ); break; case Dialog::retry: // XXX: Do we need to flush everything? @@ -90,7 +90,7 @@ retry: switch( Dialog::AbortRetryIgnore( sError, "BROKEN_FILE_REFERENCE" ) ) { case Dialog::abort: - RageException::Throw( sError ); + RageException::Throw( "%s", sError.c_str() ); break; case Dialog::retry: // XXX: Do we need to flush everything? @@ -389,8 +389,8 @@ Actor* ActorUtil::MakeActor( const RString &sPath_, const XNode *pParent, Actor return ActorUtil::Create( "Model", sDir, &xml, pParentActor ); } default: - RageException::Throw("File \"%s\" has unknown type, \"%s\"", - sPath.c_str(), FileTypeToString(ft).c_str() ); + RageException::Throw("File \"%s\" has unknown type, \"%s\".", + sPath.c_str(), FileTypeToString(ft).c_str() ); } } diff --git a/stepmania/src/BitmapText.cpp b/stepmania/src/BitmapText.cpp index 1cf1b7df4d..251aea5b73 100644 --- a/stepmania/src/BitmapText.cpp +++ b/stepmania/src/BitmapText.cpp @@ -108,12 +108,12 @@ void BitmapText::LoadFromNode( const RString& sDir, const XNode* pNode ) RString sFont; pNode->GetAttrValue( "Font", sFont ); if( sFont.empty() ) - pNode->GetAttrValue("File", sFont ); // accept "File" for backward compatibility + pNode->GetAttrValue( "File", sFont ); // accept "File" for backward compatibility LuaHelpers::RunAtExpressionS( sFont ); if( sFont == "" ) - RageException::Throw( "An object '%s' in '%s' is missing the Font attribute", - pNode->m_sName.c_str(), sDir.c_str() ); + RageException::Throw( "An object \"%s\" in \"%s\" is missing the Font attribute.", + pNode->m_sName.c_str(), sDir.c_str() ); LoadFromFont( THEME->GetPathF( "", sFont ) ); SetText( sText, sAltText ); diff --git a/stepmania/src/ComboGraph.cpp b/stepmania/src/ComboGraph.cpp index 5fa7410c0c..6140a08812 100644 --- a/stepmania/src/ComboGraph.cpp +++ b/stepmania/src/ComboGraph.cpp @@ -25,17 +25,17 @@ void ComboGraph::LoadFromNode( const RString& sDir, const XNode* pNode ) m_pMaxComboText = (BitmapText *) this->GetChild( "MaxComboText" ); if( m_pMaxComboText == NULL ) - RageException::Throw( ssprintf("ComboGraph in \"%s\" must have a child named \"MaxComboText\"", sDir.c_str()) ); + RageException::Throw( "ComboGraph in \"%s\" must have a child named \"MaxComboText\".", sDir.c_str() ); if( !m_pMaxComboText->IsType("BitmapText") ) - RageException::Throw( ssprintf("ComboGraph in \"%s\" has a child named \"MaxComboText\" that is not a BitmapText", sDir.c_str()) ); + RageException::Throw( "ComboGraph in \"%s\" has a child named \"MaxComboText\" that is not a BitmapText.", sDir.c_str() ); m_pNormalCombo = this->GetChild( "NormalCombo" ); if( m_pNormalCombo == NULL ) - RageException::Throw( ssprintf("ComboGraph in \"%s\" must have a child named \"NormalCombo\"", sDir.c_str()) ); + RageException::Throw( "ComboGraph in \"%s\" must have a child named \"NormalCombo\".", sDir.c_str() ); m_pMaxCombo = this->GetChild( "MaxCombo" ); if( m_pMaxCombo == NULL ) - RageException::Throw( ssprintf("ComboGraph in \"%s\" must have a child named \"MaxCombo\"", sDir.c_str()) ); + RageException::Throw( "ComboGraph in \"%s\" must have a child named \"MaxCombo\".", sDir.c_str() ); } void ComboGraph::Load( const StageStats &s, const PlayerStageStats &pss ) diff --git a/stepmania/src/CommonMetrics.cpp b/stepmania/src/CommonMetrics.cpp index e990c4876a..e387475cd2 100644 --- a/stepmania/src/CommonMetrics.cpp +++ b/stepmania/src/CommonMetrics.cpp @@ -47,7 +47,7 @@ void ThemeMetricDifficultiesToShow::Read() { Difficulty d = StringToDifficulty( *i ); if( d == DIFFICULTY_INVALID ) - RageException::Throw( "Unknown difficulty \"%s\" in CourseDifficultiesToShow", i->c_str() ); + RageException::Throw( "Unknown difficulty \"%s\" in CourseDifficultiesToShow.", i->c_str() ); m_v.push_back( d ); } } @@ -77,7 +77,7 @@ void ThemeMetricCourseDifficultiesToShow::Read() { CourseDifficulty d = StringToCourseDifficulty( *i ); if( d == DIFFICULTY_INVALID ) - RageException::Throw( "Unknown CourseDifficulty \"%s\" in CourseDifficultiesToShow", i->c_str() ); + RageException::Throw( "Unknown CourseDifficulty \"%s\" in CourseDifficultiesToShow.", i->c_str() ); m_v.push_back( d ); } } diff --git a/stepmania/src/DifficultyIcon.cpp b/stepmania/src/DifficultyIcon.cpp index a1389d834a..8d37031d91 100644 --- a/stepmania/src/DifficultyIcon.cpp +++ b/stepmania/src/DifficultyIcon.cpp @@ -45,7 +45,7 @@ void DifficultyIcon::LoadFromNode( const RString& sDir, const XNode* pNode ) { RString sFile; if( !pNode->GetAttrValue( "File", sFile ) ) - RageException::Throw( "MeterDisplay in " + sDir + " missing File attribute" ); + RageException::Throw( "MeterDisplay in \"%s\" missing \"File\" attribute.", sDir.c_str() ); LuaHelpers::RunAtExpressionS( sFile ); if( !sFile.empty() && sFile[0] != '/' ) diff --git a/stepmania/src/DifficultyList.cpp b/stepmania/src/DifficultyList.cpp index 8293ff8840..3525aab53c 100644 --- a/stepmania/src/DifficultyList.cpp +++ b/stepmania/src/DifficultyList.cpp @@ -44,7 +44,7 @@ void DifficultyList::LoadFromNode( const RString& sDir, const XNode* pNode ) { const XNode *pChild = pNode->GetChild( ssprintf("CursorP%i",pn+1) ); if( pChild == NULL ) - RageException::Throw( ssprintf("ComboGraph in \"%s\" is missing the node \"%s\"", sDir.c_str(), ssprintf("CursorP%i",pn+1).c_str()) ); + RageException::Throw( "ComboGraph in \"%s\" is missing the node \"CursorP%d\".", sDir.c_str(), pn+1 ); m_Cursors[pn].LoadFromNode( sDir, pChild ); /* Hack: we need to tween cursors both up to down (cursor motion) and visible to @@ -55,7 +55,7 @@ void DifficultyList::LoadFromNode( const RString& sDir, const XNode* pNode ) * colors; I think we do need a diffuse color stack ... */ pChild = pNode->GetChild( ssprintf("CursorP%iFrame",pn+1) ); if( pChild == NULL ) - RageException::Throw( ssprintf("ComboGraph in \"%s\" is missing the node \"%s\"", sDir.c_str(), ssprintf("CursorP%iFrame",pn+1).c_str()) ); + RageException::Throw( "ComboGraph in \"%s\" is missing the node \"CursorP%dFrame\".", sDir.c_str(), pn+1 ); m_CursorFrames[pn].LoadFromNode( sDir, pChild ); m_CursorFrames[pn].AddChild( m_Cursors[pn] ); this->AddChild( &m_CursorFrames[pn] ); diff --git a/stepmania/src/DynamicActorScroller.cpp b/stepmania/src/DynamicActorScroller.cpp index ea748bb996..4fd7ed2fa0 100644 --- a/stepmania/src/DynamicActorScroller.cpp +++ b/stepmania/src/DynamicActorScroller.cpp @@ -19,7 +19,7 @@ void DynamicActorScroller::LoadFromNode( const RString &sDir, const XNode *pNode * Make one extra copy if masking is enabled. */ if( m_SubActors.size() != 1 ) - RageException::Throw( "DynamicActorScroller in \"%s\" loaded %i nodes; require exactly one", sDir.c_str(), m_SubActors.size() ); + RageException::Throw( "DynamicActorScroller in \"%s\" loaded %i nodes; require exactly one.", sDir.c_str(), (int)m_SubActors.size() ); int iNumCopies = (int) m_fNumItemsToDraw; if( !m_quadMask.GetHidden() ) diff --git a/stepmania/src/ExportStrings.cpp b/stepmania/src/ExportStrings.cpp index 114b3da849..6ab34617f0 100644 --- a/stepmania/src/ExportStrings.cpp +++ b/stepmania/src/ExportStrings.cpp @@ -14,7 +14,7 @@ void ExportStrings::Nsis() { RageFile out; if( !out.Open( "nsis_strings_temp.inc", RageFile::WRITE ) ) - RageException::Throw("Error opening file for write."); + RageException::Throw( "Error opening file for write." ); vector vs; GetDirListing( INSTALLER_LANGUAGES_DIR + "*.ini", vs, false, false ); @@ -29,7 +29,7 @@ void ExportStrings::Nsis() IniFile ini; if( !ini.ReadFile( INSTALLER_LANGUAGES_DIR + *s ) ) - RageException::Throw("Error opening file for read."); + RageException::Throw( "Error opening file for read." ); FOREACH_CONST_Child( &ini, child ) { FOREACH_CONST_Attr( child, attr ) diff --git a/stepmania/src/Font.cpp b/stepmania/src/Font.cpp index fdbc6b4ecf..55e92220c3 100644 --- a/stepmania/src/Font.cpp +++ b/stepmania/src/Font.cpp @@ -286,7 +286,7 @@ const glyph &Font::GetGlyph( wchar_t c ) const it = m_iCharToGlyph.find(FONT_DEFAULT_GLYPH); if(it == m_iCharToGlyph.end()) - RageException::Throw( "The default glyph is missing from the font '%s'", path.c_str() ); + RageException::Throw( "The default glyph is missing from the font \"%s\".", path.c_str() ); return *it->second; } @@ -295,7 +295,7 @@ bool Font::FontCompleteForString( const wstring &str ) const { map::const_iterator m_pDefault = m_iCharToGlyph.find( FONT_DEFAULT_GLYPH ); if( m_pDefault == m_iCharToGlyph.end() ) - RageException::Throw( "The default glyph is missing from the font '%s'", path.c_str() ); + RageException::Throw( "The default glyph is missing from the font \"%s\".", path.c_str() ); for( unsigned i = 0; i < str.size(); ++i ) { @@ -491,7 +491,7 @@ void Font::LoadFontPageSettings( FontPageSettings &cfg, IniFile &ini, const RStr ASSERT( asMatches.size() == 4 ); /* 4 parens */ if( !bMatch || asMatches[0].empty() ) - RageException::Throw("Font definition '%s' has an invalid range '%s': parse error", + RageException::Throw( "Font definition \"%s\" has an invalid range \"%s\": parse error.", ini.GetPath().c_str(), sName.c_str() ); /* We must have either 1 match (just the codeset) or 4 (the whole thing). */ @@ -504,15 +504,15 @@ void Font::LoadFontPageSettings( FontPageSettings &cfg, IniFile &ini, const RStr int iLast; sscanf( asMatches[3].c_str(), "%x", &iLast ); if( iLast < iFirst ) - RageException::Throw("Font definition '%s' has an invalid range '%s': %i < %i.", - ini.GetPath().c_str(), sName.c_str(), iLast < iFirst ); + RageException::Throw( "Font definition \"%s\" has an invalid range \"%s\": %i < %i.", + ini.GetPath().c_str(), sName.c_str(), iLast, iFirst ); iCount = iLast - iFirst + 1; } RString sRet = cfg.MapRange( asMatches[0], iFirst, atoi(sValue), iCount ); if( !sRet.empty() ) - RageException::Throw( "Font definition '%s' has an invalid range '%s': %s.", + RageException::Throw( "Font definition \"%s\" has an invalid range \"%s\": %s.", ini.GetPath().c_str(), sName.c_str(), sRet.c_str() ); continue; @@ -532,15 +532,15 @@ void Font::LoadFontPageSettings( FontPageSettings &cfg, IniFile &ini, const RStr const int iFirstFrame = iRow * iNumFramesWide; if( iRow > iNumFramesHigh ) - RageException::Throw( "The font definition \"%s\" tries to assign line %i, but the font is only %i characters high", + RageException::Throw( "The font definition \"%s\" tries to assign line %i, but the font is only %i characters high.", ini.GetPath().c_str(), iFirstFrame, iNumFramesHigh ); /* Decode the string. */ const wstring wdata( RStringToWstring(sValue) ); if( int(wdata.size()) > iNumFramesWide ) - RageException::Throw( "The font definition \"%s\" assigns %i characters to row %i (\"%ls\"), but the font only has %i characters wide", - ini.GetPath().c_str(), wdata.size(), iRow, wdata.c_str(), iNumFramesWide ); + RageException::Throw( "The font definition \"%s\" assigns %i characters to row %i (\"%ls\"), but the font is only %i characters wide.", + ini.GetPath().c_str(), (int)wdata.size(), iRow, wdata.c_str(), iNumFramesWide ); for( unsigned i = 0; i < wdata.size(); ++i ) cfg.CharToGlyphNo[wdata[i]] = iFirstFrame+i; @@ -657,7 +657,7 @@ void Font::Load( const RString &sIniPath, RString sChars ) { RString str = join("\n", LoadStack); str += "\n" + sIniPath; - RageException::Throw("Font import recursion detected\n%s", str.c_str()); + RageException::Throw( "Font import recursion detected\n%s", str.c_str() ); } } LoadStack.push_back( sIniPath ); @@ -737,9 +737,8 @@ void Font::Load( const RString &sIniPath, RString sChars ) { if( it->second < pPage->m_pTexture->GetNumFrames() ) continue; /* OK */ - RString sError = ssprintf( "The font '%s' maps %s to frame %i, but the font only has %i frames.", - sTexturePath.c_str(), WcharDisplayText(wchar_t(it->first)).c_str(), it->second, pPage->m_pTexture->GetNumFrames() ); - RageException::Throw( sError ); + RageException::Throw( "The font \"%s\" maps \"%s\" to frame %i, but the font only has %i frames.", + sTexturePath.c_str(), WcharDisplayText(wchar_t(it->first)).c_str(), it->second, pPage->m_pTexture->GetNumFrames() ); } // LOG->Trace( "Adding page %s (%s) to %s; %i glyphs", diff --git a/stepmania/src/GameCommand.cpp b/stepmania/src/GameCommand.cpp index 8d367c70b8..a18b36d2f5 100644 --- a/stepmania/src/GameCommand.cpp +++ b/stepmania/src/GameCommand.cpp @@ -269,7 +269,7 @@ void GameCommand::LoadOne( const Command& cmd ) Song *pSong = (m_pSong != NULL)? m_pSong:GAMESTATE->m_pCurSong; const Style *pStyle = m_pStyle ? m_pStyle : GAMESTATE->m_pCurStyle; if( pSong == NULL || pStyle == NULL ) - RageException::Throw( "Must set Song and Style to set Steps" ); + RageException::Throw( "Must set Song and Style to set Steps." ); Difficulty dc = StringToDifficulty( sSteps ); if( dc != DIFFICULTY_EDIT ) @@ -304,7 +304,7 @@ void GameCommand::LoadOne( const Command& cmd ) Course *pCourse = (m_pCourse != NULL)? m_pCourse:GAMESTATE->m_pCurCourse; const Style *pStyle = m_pStyle ? m_pStyle : GAMESTATE->m_pCurStyle; if( pCourse == NULL || pStyle == NULL ) - RageException::Throw( "Must set Course and Style to set Steps" ); + RageException::Throw( "Must set Course and Style to set Steps." ); const CourseDifficulty cd = StringToCourseDifficulty( sTrail ); ASSERT_M( cd != DIFFICULTY_INVALID, ssprintf("Invalid difficulty '%s'", sTrail.c_str()) ); diff --git a/stepmania/src/GameState.cpp b/stepmania/src/GameState.cpp index 41b73711ab..3a063d50cf 100644 --- a/stepmania/src/GameState.cpp +++ b/stepmania/src/GameState.cpp @@ -153,7 +153,7 @@ void GameState::ApplyCmdline() { int pn = atoi( sPlayer )-1; if( !IsAnInt( sPlayer ) || pn < 0 || pn >= NUM_PLAYERS ) - RageException::Throw( "Invalid argument \"--player=%s\"", sPlayer.c_str() ); + RageException::Throw( "Invalid argument \"--player=%s\".", sPlayer.c_str() ); JoinPlayer( (PlayerNumber) pn ); } diff --git a/stepmania/src/GraphDisplay.cpp b/stepmania/src/GraphDisplay.cpp index cc78f27635..32fc645664 100644 --- a/stepmania/src/GraphDisplay.cpp +++ b/stepmania/src/GraphDisplay.cpp @@ -157,13 +157,13 @@ void GraphDisplay::LoadFromNode( const RString& sDir, const XNode* pNode ) const XNode *pChild = pNode->GetChild( "Body" ); if( pChild == NULL ) - RageException::Throw( ssprintf("ComboGraph in \"%s\" is missing the node \"Body\"", sDir.c_str()) ); + RageException::Throw( "ComboGraph in \"%s\" is missing the node \"Body\".", sDir.c_str() ); m_pGraphBody->LoadFromNode( sDir, pChild ); this->AddChild( m_pGraphBody ); pChild = pNode->GetChild( "Texture" ); if( pChild == NULL ) - RageException::Throw( ssprintf("ComboGraph in \"%s\" is missing the node \"Texture\"", sDir.c_str()) ); + RageException::Throw( "ComboGraph in \"%s\" is missing the node \"Texture\".", sDir.c_str() ); m_sprTexture.LoadFromNode( sDir, pChild ); m_size.x = m_sprTexture->GetUnzoomedWidth(); m_size.y = m_sprTexture->GetUnzoomedHeight(); @@ -171,18 +171,18 @@ void GraphDisplay::LoadFromNode( const RString& sDir, const XNode* pNode ) pChild = pNode->GetChild( "Line" ); if( pChild == NULL ) - RageException::Throw( ssprintf("ComboGraph in \"%s\" is missing the node \"Line\"", sDir.c_str()) ); + RageException::Throw( "ComboGraph in \"%s\" is missing the node \"Line\".", sDir.c_str() ); m_pGraphLine->LoadFromNode( sDir, pChild ); this->AddChild( m_pGraphLine ); pChild = pNode->GetChild( "SongBoundary" ); if( pChild == NULL ) - RageException::Throw( ssprintf("ComboGraph in \"%s\" is missing the node \"SongBoundary\"", sDir.c_str()) ); + RageException::Throw( "ComboGraph in \"%s\" is missing the node \"SongBoundary\".", sDir.c_str() ); m_sprSongBoundary.LoadFromNode( sDir, pChild ); pChild = pNode->GetChild( "Barely" ); if( pChild == NULL ) - RageException::Throw( ssprintf("ComboGraph in \"%s\" is missing the node \"Barely\"", sDir.c_str()) ); + RageException::Throw( "ComboGraph in \"%s\" is missing the node \"Barely\".", sDir.c_str() ); m_sprJustBarely.LoadFromNode( sDir, pChild ); } diff --git a/stepmania/src/HoldJudgment.cpp b/stepmania/src/HoldJudgment.cpp index 19c06b2ccf..2fd6e39eff 100644 --- a/stepmania/src/HoldJudgment.cpp +++ b/stepmania/src/HoldJudgment.cpp @@ -29,7 +29,7 @@ void HoldJudgment::LoadFromNode( const RString& sDir, const XNode* pNode ) { RString sFile; if( !pNode->GetAttrValue("File", sFile) ) - RageException::Throw( ssprintf("HoldJudgment node in '%s' is missing the attribute \"File\"", sDir.c_str()) ); + RageException::Throw( "HoldJudgment node in \"%s\" is missing the attribute \"File\"", sDir.c_str() ); LuaHelpers::RunAtExpressionS( sFile ); if( sFile.Left(1) != "/" ) diff --git a/stepmania/src/LuaManager.cpp b/stepmania/src/LuaManager.cpp index 87d4842ce4..2ac83c8da3 100644 --- a/stepmania/src/LuaManager.cpp +++ b/stepmania/src/LuaManager.cpp @@ -578,7 +578,7 @@ bool LuaHelpers::RunExpressionB( const RString &str ) /* Don't accept a function as a return value. */ if( lua_isfunction( L, -1 ) ) - RageException::Throw( "result is a function; did you forget \"()\"?" ); + RageException::Throw( "Result is a function; did you forget \"()\"?" ); bool result = !!lua_toboolean( L, -1 ); lua_pop( L, 1 ); @@ -598,7 +598,7 @@ float LuaHelpers::RunExpressionF( const RString &str ) /* Don't accept a function as a return value. */ if( lua_isfunction( L, -1 ) ) - RageException::Throw( "result is a function; did you forget \"()\"?" ); + RageException::Throw( "Result is a function; did you forget \"()\"?" ); float result = (float) lua_tonumber( L, -1 ); lua_pop( L, 1 ); @@ -623,7 +623,7 @@ bool LuaHelpers::RunExpressionS( const RString &str, RString &sOut ) /* Don't accept a function as a return value. */ if( lua_isfunction( L, -1 ) ) - RageException::Throw( "result is a function; did you forget \"()\"?" ); + RageException::Throw( "Result is a function; did you forget \"()\"?" ); sOut = lua_tostring( L, -1 ); lua_pop( L, 1 ); diff --git a/stepmania/src/MeterDisplay.cpp b/stepmania/src/MeterDisplay.cpp index 447fe2d635..9fec83c86b 100644 --- a/stepmania/src/MeterDisplay.cpp +++ b/stepmania/src/MeterDisplay.cpp @@ -35,13 +35,13 @@ void MeterDisplay::LoadFromNode( const RString& sDir, const XNode* pNode ) RString sExpr; if( !pNode->GetAttrValue( "StreamWidth", sExpr ) ) - RageException::Throw( "MeterDisplay in " + sDir + " missing StreamWidth attribute" ); + RageException::Throw( "MeterDisplay in \"%s\" is missing the \"StreamWidth\" attribute.", sDir.c_str() ); m_fStreamWidth = LuaHelpers::RunExpressionF( sExpr ); { RString sStreamPath; if( !pNode->GetAttrValue( "StreamPath", sStreamPath ) ) - RageException::Throw( "MeterDisplay in " + sDir + " missing StreamPath attribute" ); + RageException::Throw( "MeterDisplay in \"%s\" is missing the \"StreamPath\" attribute.", sDir.c_str() ); LuaHelpers::RunAtExpressionS( sStreamPath ); if( !sStreamPath.empty() && sStreamPath[0] != '/' ) diff --git a/stepmania/src/Model.cpp b/stepmania/src/Model.cpp index 9e7876fe5f..9949b6c297 100644 --- a/stepmania/src/Model.cpp +++ b/stepmania/src/Model.cpp @@ -63,7 +63,7 @@ void Model::Load( const RString &sFile ) LoadMilkshapeAscii( sFile ); } -#define THROW RageException::Throw( "Parse error in \"%s\" at line %d: '%s'", sPath.c_str(), iLineNum, sLine.c_str() ) +#define THROW RageException::Throw( "Parse error in \"%s\" at line %d: \"%s\".", sPath.c_str(), iLineNum, sLine.c_str() ) void Model::LoadMilkshapeAscii( const RString &sPath ) { @@ -87,8 +87,8 @@ void Model::LoadPieces( const RString &sMeshesPath, const RString &sMaterialsPat const msMesh *pMesh = &m_pGeometry->m_Meshes[i]; if( pMesh->nMaterialIndex >= (int) m_Materials.size() ) - RageException::Throw( "Model \"%s\" mesh \"%s\" references material index %i, but there are only %i materials", - sMeshesPath.c_str(), pMesh->sName.c_str(), pMesh->nMaterialIndex, m_Materials.size() ); + RageException::Throw( "Model \"%s\" mesh \"%s\" references material index %i, but there are only %i materials.", + sMeshesPath.c_str(), pMesh->sName.c_str(), pMesh->nMaterialIndex, (int)m_Materials.size() ); } if( LoadMilkshapeAsciiBones( DEFAULT_ANIMATION_NAME, sBonesPath ) ) @@ -254,10 +254,7 @@ void Model::LoadMaterialsFromMilkshapeAscii( const RString &_sPath ) FixSlashesInPlace( sTexturePath ); CollapsePath( sTexturePath ); if( !IsAFile(sTexturePath) ) - { - RString sError = ssprintf( "'%s' references a texture '%s' that does not exist", sPath.c_str(), sTexturePath.c_str() ); - RageException::Throw( sError ); - } + RageException::Throw( "\"%s\" references a texture \"%s\" that does not exist.", sPath.c_str(), sTexturePath.c_str() ); Material.diffuse.Load( sTexturePath ); } @@ -279,10 +276,7 @@ void Model::LoadMaterialsFromMilkshapeAscii( const RString &_sPath ) FixSlashesInPlace( sTexturePath ); CollapsePath( sTexturePath ); if( !IsAFile(sTexturePath) ) - { - RString sError = ssprintf( "'%s' references a texture '%s' that does not exist", sPath.c_str(), sTexturePath.c_str() ); - RageException::Throw( sError ); - } + RageException::Throw( "\"%s\" references a texture \"%s\" that does not exist.", sPath.c_str(), sTexturePath.c_str() ); Material.alpha.Load( sTexturePath ); } diff --git a/stepmania/src/ModelTypes.cpp b/stepmania/src/ModelTypes.cpp index ea26f21e5a..075997219a 100644 --- a/stepmania/src/ModelTypes.cpp +++ b/stepmania/src/ModelTypes.cpp @@ -51,11 +51,11 @@ void AnimatedTexture::Load( const RString &sTexOrIniPath ) { IniFile ini; if( !ini.ReadFile( sTexOrIniPath ) ) - RageException::Throw( "Error reading %s: %s", sTexOrIniPath.c_str(), ini.GetError().c_str() ); + RageException::Throw( "Error reading \"%s\": %s", sTexOrIniPath.c_str(), ini.GetError().c_str() ); const XNode* pAnimatedTexture = ini.GetChild("AnimatedTexture"); if( pAnimatedTexture == NULL ) - RageException::Throw( "The animated texture file '%s' doesn't contain a section called 'AnimatedTexture'.", sTexOrIniPath.c_str() ); + RageException::Throw( "The animated texture file \"%s\" doesn't contain a section called \"AnimatedTexture\".", sTexOrIniPath.c_str() ); pAnimatedTexture->GetAttrValue( "TexVelocityX", m_vTexVelocity.x ); pAnimatedTexture->GetAttrValue( "TexVelocityY", m_vTexVelocity.y ); @@ -214,7 +214,7 @@ RageVector2 AnimatedTexture::GetTextureTranslate() return v; } -#define THROW RageException::Throw( "Parse error in \"%s\" at line %d: '%s'", sPath.c_str(), iLineNum, sLine.c_str() ) +#define THROW RageException::Throw( "Parse error in \"%s\" at line %d: \"%s\".", sPath.c_str(), iLineNum, sLine.c_str() ) bool msAnimation::LoadMilkshapeAsciiBones( RString sAniName, RString sPath ) { diff --git a/stepmania/src/NoteSkinManager.cpp b/stepmania/src/NoteSkinManager.cpp index 1e96d3b3fb..0b2df1a944 100644 --- a/stepmania/src/NoteSkinManager.cpp +++ b/stepmania/src/NoteSkinManager.cpp @@ -172,12 +172,8 @@ RString NoteSkinManager::GetMetric( const RString &sButtonName, const RString &s if( data.metrics.GetValue( sButtonName, sValue, sReturn ) ) return sReturn; if( !data.metrics.GetValue( "NoteDisplay", sValue, sReturn ) ) - { - RString sError = ssprintf( - "Could not read metric '[%s] %s' or '[NoteDisplay] %s' in '%s'", - sButtonName.c_str(), sValue.c_str(), sValue.c_str(), sNoteSkinName.c_str() ); - RageException::Throw( sError ); - } + RageException::Throw( "Could not read metric \"%s : %s\" or \"NoteDisplay : %s\" in \"%s\".", + sButtonName.c_str(), sValue.c_str(), sValue.c_str(), sNoteSkinName.c_str() ); return sReturn; } @@ -229,7 +225,7 @@ try_again: if( sPath.empty() ) { RString message = ssprintf( - "The NoteSkin element '%s %s' could not be found in '%s', '%s', or '%s'.", + "The NoteSkin element \"%s %s\" could not be found in \"%s\", \"%s\", or \"%s\".", sButtonName.c_str(), sElement.c_str(), GetNoteSkinDir(m_sCurrentNoteSkin).c_str(), GetNoteSkinDir(GAME_BASE_NOTESKIN_NAME).c_str(), @@ -243,7 +239,7 @@ try_again: goto try_again; } - RageException::Throw( message ); + RageException::Throw( "%s", message.c_str() ); } int iLevel = 0; @@ -266,7 +262,7 @@ try_again: if( sRealPath == "" ) { RString message = ssprintf( - "NoteSkinManager: The redirect '%s' points to the file '%s', which does not exist. " + "NoteSkinManager: The redirect \"%s\" points to the file \"%s\", which does not exist. " "Verify that this redirect is correct.", sPath.c_str(), sNewFileName.c_str()); @@ -278,7 +274,7 @@ try_again: goto try_again; } - RageException::Throw( message ); + RageException::Throw( "%s", message.c_str() ); } sPath = sRealPath; diff --git a/stepmania/src/OptionRowHandler.cpp b/stepmania/src/OptionRowHandler.cpp index 305f07356d..09eb328070 100644 --- a/stepmania/src/OptionRowHandler.cpp +++ b/stepmania/src/OptionRowHandler.cpp @@ -147,7 +147,7 @@ public: /* Parse the basic configuration metric. */ Commands cmds = ParseCommands( ENTRY(sParam) ); if( cmds.v.size() < 1 ) - RageException::Throw( "Parse error in ScreenOptionsMaster::%s", sParam.c_str() ); + RageException::Throw( "Parse error in ScreenOptionsMaster::%s.", sParam.c_str() ); m_Def.m_bOneChoiceForAllPlayers = false; const int NumCols = atoi( cmds.v[0].m_vsArgs[0] ); @@ -183,7 +183,7 @@ public: for( unsigned i=1; iSetFromExpression( sLuaFunction ); if( m_pLuaTable->GetLuaType() != LUA_TTABLE ) - RageException::Throw( "Result of \"%s\" is not a table", sLuaFunction.c_str() ); + RageException::Throw( "Result of \"%s\" is not a table.", sLuaFunction.c_str() ); m_pLuaTable->PushSelf( L ); @@ -797,7 +797,7 @@ public: lua_gettable( L, -2 ); const char *pStr = lua_tostring( L, -1 ); if( pStr == NULL ) - RageException::Throw( "\"%s\" \"Name\" entry is not a string", sLuaFunction.c_str() ); + RageException::Throw( "\"%s\" \"Name\" entry is not a string.", sLuaFunction.c_str() ); m_Def.m_sName = pStr; lua_pop( L, 1 ); @@ -818,7 +818,7 @@ public: lua_gettable( L, -2 ); pStr = lua_tostring( L, -1 ); if( pStr == NULL ) - RageException::Throw( "\"%s\" \"LayoutType\" entry is not a string", sLuaFunction.c_str() ); + RageException::Throw( "\"%s\" \"LayoutType\" entry is not a string.", sLuaFunction.c_str() ); m_Def.m_layoutType = StringToLayoutType( pStr ); ASSERT( m_Def.m_layoutType != LAYOUT_INVALID ); lua_pop( L, 1 ); @@ -828,7 +828,7 @@ public: lua_gettable( L, -2 ); pStr = lua_tostring( L, -1 ); if( pStr == NULL ) - RageException::Throw( "\"%s\" \"SelectType\" entry is not a string", sLuaFunction.c_str() ); + RageException::Throw( "\"%s\" \"SelectType\" entry is not a string.", sLuaFunction.c_str() ); m_Def.m_selectType = StringToSelectType( pStr ); ASSERT( m_Def.m_selectType != SELECT_INVALID ); lua_pop( L, 1 ); @@ -838,7 +838,7 @@ public: lua_pushstring( L, "Choices" ); lua_gettable( L, -2 ); if( !lua_istable( L, -1 ) ) - RageException::Throw( "\"%s\" \"Choices\" is not a table", sLuaFunction.c_str() ); + RageException::Throw( "\"%s\" \"Choices\" is not a table.", sLuaFunction.c_str() ); lua_pushnil( L ); while( lua_next(L, -2) != 0 ) @@ -846,7 +846,7 @@ public: /* `key' is at index -2 and `value' at index -1 */ const char *pValue = lua_tostring( L, -1 ); if( pValue == NULL ) - RageException::Throw( "\"%s\" Column entry is not a string", sLuaFunction.c_str() ); + RageException::Throw( "\"%s\" Column entry is not a string.", sLuaFunction.c_str() ); // LOG->Trace( "'%s'", pValue); m_Def.m_vsChoices.push_back( pValue ); @@ -861,7 +861,7 @@ public: lua_pushstring( L, "EnabledForPlayers" ); lua_gettable( L, -2 ); if( !lua_isfunction( L, -1 ) && !lua_isnil( L, -1 ) ) - RageException::Throw( "\"%s\" \"EnabledForPlayers\" is not a table", sLuaFunction.c_str() ); + RageException::Throw( "\"%s\" \"EnabledForPlayers\" is not a table.", sLuaFunction.c_str() ); m_EnabledForPlayersFunc.SetFromStack( L ); SetEnabledForPlayers(); @@ -871,7 +871,7 @@ public: if( !lua_isnil( L, -1 ) ) { if( !lua_istable( L, -1 ) ) - RageException::Throw( "\"%s\" \"ReloadRowMessages\" is not a table", sLuaFunction.c_str() ); + RageException::Throw( "\"%s\" \"ReloadRowMessages\" is not a table.", sLuaFunction.c_str() ); lua_pushnil( L ); while( lua_next(L, -2) != 0 ) @@ -879,7 +879,7 @@ public: /* `key' is at index -2 and `value' at index -1 */ const char *pValue = lua_tostring( L, -1 ); if( pValue == NULL ) - RageException::Throw( "\"%s\" Column entry is not a string", sLuaFunction.c_str() ); + RageException::Throw( "\"%s\" Column entry is not a string.", sLuaFunction.c_str() ); LOG->Trace( "Found ReloadRowMessage '%s'", pValue); m_vsReloadRowMessages.push_back( pValue ); @@ -941,7 +941,7 @@ public: lua_pushstring( L, "LoadSelections" ); lua_gettable( L, -2 ); if( !lua_isfunction( L, -1 ) ) - RageException::Throw( "\"%s\" \"LoadSelections\" entry is not a function", m_Def.m_sName.c_str() ); + RageException::Throw( "\"%s\" \"LoadSelections\" entry is not a function.", m_Def.m_sName.c_str() ); /* Argument 1 (self): */ m_pLuaTable->PushSelf( L ); @@ -995,7 +995,7 @@ public: lua_pushstring( L, "SaveSelections" ); lua_gettable( L, -2 ); if( !lua_isfunction( L, -1 ) ) - RageException::Throw( "\"%s\" \"SaveSelections\" entry is not a function", m_Def.m_sName.c_str() ); + RageException::Throw( "\"%s\" \"SaveSelections\" entry is not a function.", m_Def.m_sName.c_str() ); /* Argument 1 (self): */ m_pLuaTable->PushSelf( L ); @@ -1141,7 +1141,7 @@ public: } else { - RageException::Throw( "invalid StepsType param \"%s\"", sParam.c_str() ); + RageException::Throw( "Invalid StepsType param \"%s\".", sParam.c_str() ); } m_Def.m_sName = sParam; diff --git a/stepmania/src/PercentageDisplay.cpp b/stepmania/src/PercentageDisplay.cpp index 0303726fee..a5e638b467 100644 --- a/stepmania/src/PercentageDisplay.cpp +++ b/stepmania/src/PercentageDisplay.cpp @@ -38,7 +38,7 @@ void PercentageDisplay::LoadFromNode( const RString& sDir, const XNode* pNode ) const XNode *pChild = pNode->GetChild( "Percent" ); if( pChild == NULL ) - RageException::Throw( ssprintf("PercentageDisplay in \"%s\" is missing the node \"Percent\"", sDir.c_str()) ); + RageException::Throw( "PercentageDisplay in \"%s\" is missing the node \"Percent\".", sDir.c_str() ); m_textPercent.LoadFromNode( sDir, pChild ); this->AddChild( &m_textPercent ); @@ -46,7 +46,7 @@ void PercentageDisplay::LoadFromNode( const RString& sDir, const XNode* pNode ) { const XNode *pChild = pNode->GetChild( "PercentRemainder" ); if( pChild == NULL ) - RageException::Throw( ssprintf("ComboGraph in \"%s\" is missing the node \"PercentRemainder\"", sDir.c_str()) ); + RageException::Throw( "ComboGraph in \"%s\" is missing the node \"PercentRemainder\".", sDir.c_str() ); m_textPercentRemainder.LoadFromNode( sDir, pChild ); this->AddChild( &m_textPercentRemainder ); } diff --git a/stepmania/src/PlayerAI.cpp b/stepmania/src/PlayerAI.cpp index 7f87aa32e5..49426e0dca 100644 --- a/stepmania/src/PlayerAI.cpp +++ b/stepmania/src/PlayerAI.cpp @@ -44,7 +44,7 @@ void PlayerAI::InitFromDisk() RString sKey = ssprintf("Skill%d", i); XNode* pNode = ini.GetChild(sKey); if( pNode == NULL ) - RageException::Throw( "AI.ini: '%s' doesn't exist.", sKey.c_str() ); + RageException::Throw( "AI.ini: \"%s\" doesn't exist.", sKey.c_str() ); TapScoreDistribution& dist = g_Distributions[i]; dist.fPercent[TNS_None] = 0; diff --git a/stepmania/src/RageFileDriverDeflate.cpp b/stepmania/src/RageFileDriverDeflate.cpp index f32fe66f32..505decc706 100644 --- a/stepmania/src/RageFileDriverDeflate.cpp +++ b/stepmania/src/RageFileDriverDeflate.cpp @@ -35,7 +35,7 @@ RageFileObjInflate::RageFileObjInflate( RageFileBasic *pFile, int iUncompressedS int err = inflateInit2( m_pInflate, -MAX_WBITS ); if( err == Z_MEM_ERROR ) - RageException::Throw( "inflateInit2( %i ): out of memory", -MAX_WBITS ); + RageException::Throw( "inflateInit2( %i ): out of memory.", -MAX_WBITS ); if( err != Z_OK ) LOG->Trace( "Huh? inflateInit2() err = %i", err ); @@ -65,7 +65,7 @@ RageFileObjInflate::RageFileObjInflate( const RageFileObjInflate &cpy ): RageFileBasic *RageFileObjInflate::Copy() const { - RageException::Throw( "Loading ZIPs from deflated ZIPs is currently disabled; see RageFileObjInflate" ); + RageException::Throw( "Loading ZIPs from deflated ZIPs is currently disabled; see RageFileObjInflate." ); // return new RageFileObjInflate( *this, p ); } @@ -208,7 +208,7 @@ RageFileObjDeflate::RageFileObjDeflate( RageFileBasic *pFile ) Z_DEFAULT_STRATEGY ); if( err == Z_MEM_ERROR ) - RageException::Throw( "inflateInit2( %i ): out of memory", -MAX_WBITS ); + RageException::Throw( "inflateInit2( %i ): out of memory.", -MAX_WBITS ); if( err != Z_OK ) LOG->Trace( "Huh? inflateInit2() err = %i", err ); diff --git a/stepmania/src/RageModelGeometry.cpp b/stepmania/src/RageModelGeometry.cpp index 09a61af9e2..53952ecf14 100644 --- a/stepmania/src/RageModelGeometry.cpp +++ b/stepmania/src/RageModelGeometry.cpp @@ -88,7 +88,7 @@ bool RageModelGeometry::HasAnyPerVertexBones() const return false; } -#define THROW RageException::Throw( "Parse error in \"%s\" at line %d: '%s'", sPath.c_str(), iLineNum, sLine.c_str() ) +#define THROW RageException::Throw( "Parse error in \"%s\" at line %d: \"%s\".", sPath.c_str(), iLineNum, sLine.c_str() ) void RageModelGeometry::LoadMilkshapeAscii( const RString& _sPath, bool bNeedsNormals ) { diff --git a/stepmania/src/RageSoundManager.cpp b/stepmania/src/RageSoundManager.cpp index f63a89a024..6202fd072e 100644 --- a/stepmania/src/RageSoundManager.cpp +++ b/stepmania/src/RageSoundManager.cpp @@ -55,7 +55,7 @@ void RageSoundManager::Init() m_pDriver = MakeRageSoundDriver( sDrivers ); if( m_pDriver == NULL ) - RageException::Throw( COULDNT_FIND_SOUND_DRIVER.GetValue() ); + RageException::Throw( "%s", COULDNT_FIND_SOUND_DRIVER.GetValue().c_str() ); } RageSoundManager::~RageSoundManager() diff --git a/stepmania/src/RageSoundReader_Vorbisfile.cpp b/stepmania/src/RageSoundReader_Vorbisfile.cpp index ce0ae7d62a..7457639423 100644 --- a/stepmania/src/RageSoundReader_Vorbisfile.cpp +++ b/stepmania/src/RageSoundReader_Vorbisfile.cpp @@ -133,7 +133,7 @@ int RageSoundReader_Vorbisfile::GetLength() const int len = int(ov_time_total(vf, -1) * 1000); #endif if( len == OV_EINVAL ) - RageException::Throw("RageSoundReader_Vorbisfile::GetLength: ov_time_total returned OV_EINVAL"); + RageException::Throw( "RageSoundReader_Vorbisfile::GetLength: ov_time_total returned OV_EINVAL." ); return len; } @@ -215,7 +215,8 @@ int RageSoundReader_Vorbisfile::Read(char *buf, unsigned len) ASSERT( vi != NULL ); if( (unsigned) vi->channels != channels ) - RageException::Throw( "File \"%s\" changes channel count from %i to %i; not supported", channels, vi->channels ); + RageException::Throw( "File \"%s\" changes channel count from %i to %i; not supported.", + filename.c_str(), channels, (int)vi->channels ); } diff --git a/stepmania/src/RageUtil.cpp b/stepmania/src/RageUtil.cpp index 92e32d87d1..0904021376 100644 --- a/stepmania/src/RageUtil.cpp +++ b/stepmania/src/RageUtil.cpp @@ -1040,14 +1040,14 @@ RString DerefRedir( const RString &_path ) GetDirListing( sPath2, matches, false, true ); if( matches.empty() ) - RageException::Throw( "The redirect '%s' references a file '%s' which doesn't exist.", sPath.c_str(), sPath2.c_str() ); + RageException::Throw( "The redirect \"%s\" references a file \"%s\" which doesn't exist.", sPath.c_str(), sPath2.c_str() ); else if( matches.size() > 1 ) - RageException::Throw( "The redirect '%s' references a file '%s' with multiple matches.", sPath.c_str(), sPath2.c_str() ); + RageException::Throw( "The redirect \"%s\" references a file \"%s\" with multiple matches.", sPath.c_str(), sPath2.c_str() ); sPath = matches[0]; } - RageException::Throw( "Circular redirect '%s'", sPath.c_str() ); + RageException::Throw( "Circular redirect \"%s\".", sPath.c_str() ); } bool GetFileContents( const RString &sPath, RString &sOut, bool bOneLine ) @@ -1091,7 +1091,7 @@ void Regex::Compile() m_pReg = pcre_compile( m_sPattern.c_str(), PCRE_CASELESS, &error, &offset, NULL ); if( m_pReg == NULL ) - RageException::Throw( "Invalid regex: \"%s\" (%s)", m_sPattern.c_str(), error ); + RageException::Throw( "Invalid regex: \"%s\" (%s).", m_sPattern.c_str(), error ); int iRet = pcre_fullinfo( (pcre *) m_pReg, NULL, PCRE_INFO_CAPTURECOUNT, &m_iBackrefs ); ASSERT( iRet >= 0 ); @@ -1144,7 +1144,7 @@ bool Regex::Compare( const RString &sStr ) int iRet = pcre_exec( (pcre *) m_pReg, NULL, sStr.data(), sStr.size(), 0, 0, iMat, 128*3 ); if( iRet < -1 ) - RageException::Throw( "Unexpected return from pcre_exec('%s'): %i", m_sPattern.c_str(), iRet ); + RageException::Throw( "Unexpected return from pcre_exec('%s'): %i.", m_sPattern.c_str(), iRet ); return iRet >= 0; } @@ -1157,7 +1157,7 @@ bool Regex::Compare( const RString &sStr, vector &asMatches ) int iRet = pcre_exec( (pcre *) m_pReg, NULL, sStr.data(), sStr.size(), 0, 0, iMat, 128*3 ); if( iRet < -1 ) - RageException::Throw( "Unexpected return from pcre_exec('%s'): %i", m_sPattern.c_str(), iRet ); + RageException::Throw( "Unexpected return from pcre_exec('%s'): %i.", m_sPattern.c_str(), iRet ); if( iRet == -1 ) return false; diff --git a/stepmania/src/RageUtil_CharConversions.cpp b/stepmania/src/RageUtil_CharConversions.cpp index c19d104c2c..24988ba6e4 100644 --- a/stepmania/src/RageUtil_CharConversions.cpp +++ b/stepmania/src/RageUtil_CharConversions.cpp @@ -165,7 +165,7 @@ bool ConvertString(RString &str, const RString &encodings) continue; } - RageException::Throw( "Unexpected conversion string \"%s\" (string \"%s\")", + RageException::Throw( "Unexpected conversion string \"%s\" (string \"%s\").", lst[i].c_str(), str.c_str() ); } diff --git a/stepmania/src/ScreenManager.cpp b/stepmania/src/ScreenManager.cpp index 5b6e52d8cb..64e79b7f78 100644 --- a/stepmania/src/ScreenManager.cpp +++ b/stepmania/src/ScreenManager.cpp @@ -516,7 +516,7 @@ Screen* ScreenManager::MakeNewScreen( const RString &sScreenName ) map::iterator iter = g_pmapRegistrees->find( sClassName ); if( iter == g_pmapRegistrees->end() ) - RageException::Throw( "Screen '%s' has an invalid class '%s'", sScreenName.c_str(), sClassName.c_str() ); + RageException::Throw( "Screen \"%s\" has an invalid class \"%s\".", sScreenName.c_str(), sClassName.c_str() ); this->ZeroNextUpdate(); diff --git a/stepmania/src/ScreenOptionsManageCourses.cpp b/stepmania/src/ScreenOptionsManageCourses.cpp index 393058bf1e..327a93649c 100644 --- a/stepmania/src/ScreenOptionsManageCourses.cpp +++ b/stepmania/src/ScreenOptionsManageCourses.cpp @@ -195,7 +195,7 @@ void ScreenOptionsManageCourses::BeginScreen() switch( EDIT_MODE.GetValue() ) { default: - RageException::Throw( "ScreenOptionsManageCourses: Invalid edit mode:", + RageException::Throw( "ScreenOptionsManageCourses: Invalid edit mode: %s.", EditModeToString(EDIT_MODE.GetValue()).c_str() ); case EditMode_Practice: case EditMode_Home: diff --git a/stepmania/src/ScreenOptionsMaster.cpp b/stepmania/src/ScreenOptionsMaster.cpp index f2c031bfb2..f36c7cf5d7 100644 --- a/stepmania/src/ScreenOptionsMaster.cpp +++ b/stepmania/src/ScreenOptionsMaster.cpp @@ -30,7 +30,7 @@ void ScreenOptionsMaster::Init() vector asLineNames; split( LINE_NAMES, ",", asLineNames ); if( asLineNames.empty() ) - RageException::Throw( "%s::LineNames is empty.", m_sName.c_str() ); + RageException::Throw( "\"%s : LineNames\" is empty.", m_sName.c_str() ); if( FORCE_ALL_PLAYERS ) { @@ -59,7 +59,7 @@ void ScreenOptionsMaster::Init() OptionRowHandler *pHand = OptionRowHandlerUtil::Make( cmds ); if( pHand == NULL ) - RageException::Throw( "Invalid OptionRowHandler '%s' in %s::Line%i", cmds.GetOriginalCommandString().c_str(), m_sName.c_str(), i ); + RageException::Throw( "Invalid OptionRowHandler \"%s\" in \"%s : Line%i\".", cmds.GetOriginalCommandString().c_str(), m_sName.c_str(), i ); OptionRowHandlers.push_back( pHand ); } diff --git a/stepmania/src/ScreenSelect.cpp b/stepmania/src/ScreenSelect.cpp index bb09e6791a..ed21522201 100644 --- a/stepmania/src/ScreenSelect.cpp +++ b/stepmania/src/ScreenSelect.cpp @@ -81,7 +81,7 @@ void ScreenSelect::Init() } if( !m_aGameCommands.size() ) - RageException::Throw( "Screen \"%s\" does not set any choices", m_sName.c_str() ); + RageException::Throw( "Screen \"%s\" does not set any choices.", m_sName.c_str() ); } void ScreenSelect::BeginScreen() diff --git a/stepmania/src/ScreenSelectDifficulty.cpp b/stepmania/src/ScreenSelectDifficulty.cpp index 803f84599d..23deefbec5 100644 --- a/stepmania/src/ScreenSelectDifficulty.cpp +++ b/stepmania/src/ScreenSelectDifficulty.cpp @@ -331,7 +331,7 @@ void ScreenSelectDifficulty::ChangePage( Page newPage ) } } if( iSwitchToIndex == -1 ) - RageException::Throw( "%s has no selectable choices on page %i", m_sName.c_str(), newPage); + RageException::Throw( "\"%s\" has no selectable choices on page %i.", m_sName.c_str(), newPage); // change both players FOREACH_PlayerNumber( p ) diff --git a/stepmania/src/SongManager.cpp b/stepmania/src/SongManager.cpp index 6f70ebefdd..33eb765e47 100644 --- a/stepmania/src/SongManager.cpp +++ b/stepmania/src/SongManager.cpp @@ -133,7 +133,7 @@ void SongManager::InitSongsFromDisk( LoadingWindow *ld ) } -static LocalizedString FOLDER_CONTAINS_MUSIC_FILES( "SongManager", "The folder '%s' appears to be a song folder. All song folders must reside in a group folder. For example, 'Songs/Originals/My Song'." ); +static LocalizedString FOLDER_CONTAINS_MUSIC_FILES( "SongManager", "The folder \"%s\" appears to be a song folder. All song folders must reside in a group folder. For example, \"Songs/Originals/My Song\"." ); void SongManager::SanityCheckGroupDir( RString sDir ) const { // Check to see if they put a song directly inside the group folder. diff --git a/stepmania/src/Sprite.cpp b/stepmania/src/Sprite.cpp index a1c3acbd1e..35dd7e234c 100644 --- a/stepmania/src/Sprite.cpp +++ b/stepmania/src/Sprite.cpp @@ -139,7 +139,7 @@ void Sprite::LoadFromNode( const RString& sDir, const XNode* pNode ) if( !pNode->GetAttrValue(sFrameKey, newState.iFrameIndex) ) break; if( newState.iFrameIndex >= m_pTexture->GetNumFrames() ) - RageException::Throw( "In '%s', %s is %d, but the texture %s only has %d frames.", + RageException::Throw( "In \"%s\", %s is %d, but the texture \"%s\" only has %d frames.", sDir.c_str(), sFrameKey.c_str(), newState.iFrameIndex, sPath.c_str(), m_pTexture->GetNumFrames() ); if( !pNode->GetAttrValue(sDelayKey, newState.fDelay) ) diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index 3c6e618a3b..5b057961d6 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -188,7 +188,7 @@ void StepMania::ApplyGraphicOptions() GetPreferredVideoModeParams( params ); RString sError = DISPLAY->SetVideoMode( params, bNeedReload ); if( sError != "" ) - RageException::Throw( sError ); + RageException::Throw( "%s", sError.c_str() ); DISPLAY->ChangeCentering( PREFSMAN->m_iCenterImageTranslateX, @@ -704,7 +704,7 @@ RageDisplay *CreateDisplay() split( PREFSMAN->m_sVideoRenderers, ",", asRenderers, true ); if( asRenderers.empty() ) - RageException::Throw( ERROR_NO_VIDEO_RENDERERS.GetValue() ); + RageException::Throw( "%s", ERROR_NO_VIDEO_RENDERERS.GetValue().c_str() ); RageDisplay *pRet = NULL; for( unsigned i=0; im_bShowLoadingWindow. */ LoadingWindow *loading_window = MakeLoadingWindow(); if( loading_window == NULL ) - RageException::Throw( COULDNT_OPEN_LOADING_WINDOW.GetValue() ); + RageException::Throw( "%s", COULDNT_OPEN_LOADING_WINDOW.GetValue().c_str() ); srand( time(NULL) ); // seed number generator diff --git a/stepmania/src/arch/MovieTexture/MovieTexture_Generic.cpp b/stepmania/src/arch/MovieTexture/MovieTexture_Generic.cpp index 1f57d8396a..5dfcae6f33 100644 --- a/stepmania/src/arch/MovieTexture/MovieTexture_Generic.cpp +++ b/stepmania/src/arch/MovieTexture/MovieTexture_Generic.cpp @@ -189,7 +189,7 @@ bool MovieTexture_Generic::DecodeFrame() m_pDecoder->Close(); RString sError = m_pDecoder->Open( GetID().filename ); if( sError != "" ) - RageException::Throw( "Error rewinding stream %s: %s", GetID().filename.c_str(), sError.c_str() ); + RageException::Throw( "Error rewinding stream \"%s\": %s", GetID().filename.c_str(), sError.c_str() ); m_fClock = -fDelay; } diff --git a/stepmania/src/arch/arch.cpp b/stepmania/src/arch/arch.cpp index 2a5d30726e..a0b28240b0 100644 --- a/stepmania/src/arch/arch.cpp +++ b/stepmania/src/arch/arch.cpp @@ -20,7 +20,7 @@ void MakeInputHandlers( const RString &drivers, vector &Add ) split( drivers, ",", DriversToTry, true ); if( DriversToTry.empty() ) - RageException::Throw( INPUT_HANDLERS_EMPTY.GetValue() ); + RageException::Throw( "%s", INPUT_HANDLERS_EMPTY.GetValue().c_str() ); RString Driver; @@ -190,7 +190,7 @@ RageMovieTexture *MakeRageMovieTexture( RageTextureID ID ) split( sDrivers, ",", DriversToTry, true ); if( DriversToTry.empty() ) - RageException::Throw( MOVIE_DRIVERS_EMPTY.GetValue() ); + RageException::Throw( "%s", MOVIE_DRIVERS_EMPTY.GetValue().c_str() ); RString Driver; RageMovieTexture *ret = NULL; @@ -225,7 +225,7 @@ RageMovieTexture *MakeRageMovieTexture( RageTextureID ID ) } } if ( !ret ) - RageException::Throw( COULDNT_CREATE_MOVIE_DRIVER.GetValue() ); + RageException::Throw( "%s", COULDNT_CREATE_MOVIE_DRIVER.GetValue().c_str() ); LOG->Trace( "Created movie texture \"%s\" with driver \"%s\"", ID.filename.c_str(), Driver.c_str() ); @@ -240,7 +240,7 @@ RageSoundDriver *MakeRageSoundDriver( const RString &drivers ) split( drivers, ",", DriversToTry, true ); if( DriversToTry.empty() ) - RageException::Throw( SOUND_DRIVERS_CANNOT_EMPTY.GetValue() ); + RageException::Throw( "%s", SOUND_DRIVERS_CANNOT_EMPTY.GetValue().c_str() ); RString Driver; RageSoundDriver *ret = NULL;