Cleanup RageException::Throw(). Do not use ssprintf() inside of Throw() and do not pass it bare error messages. Use RageException::Throw( "%s", sError.c_str() ); instead. Be consistent with quoting file names "%s" and theme metrics as "%s : %s". Try to make them complete English sentences when possible.
This commit is contained in:
@@ -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 );
|
||||
|
||||
@@ -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() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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 )
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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] != '/' )
|
||||
|
||||
@@ -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] );
|
||||
|
||||
@@ -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() )
|
||||
|
||||
@@ -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<RString> 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 )
|
||||
|
||||
+12
-13
@@ -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<wchar_t,glyph*>::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",
|
||||
|
||||
@@ -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()) );
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
|
||||
@@ -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) != "/" )
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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] != '/' )
|
||||
|
||||
+5
-11
@@ -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 );
|
||||
}
|
||||
|
||||
@@ -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 )
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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; i<cmd.m_vsArgs.size(); i++ )
|
||||
m_vsBroadcastOnExport.push_back( cmd.m_vsArgs[i] );
|
||||
}
|
||||
else RageException::Throw( "Unkown row flag \"%s\"", sName.c_str() );
|
||||
else RageException::Throw( "Unkown row flag \"%s\".", sName.c_str() );
|
||||
}
|
||||
|
||||
for( int col = 0; col < NumCols; ++col )
|
||||
@@ -196,7 +196,7 @@ public:
|
||||
if( mc.m_sName == "" && NumCols == 1 )
|
||||
mc.m_sName = sParam;
|
||||
if( mc.m_sName == "" )
|
||||
RageException::Throw( "List \"%s\", col %i has no name", sParam.c_str(), col );
|
||||
RageException::Throw( "List \"%s\", col %i has no name.", sParam.c_str(), col );
|
||||
|
||||
if( !mc.IsPlayable() )
|
||||
{
|
||||
@@ -465,7 +465,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;
|
||||
@@ -754,7 +754,7 @@ public:
|
||||
|
||||
lua_call( L, 1, 1 ); // call function with 1 argument and 1 result
|
||||
if( !lua_istable(L, -1) )
|
||||
RageException::Throw( "\"EnabledForPlayers\" did not return a table" );
|
||||
RageException::Throw( "\"EnabledForPlayers\" did not return a table." );
|
||||
|
||||
m_Def.m_vEnabledForPlayers.clear(); // and fill in with supplied PlayerNumbers below
|
||||
|
||||
@@ -789,7 +789,7 @@ public:
|
||||
m_pLuaTable->SetFromExpression( 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;
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 );
|
||||
|
||||
|
||||
@@ -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 )
|
||||
{
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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<RString> &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;
|
||||
|
||||
@@ -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() );
|
||||
}
|
||||
|
||||
|
||||
@@ -516,7 +516,7 @@ Screen* ScreenManager::MakeNewScreen( const RString &sScreenName )
|
||||
|
||||
map<RString,CreateScreenFn>::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();
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -30,7 +30,7 @@ void ScreenOptionsMaster::Init()
|
||||
vector<RString> 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 );
|
||||
}
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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 )
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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) )
|
||||
|
||||
@@ -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; i<asRenderers.size(); i++ )
|
||||
@@ -748,7 +748,7 @@ RageDisplay *CreateDisplay()
|
||||
}
|
||||
|
||||
if( pRet == NULL)
|
||||
RageException::Throw( error );
|
||||
RageException::Throw( "%s", error.c_str() );
|
||||
|
||||
return pRet;
|
||||
}
|
||||
@@ -1003,7 +1003,7 @@ int main(int argc, char* argv[])
|
||||
/* This requires PREFSMAN, for PREFSMAN->m_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
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ void MakeInputHandlers( const RString &drivers, vector<InputHandler *> &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;
|
||||
|
||||
Reference in New Issue
Block a user