Partial s/GetString/c_str/.

(watch out for PlayerOptions::GetString and SongOptions::GetString)
This commit is contained in:
Glenn Maynard
2003-04-25 00:01:35 +00:00
parent 8b8b0bd66a
commit fe33dec385
36 changed files with 200 additions and 200 deletions
+2 -2
View File
@@ -722,7 +722,7 @@ void Actor::Command( CString sCommandString )
else if( sName=="additiveblend" ) EnableAdditiveBlend( bParam(1) ); else if( sName=="additiveblend" ) EnableAdditiveBlend( bParam(1) );
else else
{ {
CString sError = ssprintf( "Unrecognized command name '%s' in command string '%s'.", sName.GetString(), sCommandString.GetString() ); CString sError = ssprintf( "Unrecognized command name '%s' in command string '%s'.", sName.c_str(), sCommandString.c_str() );
LOG->Warn( sError ); LOG->Warn( sError );
#if defined(WIN32) // XXX arch? #if defined(WIN32) // XXX arch?
if( DISPLAY->IsWindowed() ) if( DISPLAY->IsWindowed() )
@@ -733,7 +733,7 @@ void Actor::Command( CString sCommandString )
if( iMaxIndexAccessed != (int)asTokens.size()-1 ) if( iMaxIndexAccessed != (int)asTokens.size()-1 )
{ {
CString sError = ssprintf( "Wrong number of parameters in command '%s'. Expected %d but there are %d.", join(",",asTokens).GetString(), iMaxIndexAccessed+1, (int)asTokens.size() ); CString sError = ssprintf( "Wrong number of parameters in command '%s'. Expected %d but there are %d.", join(",",asTokens).c_str(), iMaxIndexAccessed+1, (int)asTokens.size() );
LOG->Warn( sError ); LOG->Warn( sError );
#if defined(WIN32) // XXX arch? #if defined(WIN32) // XXX arch?
if( DISPLAY->IsWindowed() ) if( DISPLAY->IsWindowed() )
+1 -1
View File
@@ -133,7 +133,7 @@ CString AnnouncerManager::GetPathTo( CString sAnnouncerName, CString sFolderName
* its preferred name. */ * its preferred name. */
#ifdef DEBUG #ifdef DEBUG
LOG->Trace( "The announcer in \"%s\" is missing the folder '%s'.", LOG->Trace( "The announcer in \"%s\" is missing the folder '%s'.",
AnnouncerPath.GetString(), sFolderName.GetString() ); AnnouncerPath.c_str(), sFolderName.c_str() );
// MessageBeep( MB_OK ); // MessageBeep( MB_OK );
CreateDirectories( AnnouncerPath+sFolderName ); CreateDirectories( AnnouncerPath+sFolderName );
#endif #endif
+2 -2
View File
@@ -87,7 +87,7 @@ BitmapText::~BitmapText()
bool BitmapText::LoadFromFont( CString sFontFilePath ) bool BitmapText::LoadFromFont( CString sFontFilePath )
{ {
Checkpoint( ssprintf("BitmapText::LoadFromFontName(%s)", sFontFilePath.GetString()) ); Checkpoint( ssprintf("BitmapText::LoadFromFontName(%s)", sFontFilePath.c_str()) );
if( m_pFont ) { if( m_pFont ) {
FONT->UnloadFont( m_pFont ); FONT->UnloadFont( m_pFont );
@@ -105,7 +105,7 @@ bool BitmapText::LoadFromFont( CString sFontFilePath )
bool BitmapText::LoadFromTextureAndChars( CString sTexturePath, CString sChars ) bool BitmapText::LoadFromTextureAndChars( CString sTexturePath, CString sChars )
{ {
Checkpoint( ssprintf("BitmapText::LoadFromTextureAndChars(\"%s\",\"%s\")", sTexturePath.GetString(), sChars.GetString()) ); Checkpoint( ssprintf("BitmapText::LoadFromTextureAndChars(\"%s\",\"%s\")", sTexturePath.c_str(), sChars.c_str()) );
if( m_pFont ) { if( m_pFont ) {
FONT->UnloadFont( m_pFont ); FONT->UnloadFont( m_pFont );
+2 -2
View File
@@ -76,7 +76,7 @@ void RefreshCacheItem( int iIndex )
if( asButtonNames.size() < 2 ) if( asButtonNames.size() < 2 )
{ {
LOG->Trace( "The code '%s' is less than 2 buttons, so it will be ignored.", sCodeName.GetString() ); LOG->Trace( "The code '%s' is less than 2 buttons, so it will be ignored.", sCodeName.c_str() );
item.iNumButtons = 0; item.iNumButtons = 0;
return; return;
} }
@@ -99,7 +99,7 @@ void RefreshCacheItem( int iIndex )
} }
if( gb == -1 ) // didn't find it if( gb == -1 ) // didn't find it
{ {
LOG->Trace( "The code '%s' contains an unrecognized button '%s'.", sCodeName.GetString(), sButtonName.GetString() ); LOG->Trace( "The code '%s' contains an unrecognized button '%s'.", sCodeName.c_str(), sButtonName.c_str() );
item.iNumButtons = 0; item.iNumButtons = 0;
return; return;
} }
+12 -12
View File
@@ -98,7 +98,7 @@ Song *Course::FindSong(CString sGroup, CString sSong) const
} }
LOG->Trace( "Course file '%s' contains a song '%s%s%s' that is not present", LOG->Trace( "Course file '%s' contains a song '%s%s%s' that is not present",
m_sPath.GetString(), sGroup.GetString(), sGroup.size()? "/":"", sSong.GetString()); m_sPath.c_str(), sGroup.c_str(), sGroup.size()? "/":"", sSong.c_str());
return NULL; return NULL;
} }
@@ -109,7 +109,7 @@ void Course::LoadFromCRSFile( CString sPath )
MsdFile msd; MsdFile msd;
if( !msd.ReadFile(sPath) ) if( !msd.ReadFile(sPath) )
RageException::Throw( "Error opening CRS file '%s'.", sPath.GetString() ); RageException::Throw( "Error opening CRS file '%s'.", sPath.c_str() );
CString sDir, sFName, sExt; CString sDir, sFName, sExt;
splitrelpath( sPath, sDir, sFName, sExt ); splitrelpath( sPath, sDir, sFName, sExt );
@@ -179,12 +179,12 @@ void Course::LoadFromCRSFile( CString sPath )
else else
LOG->Warn( "Course file '%s' contains a random_within_group entry '%s' that is invalid. " LOG->Warn( "Course file '%s' contains a random_within_group entry '%s' that is invalid. "
"Song should be in the format '<group>/*'.", "Song should be in the format '<group>/*'.",
m_sPath.GetString(), sSong.GetString()); m_sPath.c_str(), sSong.c_str());
if( !SONGMAN->DoesGroupExist(new_entry.group_name) ) if( !SONGMAN->DoesGroupExist(new_entry.group_name) )
{ {
LOG->Warn( "Course file '%s' random_within_group entry '%s' specifies a group that doesn't exist. " LOG->Warn( "Course file '%s' random_within_group entry '%s' specifies a group that doesn't exist. "
"This entry will be ignored.", "This entry will be ignored.",
m_sPath.GetString(), sSong.GetString()); m_sPath.c_str(), sSong.c_str());
continue; // skip this #SONG continue; // skip this #SONG
} }
} }
@@ -204,14 +204,14 @@ void Course::LoadFromCRSFile( CString sPath )
{ {
LOG->Warn( "Course file '%s' contains a fixed song entry '%s' that is invalid. " LOG->Warn( "Course file '%s' contains a fixed song entry '%s' that is invalid. "
"Song should be in the format '<group>/<song>'.", "Song should be in the format '<group>/<song>'.",
m_sPath.GetString(), sSong.GetString()); m_sPath.c_str(), sSong.c_str());
continue; // skip this #SONG continue; // skip this #SONG
} }
if( !new_entry.pSong ) if( !new_entry.pSong )
{ {
LOG->Warn( "Course file '%s' contains a fixed song entry '%s' that does not exist. " LOG->Warn( "Course file '%s' contains a fixed song entry '%s' that does not exist. "
"This entry will be ignored.", "This entry will be ignored.",
m_sPath.GetString(), sSong.GetString()); m_sPath.c_str(), sSong.c_str());
continue; // skip this #SONG continue; // skip this #SONG
} }
} }
@@ -233,7 +233,7 @@ void Course::LoadFromCRSFile( CString sPath )
} }
else else
LOG->Trace( "Unexpected value named '%s'", sValueName.GetString() ); LOG->Trace( "Unexpected value named '%s'", sValueName.c_str() );
} }
static TitleSubst tsub("courses"); static TitleSubst tsub("courses");
@@ -250,11 +250,11 @@ void Course::Save()
FILE* fp = fopen( m_sPath, "w" ); FILE* fp = fopen( m_sPath, "w" );
if( fp == NULL ) if( fp == NULL )
{ {
LOG->Warn( "Could not write course file '%s'.", m_sPath.GetString() ); LOG->Warn( "Could not write course file '%s'.", m_sPath.c_str() );
return; return;
} }
fprintf( fp, "#COURSE:%s;\n", m_sName.GetString() ); fprintf( fp, "#COURSE:%s;\n", m_sName.c_str() );
fprintf( fp, "#REPEAT:%s;\n", m_bRepeat ? "YES" : "NO" ); fprintf( fp, "#REPEAT:%s;\n", m_bRepeat ? "YES" : "NO" );
fprintf( fp, "#LIVES:%i;\n", m_iLives ); fprintf( fp, "#LIVES:%i;\n", m_iLives );
fprintf( fp, "#EXTRA:%i;\n", m_iExtra ); fprintf( fp, "#EXTRA:%i;\n", m_iExtra );
@@ -266,13 +266,13 @@ void Course::Save()
switch( entry.type ) switch( entry.type )
{ {
case Entry::fixed: case Entry::fixed:
fprintf( fp, "#SONG:%s", entry.pSong->GetSongDir().GetString() ); fprintf( fp, "#SONG:%s", entry.pSong->GetSongDir().c_str() );
break; break;
case Entry::random: case Entry::random:
fprintf( fp, "#SONG:*" ); fprintf( fp, "#SONG:*" );
break; break;
case Entry::random_within_group: case Entry::random_within_group:
fprintf( fp, "#SONG:%s/*", entry.group_name.GetString() ); fprintf( fp, "#SONG:%s/*", entry.group_name.c_str() );
break; break;
case Entry::best: case Entry::best:
fprintf( fp, "#SONG:BEST%d", entry.players_index+1 ); fprintf( fp, "#SONG:BEST%d", entry.players_index+1 );
@@ -285,7 +285,7 @@ void Course::Save()
} }
if( entry.difficulty != DIFFICULTY_INVALID ) if( entry.difficulty != DIFFICULTY_INVALID )
fprintf( fp, ":%s", DifficultyToString(entry.difficulty).GetString() ); fprintf( fp, ":%s", DifficultyToString(entry.difficulty).c_str() );
if( entry.low_meter != -1 && entry.high_meter != -1 ) if( entry.low_meter != -1 && entry.high_meter != -1 )
fprintf( fp, ":%d..%d", entry.low_meter, entry.high_meter ); fprintf( fp, ":%d..%d", entry.low_meter, entry.high_meter );
+23 -23
View File
@@ -105,7 +105,7 @@ void FontPage::Load( FontPageSettings cfg )
SetExtraPixels(cfg.DrawExtraPixelsLeft, cfg.DrawExtraPixelsRight); SetExtraPixels(cfg.DrawExtraPixelsLeft, cfg.DrawExtraPixelsRight);
// LOG->Trace("Font %s: height %i, baseline %i ( == top %i)", // LOG->Trace("Font %s: height %i, baseline %i ( == top %i)",
// m_sTexturePath.GetString(), height, baseline, baseline-height); // m_sTexturePath.c_str(), height, baseline, baseline-height);
} }
void FontPage::SetTextureCoords(const vector<int> &widths) void FontPage::SetTextureCoords(const vector<int> &widths)
@@ -216,7 +216,7 @@ int Font::GetLineHeightInSourcePixels( const wstring &szLine ) const
Font::Font() Font::Font()
{ {
//LOG->Trace( "Font::LoadFromFontName(%s)", sASCIITexturePath.GetString() ); //LOG->Trace( "Font::LoadFromFontName(%s)", sASCIITexturePath.c_str() );
m_iRefCount = 1; m_iRefCount = 1;
def = NULL; def = NULL;
@@ -296,7 +296,7 @@ const glyph &Font::GetGlyph( wchar_t c ) const
if(it == m_iCharToGlyph.end()) it = m_iCharToGlyph.find(DEFAULT_GLYPH); if(it == m_iCharToGlyph.end()) it = m_iCharToGlyph.find(DEFAULT_GLYPH);
if(it == m_iCharToGlyph.end()) if(it == m_iCharToGlyph.end())
RageException::Throw( "The default glyph is missing from the font '%s'", path.GetString() ); RageException::Throw( "The default glyph is missing from the font '%s'", path.c_str() );
return *it->second; return *it->second;
} }
@@ -305,7 +305,7 @@ bool Font::FontCompleteForString( const wstring &str ) const
{ {
map<longchar,glyph*>::const_iterator def = m_iCharToGlyph.find(DEFAULT_GLYPH); map<longchar,glyph*>::const_iterator def = m_iCharToGlyph.find(DEFAULT_GLYPH);
if(def == m_iCharToGlyph.end()) if(def == m_iCharToGlyph.end())
RageException::Throw( "The default glyph is missing from the font '%s'", path.GetString() ); RageException::Throw( "The default glyph is missing from the font '%s'", path.c_str() );
for(unsigned i = 0; i < str.size(); ++i) for(unsigned i = 0; i < str.size(); ++i)
{ {
@@ -367,7 +367,7 @@ CString Font::GetFontName(CString FileName)
TrimRight(FileName); TrimRight(FileName);
if(FileName.empty()) if(FileName.empty())
RageException::Throw("Can't parse font filename \"%s\"", orig.GetString()); RageException::Throw("Can't parse font filename \"%s\"", orig.c_str());
FileName.MakeLower(); FileName.MakeLower();
return FileName; return FileName;
@@ -426,7 +426,7 @@ void Font::GetFontPaths(const CString &sFontOrTextureFilePath,
if(!Files[i].Right(4).CompareNoCase(".ini")) if(!Files[i].Right(4).CompareNoCase(".ini"))
{ {
if(!IniPath.empty()) if(!IniPath.empty())
RageException::Throw("More than one INI found\n%s\n%s", IniPath.GetString(), Files[i].GetString()); RageException::Throw("More than one INI found\n%s\n%s", IniPath.c_str(), Files[i].c_str());
IniPath = sDir+Files[i]; IniPath = sDir+Files[i];
continue; continue;
@@ -464,7 +464,7 @@ void Font::LoadFontPageSettings(FontPageSettings &cfg, IniFile &ini, const CStri
ini.RenameKey("Char Widths", "main"); ini.RenameKey("Char Widths", "main");
// LOG->Trace("Loading font page '%s' settings from page name '%s'", // LOG->Trace("Loading font page '%s' settings from page name '%s'",
// TexturePath.GetString(), PageName.GetString()); // TexturePath.c_str(), PageName.c_str());
ini.GetValueI( PageName, "DrawExtraPixelsLeft", cfg.DrawExtraPixelsLeft ); ini.GetValueI( PageName, "DrawExtraPixelsLeft", cfg.DrawExtraPixelsLeft );
ini.GetValueI( PageName, "DrawExtraPixelsRight", cfg.DrawExtraPixelsRight ); ini.GetValueI( PageName, "DrawExtraPixelsRight", cfg.DrawExtraPixelsRight );
@@ -522,7 +522,7 @@ void Font::LoadFontPageSettings(FontPageSettings &cfg, IniFile &ini, const CStri
if(game == GAME_INVALID) if(game == GAME_INVALID)
{ {
LOG->Warn( "Font definition '%s' uses unknown game type '%s'", LOG->Warn( "Font definition '%s' uses unknown game type '%s'",
ini.GetPath().GetString(), gamename.GetString() ); ini.GetPath().c_str(), gamename.c_str() );
continue; continue;
} }
} }
@@ -536,12 +536,12 @@ void Font::LoadFontPageSettings(FontPageSettings &cfg, IniFile &ini, const CStri
c = utf8_get_char(codepoint.c_str()); c = utf8_get_char(codepoint.c_str());
if(c == wchar_t(-1)) if(c == wchar_t(-1))
LOG->Warn("Font definition '%s' has an invalid value '%s'.", LOG->Warn("Font definition '%s' has an invalid value '%s'.",
ini.GetPath().GetString(), val.GetString() ); ini.GetPath().c_str(), val.c_str() );
} }
else if(!FontCharAliases::GetChar(codepoint, c)) else if(!FontCharAliases::GetChar(codepoint, c))
{ {
LOG->Warn("Font definition '%s' has an invalid value '%s'.", LOG->Warn("Font definition '%s' has an invalid value '%s'.",
ini.GetPath().GetString(), val.GetString() ); ini.GetPath().c_str(), val.c_str() );
continue; continue;
} }
@@ -581,7 +581,7 @@ void Font::LoadFontPageSettings(FontPageSettings &cfg, IniFile &ini, const CStri
if(!match || matches[0].empty()) if(!match || matches[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().GetString(), val.GetString() ); ini.GetPath().c_str(), val.c_str() );
/* We must have either 1 match (just the codeset) or 4 (the whole thing). */ /* We must have either 1 match (just the codeset) or 4 (the whole thing). */
@@ -589,12 +589,12 @@ void Font::LoadFontPageSettings(FontPageSettings &cfg, IniFile &ini, const CStri
int first = 0; int first = 0;
if(!matches[2].empty()) if(!matches[2].empty())
{ {
sscanf(matches[2].GetString(), "%x", &first); sscanf(matches[2].c_str(), "%x", &first);
int last; int last;
sscanf(matches[3].GetString(), "%x", &last); sscanf(matches[3].c_str(), "%x", &last);
if(last < first) if(last < first)
RageException::Throw("Font definition '%s' has an invalid range '%s': %i < %i.", RageException::Throw("Font definition '%s' has an invalid range '%s': %i < %i.",
ini.GetPath().GetString(), val.GetString(), last < first ); ini.GetPath().c_str(), val.c_str(), last < first );
cnt = last-first+1; cnt = last-first+1;
} }
@@ -602,7 +602,7 @@ void Font::LoadFontPageSettings(FontPageSettings &cfg, IniFile &ini, const CStri
CString ret = cfg.MapRange(matches[0], first, atoi(data), cnt); CString ret = cfg.MapRange(matches[0], first, atoi(data), cnt);
if(!ret.empty()) if(!ret.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().GetString(), val.GetString(), ret.GetString() ); ini.GetPath().c_str(), val.c_str(), ret.c_str() );
continue; continue;
} }
@@ -622,14 +622,14 @@ void Font::LoadFontPageSettings(FontPageSettings &cfg, IniFile &ini, const CStri
if(row > NumFramesHigh) if(row > NumFramesHigh)
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().GetString(), first_frame, NumFramesHigh); ini.GetPath().c_str(), first_frame, NumFramesHigh);
/* Decode the string. */ /* Decode the string. */
const wstring wdata(CStringToWstring(data)); const wstring wdata(CStringToWstring(data));
if(int(wdata.size()) > NumFramesWide) if(int(wdata.size()) > NumFramesWide)
RageException::Throw("The font definition \"%s\" assigns %i characters to row %i (\"%ls\"), but the font only has %i characters wide", RageException::Throw("The font definition \"%s\" assigns %i characters to row %i (\"%ls\"), but the font only has %i characters wide",
ini.GetPath().GetString(), wdata.size(), row, wdata.c_str(), NumFramesWide); ini.GetPath().c_str(), wdata.size(), row, wdata.c_str(), NumFramesWide);
for(unsigned i = 0; i < wdata.size(); ++i) for(unsigned i = 0; i < wdata.size(); ++i)
cfg.CharToGlyphNo[wdata[i]] = first_frame+i; cfg.CharToGlyphNo[wdata[i]] = first_frame+i;
@@ -738,14 +738,14 @@ void Font::Load(const CString &sFontOrTextureFilePath, CString sChars)
{ {
CString str = join("\n", LoadStack); CString str = join("\n", LoadStack);
str += "\n" + sFontOrTextureFilePath; str += "\n" + sFontOrTextureFilePath;
RageException::Throw("Font import recursion detected\n%s", str.GetString()); RageException::Throw("Font import recursion detected\n%s", str.c_str());
} }
} }
LoadStack.push_back(sFontOrTextureFilePath); LoadStack.push_back(sFontOrTextureFilePath);
} }
/* The font is not already loaded. Figure out what we have. */ /* The font is not already loaded. Figure out what we have. */
Checkpoint( ssprintf("Font::Load(\"%s\",\"%s\").", sFontOrTextureFilePath.GetString(), Chars.GetString()) ); Checkpoint( ssprintf("Font::Load(\"%s\",\"%s\").", sFontOrTextureFilePath.c_str(), Chars.c_str()) );
path = sFontOrTextureFilePath; path = sFontOrTextureFilePath;
Chars = sChars; Chars = sChars;
@@ -815,12 +815,12 @@ void Font::Load(const CString &sFontOrTextureFilePath, CString sChars)
{ {
if(it->second < fp->m_pTexture->GetNumFrames()) continue; /* OK */ if(it->second < fp->m_pTexture->GetNumFrames()) continue; /* OK */
RageException::Throw( "The font '%s' maps %s to frame %i, but the font only has %i frames.", RageException::Throw( "The font '%s' maps %s to frame %i, but the font only has %i frames.",
TexturePaths[i].GetString(), WcharDisplayText(wchar_t(it->first)).GetString(), it->second, fp->m_pTexture->GetNumFrames() ); TexturePaths[i].c_str(), WcharDisplayText(wchar_t(it->first)).c_str(), it->second, fp->m_pTexture->GetNumFrames() );
} }
// LOG->Trace("Adding page %s (%s) to %s; %i glyphs", // LOG->Trace("Adding page %s (%s) to %s; %i glyphs",
// TexturePaths[i].GetString(), pagename.GetString(), // TexturePaths[i].c_str(), pagename.c_str(),
// sFontOrTextureFilePath.GetString(), fp->m_iCharToGlyphNo.size()); // sFontOrTextureFilePath.c_str(), fp->m_iCharToGlyphNo.size());
AddPage(fp); AddPage(fp);
/* If this is the first font loaded, or it's called "main", this page's /* If this is the first font loaded, or it's called "main", this page's
@@ -833,7 +833,7 @@ void Font::Load(const CString &sFontOrTextureFilePath, CString sChars)
CapsOnly(); CapsOnly();
if(m_iCharToGlyph.empty()) if(m_iCharToGlyph.empty())
LOG->Warn("Font %s has no characters", sFontOrTextureFilePath.GetString()); LOG->Warn("Font %s has no characters", sFontOrTextureFilePath.c_str());
LoadStack.pop_back(); LoadStack.pop_back();
} }
+4 -4
View File
@@ -31,7 +31,7 @@ FontManager::~FontManager()
i != m_mapPathToFont.end(); ++i) i != m_mapPathToFont.end(); ++i)
{ {
Font* pFont = i->second; Font* pFont = i->second;
LOG->Trace( "FONT LEAK: '%s', RefCount = %d.", i->first.GetString(), pFont->m_iRefCount ); LOG->Trace( "FONT LEAK: '%s', RefCount = %d.", i->first.c_str(), pFont->m_iRefCount );
delete pFont; delete pFont;
} }
} }
@@ -74,7 +74,7 @@ Font* FontManager::LoadFont( const CString &sFontOrTextureFilePath, CString sCha
map<CString, Font*>::iterator p = m_mapPathToFont.find(sFontOrTextureFilePath); map<CString, Font*>::iterator p = m_mapPathToFont.find(sFontOrTextureFilePath);
if(p != m_mapPathToFont.end()) { if(p != m_mapPathToFont.end()) {
Font *pFont=p->second; Font *pFont=p->second;
// LOG->Trace( ssprintf("FontManager: The Font '%s' now has %d references.", sFontOrTextureFilePath.GetString(), pFont->m_iRefCount) ); // LOG->Trace( ssprintf("FontManager: The Font '%s' now has %d references.", sFontOrTextureFilePath.c_str(), pFont->m_iRefCount) );
pFont->m_iRefCount++; pFont->m_iRefCount++;
return pFont; return pFont;
} }
@@ -90,7 +90,7 @@ Font* FontManager::LoadFont( const CString &sFontOrTextureFilePath, CString sCha
void FontManager::UnloadFont( Font *fp ) void FontManager::UnloadFont( Font *fp )
{ {
Checkpoint( ssprintf("FontManager::UnloadFont(%s).", fp->path.GetString()) ); Checkpoint( ssprintf("FontManager::UnloadFont(%s).", fp->path.c_str()) );
for( std::map<CString, Font*>::iterator i = m_mapPathToFont.begin(); for( std::map<CString, Font*>::iterator i = m_mapPathToFont.begin();
i != m_mapPathToFont.end(); ++i) i != m_mapPathToFont.end(); ++i)
@@ -104,7 +104,7 @@ void FontManager::UnloadFont( Font *fp )
delete i->second; // free the texture delete i->second; // free the texture
m_mapPathToFont.erase( i ); // and remove the key in the map m_mapPathToFont.erase( i ); // and remove the key in the map
} }
// LOG->Trace( "FontManager: '%s' will be deleted. It has %d references.", sFontFilePath.GetString(), pFont->m_iRefCount ); // LOG->Trace( "FontManager: '%s' will be deleted. It has %d references.", sFontFilePath.c_str(), pFont->m_iRefCount );
return; return;
} }
+1 -1
View File
@@ -1644,7 +1644,7 @@ NotesType GameManager::StringToNotesType( CString sNotesType )
return NotesType(i); return NotesType(i);
// invalid NotesType // invalid NotesType
LOG->Warn( "Invalid NotesType string '%s' encountered. Assuming this is 'dance-single'.", sNotesType.GetString() ); LOG->Warn( "Invalid NotesType string '%s' encountered. Assuming this is 'dance-single'.", sNotesType.c_str() );
return NOTES_TYPE_DANCE_SINGLE; return NOTES_TYPE_DANCE_SINGLE;
} }
+1 -1
View File
@@ -123,7 +123,7 @@ void InputMapper::SaveMappingsToDisk()
GameInput GameI( (GameController)i, (GameButton)j ); GameInput GameI( (GameController)i, (GameButton)j );
sNameString = GameI.toString(); sNameString = GameI.toString();
sValueString = ssprintf( "%s,%s,%s", sValueString = ssprintf( "%s,%s,%s",
m_GItoDI[i][j][0].toString().GetString(), m_GItoDI[i][j][1].toString().GetString(), m_GItoDI[i][j][2].toString().GetString() ); m_GItoDI[i][j][0].toString().c_str(), m_GItoDI[i][j][1].toString().c_str(), m_GItoDI[i][j][2].toString().c_str() );
ini.SetValue( GAMESTATE->GetCurrentGameDef()->m_szName, sNameString, sValueString ); ini.SetValue( GAMESTATE->GetCurrentGameDef()->m_szName, sNameString, sValueString );
} }
+12 -12
View File
@@ -109,7 +109,7 @@ CString NoteSkinManager::GetNoteSkinDir( CString sSkinName )
{ {
const GameDef* pGameDef = GAMESTATE->GetCurrentGameDef(); const GameDef* pGameDef = GAMESTATE->GetCurrentGameDef();
return NOTESKINS_DIR + ssprintf("%s/%s/", pGameDef->m_szName, sSkinName.GetString()); return NOTESKINS_DIR + ssprintf("%s/%s/", pGameDef->m_szName, sSkinName.c_str());
} }
CString NoteSkinManager::GetMetric( PlayerNumber pn, CString sButtonName, CString sValue ) // looks in GAMESTATE for the current Style CString NoteSkinManager::GetMetric( PlayerNumber pn, CString sButtonName, CString sValue ) // looks in GAMESTATE for the current Style
@@ -122,7 +122,7 @@ CString NoteSkinManager::GetMetric( PlayerNumber pn, CString sButtonName, CStrin
return sReturn; return sReturn;
if( !data.metrics.GetValue( "NoteDisplay", sValue, sReturn ) ) if( !data.metrics.GetValue( "NoteDisplay", sValue, sReturn ) )
RageException::Throw( "Could not read metric '%s - %s' or 'NoteDisplay - %s'", RageException::Throw( "Could not read metric '%s - %s' or 'NoteDisplay - %s'",
sButtonName.GetString(), sValue.GetString(), sValue.GetString() ); sButtonName.c_str(), sValue.c_str(), sValue.c_str() );
return sReturn; return sReturn;
} }
@@ -150,7 +150,7 @@ RageColor NoteSkinManager::GetMetricC( PlayerNumber pn, CString sButtonName, CSt
int result = sscanf( szValue, "%f,%f,%f,%f", &r, &g, &b, &a ); int result = sscanf( szValue, "%f,%f,%f,%f", &r, &g, &b, &a );
if( result != 4 ) if( result != 4 )
{ {
LOG->Warn( "The color value '%s' for theme metric '%s : %s' is invalid.", szValue, sButtonName.GetString(), sValueName.GetString() ); LOG->Warn( "The color value '%s' for theme metric '%s : %s' is invalid.", szValue, sButtonName.c_str(), sValueName.c_str() );
ASSERT(0); ASSERT(0);
} }
@@ -186,9 +186,9 @@ CString NoteSkinManager::GetPathTo( PlayerNumber pn, CString sButtonName, CStrin
if( ret.empty() ) if( ret.empty() )
RageException::Throw( "The NoteSkin element '%s %s' could not be found in '%s' or '%s'.", RageException::Throw( "The NoteSkin element '%s %s' could not be found in '%s' or '%s'.",
sButtonName.GetString(), sFileName.GetString(), sButtonName.c_str(), sFileName.c_str(),
GetNoteSkinDir(sNoteSkinName).GetString(), GetNoteSkinDir(sNoteSkinName).c_str(),
GetNoteSkinDir(BASE_NOTESKIN_NAME).GetString() ); GetNoteSkinDir(BASE_NOTESKIN_NAME).c_str() );
return ret; return ret;
} }
@@ -199,12 +199,12 @@ CString NoteSkinManager::GetPathTo( CString sSkinName, CString sButtonName, CStr
CStringArray arrayPossibleFileNames; // fill this with the possible files CStringArray arrayPossibleFileNames; // fill this with the possible files
GetDirListing( ssprintf("%s%s %s*.sprite", sDir.GetString(), sButtonName.GetString(), sElementName.GetString()), arrayPossibleFileNames, false, true ); GetDirListing( ssprintf("%s%s %s*.sprite", sDir.c_str(), sButtonName.c_str(), sElementName.c_str()), arrayPossibleFileNames, false, true );
GetDirListing( ssprintf("%s%s %s*.png", sDir.GetString(), sButtonName.GetString(), sElementName.GetString()), arrayPossibleFileNames, false, true ); GetDirListing( ssprintf("%s%s %s*.png", sDir.c_str(), sButtonName.c_str(), sElementName.c_str()), arrayPossibleFileNames, false, true );
GetDirListing( ssprintf("%s%s %s*.jpg", sDir.GetString(), sButtonName.GetString(), sElementName.GetString()), arrayPossibleFileNames, false, true ); GetDirListing( ssprintf("%s%s %s*.jpg", sDir.c_str(), sButtonName.c_str(), sElementName.c_str()), arrayPossibleFileNames, false, true );
GetDirListing( ssprintf("%s%s %s*.bmp", sDir.GetString(), sButtonName.GetString(), sElementName.GetString()), arrayPossibleFileNames, false, true ); GetDirListing( ssprintf("%s%s %s*.bmp", sDir.c_str(), sButtonName.c_str(), sElementName.c_str()), arrayPossibleFileNames, false, true );
GetDirListing( ssprintf("%s%s %s*.gif", sDir.GetString(), sButtonName.GetString(), sElementName.GetString()), arrayPossibleFileNames, false, true ); GetDirListing( ssprintf("%s%s %s*.gif", sDir.c_str(), sButtonName.c_str(), sElementName.c_str()), arrayPossibleFileNames, false, true );
GetDirListing( ssprintf("%s%s %s*", sDir.GetString(), sButtonName.GetString(), sElementName.GetString()), arrayPossibleFileNames, false, true ); GetDirListing( ssprintf("%s%s %s*", sDir.c_str(), sButtonName.c_str(), sElementName.c_str()), arrayPossibleFileNames, false, true );
if( arrayPossibleFileNames.empty() ) if( arrayPossibleFileNames.empty() )
return ""; return "";
+12 -12
View File
@@ -60,7 +60,7 @@ void BMSLoader::mapBMSTrackToDanceNote( int iBMSTrack, int &iDanceColOut, char &
bool BMSLoader::LoadFromBMSFile( const CString &sPath, Notes &out ) bool BMSLoader::LoadFromBMSFile( const CString &sPath, Notes &out )
{ {
LOG->Trace( "Notes::LoadFromBMSFile( '%s' )", sPath.GetString() ); LOG->Trace( "Notes::LoadFromBMSFile( '%s' )", sPath.c_str() );
out.m_NotesType = NOTES_TYPE_INVALID; out.m_NotesType = NOTES_TYPE_INVALID;
@@ -69,7 +69,7 @@ bool BMSLoader::LoadFromBMSFile( const CString &sPath, Notes &out )
ifstream file(sPath); ifstream file(sPath);
if( file.bad() ) if( file.bad() )
RageException::Throw( "Failed to open %s for reading.", sPath.GetString() ); RageException::Throw( "Failed to open %s for reading.", sPath.c_str() );
CString line; CString line;
while( getline(file, line) ) // foreach line while( getline(file, line) ) // foreach line
@@ -134,7 +134,7 @@ bool BMSLoader::LoadFromBMSFile( const CString &sPath, Notes &out )
if( iPosOpenBracket != -1 && iPosCloseBracket != -1 ) if( iPosOpenBracket != -1 && iPosCloseBracket != -1 )
value_data = value_data.substr( iPosOpenBracket+1, iPosCloseBracket-iPosOpenBracket-1 ); value_data = value_data.substr( iPosOpenBracket+1, iPosCloseBracket-iPosOpenBracket-1 );
LOG->Trace( "Notes description found to be '%s'", value_data.GetString() ); LOG->Trace( "Notes description found to be '%s'", value_data.c_str() );
out.SetDescription(value_data); out.SetDescription(value_data);
@@ -164,7 +164,7 @@ bool BMSLoader::LoadFromBMSFile( const CString &sPath, Notes &out )
const unsigned iNumNotesInThisMeasure = arrayNotes.size(); const unsigned iNumNotesInThisMeasure = arrayNotes.size();
//LOG->Trace( "%s:%s: iMeasureNo = %d, iNoteNum = %d, iNumNotesInThisMeasure = %d", //LOG->Trace( "%s:%s: iMeasureNo = %d, iNoteNum = %d, iNumNotesInThisMeasure = %d",
// valuename.GetString(), sNoteData.GetString(), iMeasureNo, iNoteNum, iNumNotesInThisMeasure ); // valuename.c_str(), sNoteData.c_str(), iMeasureNo, iNoteNum, iNumNotesInThisMeasure );
for( unsigned j=0; j<iNumNotesInThisMeasure; j++ ) for( unsigned j=0; j<iNumNotesInThisMeasure; j++ )
{ {
if( arrayNotes[j] ) if( arrayNotes[j] )
@@ -251,13 +251,13 @@ void BMSLoader::GetApplicableFiles( CString sPath, CStringArray &out )
bool BMSLoader::LoadFromDir( CString sDir, Song &out ) bool BMSLoader::LoadFromDir( CString sDir, Song &out )
{ {
LOG->Trace( "Song::LoadFromBMSDir(%s)", sDir.GetString() ); LOG->Trace( "Song::LoadFromBMSDir(%s)", sDir.c_str() );
CStringArray arrayBMSFileNames; CStringArray arrayBMSFileNames;
GetApplicableFiles( sDir, arrayBMSFileNames ); GetApplicableFiles( sDir, arrayBMSFileNames );
if( arrayBMSFileNames.empty() ) if( arrayBMSFileNames.empty() )
RageException::Throw( "Couldn't find any BMS files in '%s'", sDir.GetString() ); RageException::Throw( "Couldn't find any BMS files in '%s'", sDir.c_str() );
// load the Notes from the rest of the BMS files // load the Notes from the rest of the BMS files
unsigned i; unsigned i;
@@ -277,7 +277,7 @@ bool BMSLoader::LoadFromDir( CString sDir, Song &out )
ifstream file(sPath); ifstream file(sPath);
if( file.bad() ) if( file.bad() )
RageException::Throw( "Failed to open %s for reading.", sPath.GetString() ); RageException::Throw( "Failed to open %s for reading.", sPath.c_str() );
CString line; CString line;
while( getline(file, line) ) // foreach line while( getline(file, line) ) // foreach line
@@ -367,7 +367,7 @@ bool BMSLoader::LoadFromDir( CString sDir, Song &out )
const unsigned iNumNotesInThisMeasure = arrayNotes.size(); const unsigned iNumNotesInThisMeasure = arrayNotes.size();
//LOG->Trace( "%s:%s: iMeasureNo = %d, iBMSTrackNo = %d, iNumNotesInThisMeasure = %d", //LOG->Trace( "%s:%s: iMeasureNo = %d, iBMSTrackNo = %d, iNumNotesInThisMeasure = %d",
// valuename.GetString(), sNoteData.GetString(), iMeasureNo, iBMSTrackNo, iNumNotesInThisMeasure ); // valuename.c_str(), sNoteData.c_str(), iMeasureNo, iBMSTrackNo, iNumNotesInThisMeasure );
for( unsigned j=0; j<iNumNotesInThisMeasure; j++ ) for( unsigned j=0; j<iNumNotesInThisMeasure; j++ )
{ {
if( arrayNotes[j] == 0 ) if( arrayNotes[j] == 0 )
@@ -416,7 +416,7 @@ bool BMSLoader::LoadFromDir( CString sDir, Song &out )
// open the song file again and and look for this tag's value // open the song file again and and look for this tag's value
ifstream file(sPath); ifstream file(sPath);
if( file.bad() ) if( file.bad() )
RageException::Throw( "Failed to open %s for reading.", sPath.GetString() ); RageException::Throw( "Failed to open %s for reading.", sPath.c_str() );
CString line; CString line;
while( getline(file, line) ) // foreach line while( getline(file, line) ) // foreach line
@@ -456,7 +456,7 @@ bool BMSLoader::LoadFromDir( CString sDir, Song &out )
if( fBPM == -1 ) // we didn't find the line we were looking for if( fBPM == -1 ) // we didn't find the line we were looking for
{ {
LOG->Trace( "WARNING: Couldn't find tag '%s' in '%s'.", sTagToLookFor.GetString(), sPath.GetString() ); LOG->Trace( "WARNING: Couldn't find tag '%s' in '%s'.", sTagToLookFor.c_str(), sPath.c_str() );
} }
else else
{ {
@@ -478,7 +478,7 @@ bool BMSLoader::LoadFromDir( CString sDir, Song &out )
// open the song file again and and look for this tag's value // open the song file again and and look for this tag's value
ifstream file(sPath); ifstream file(sPath);
if( file.bad() ) if( file.bad() )
RageException::Throw( "Failed to open %s for reading.", sPath.GetString() ); RageException::Throw( "Failed to open %s for reading.", sPath.c_str() );
CString line; CString line;
while( getline(file, line) ) // foreach line while( getline(file, line) ) // foreach line
@@ -533,7 +533,7 @@ bool BMSLoader::LoadFromDir( CString sDir, Song &out )
if( fFreezeSecs == -1 ) // we didn't find the line we were looking for if( fFreezeSecs == -1 ) // we didn't find the line we were looking for
{ {
LOG->Trace( "WARNING: Couldn't find tag '%s' in '%s'.", sTagToLookFor.GetString(), sPath.GetString() ); LOG->Trace( "WARNING: Couldn't find tag '%s' in '%s'.", sTagToLookFor.c_str(), sPath.c_str() );
} }
else else
{ {
+7 -7
View File
@@ -260,9 +260,9 @@ float DWILoader::ParseBrokenDWITimestamp(const CString &arg1, const CString &arg
{ {
/* If the value contains a period, treat it as seconds; otherwise ms. */ /* If the value contains a period, treat it as seconds; otherwise ms. */
if(arg1.find_first_of(".") != arg1.npos) if(arg1.find_first_of(".") != arg1.npos)
return (float)atof(arg1.GetString()); return (float)atof(arg1.c_str());
else else
return float(atof(arg1.GetString())) / 1000.f; return float(atof(arg1.c_str())) / 1000.f;
} }
/* 2+ args */ /* 2+ args */
@@ -275,13 +275,13 @@ float DWILoader::ParseBrokenDWITimestamp(const CString &arg1, const CString &arg
bool DWILoader::LoadFromDWIFile( CString sPath, Song &out ) bool DWILoader::LoadFromDWIFile( CString sPath, Song &out )
{ {
LOG->Trace( "Song::LoadFromDWIFile(%s)", sPath.GetString() ); LOG->Trace( "Song::LoadFromDWIFile(%s)", sPath.c_str() );
MsdFile msd; MsdFile msd;
bool bResult = msd.ReadFile( sPath ); bool bResult = msd.ReadFile( sPath );
if( !bResult ) if( !bResult )
RageException::Throw( "Error opening file '%s' for reading.", sPath.GetString() ); RageException::Throw( "Error opening file '%s' for reading.", sPath.c_str() );
for( unsigned i=0; i<msd.GetNumValues(); i++ ) for( unsigned i=0; i<msd.GetNumValues(); i++ )
{ {
@@ -291,7 +291,7 @@ bool DWILoader::LoadFromDWIFile( CString sPath, Song &out )
if(iNumParams < 1) if(iNumParams < 1)
{ {
LOG->Warn("Got \"%s\" tag with no parameters", sValueName.GetString()); LOG->Warn("Got \"%s\" tag with no parameters", sValueName.c_str());
continue; continue;
} }
@@ -349,7 +349,7 @@ bool DWILoader::LoadFromDWIFile( CString sPath, Song &out )
CStringArray arrayBPMChangeValues; CStringArray arrayBPMChangeValues;
split( arrayBPMChangeExpressions[b], "=", arrayBPMChangeValues ); split( arrayBPMChangeExpressions[b], "=", arrayBPMChangeValues );
if(arrayBPMChangeValues.size() != 2) { if(arrayBPMChangeValues.size() != 2) {
LOG->Warn( "Invalid CHANGEBPM: '%s'", arrayBPMChangeExpressions[b].GetString()); LOG->Warn( "Invalid CHANGEBPM: '%s'", arrayBPMChangeExpressions[b].c_str());
continue; continue;
} }
float fIndex = (float)atof( arrayBPMChangeValues[0] ) * ROWS_PER_BEAT / 4.0f; float fIndex = (float)atof( arrayBPMChangeValues[0] ) * ROWS_PER_BEAT / 4.0f;
@@ -398,7 +398,7 @@ bool DWILoader::LoadFromDir( CString sPath, Song &out )
GetApplicableFiles( sPath, aFileNames ); GetApplicableFiles( sPath, aFileNames );
if( aFileNames.size() > 1 ) if( aFileNames.size() > 1 )
RageException::Throw( "There is more than one DWI file in '%s'. There should be only one!", sPath.GetString() ); RageException::Throw( "There is more than one DWI file in '%s'. There should be only one!", sPath.c_str() );
/* We should have exactly one; if we had none, we shouldn't have been /* We should have exactly one; if we had none, we shouldn't have been
* called to begin with. */ * called to begin with. */
+8 -8
View File
@@ -11,12 +11,12 @@
bool KSFLoader::LoadFromKSFFile( const CString &sPath, Notes &out ) bool KSFLoader::LoadFromKSFFile( const CString &sPath, Notes &out )
{ {
LOG->Trace( "Notes::LoadFromKSFFile( '%s' )", sPath.GetString() ); LOG->Trace( "Notes::LoadFromKSFFile( '%s' )", sPath.c_str() );
MsdFile msd; MsdFile msd;
bool bResult = msd.ReadFile( sPath ); bool bResult = msd.ReadFile( sPath );
if( !bResult ) if( !bResult )
RageException::Throw( "Error opening file '%s'.", sPath.GetString() ); RageException::Throw( "Error opening file '%s'.", sPath.c_str() );
int iTickCount = -1; // this is the value we read for TICKCOUNT int iTickCount = -1; // this is the value we read for TICKCOUNT
CString iStep; // this is the value we read for STEP CString iStep; // this is the value we read for STEP
@@ -39,7 +39,7 @@ bool KSFLoader::LoadFromKSFFile( const CString &sPath, Notes &out )
if( iTickCount == -1 ) if( iTickCount == -1 )
{ {
iTickCount = 2; iTickCount = 2;
LOG->Warn( "%s:\nTICKCOUNT not found; defaulting to %i", sPath.GetString(), iTickCount ); LOG->Warn( "%s:\nTICKCOUNT not found; defaulting to %i", sPath.c_str(), iTickCount );
} }
NoteData notedata; // read it into here NoteData notedata; // read it into here
@@ -105,7 +105,7 @@ bool KSFLoader::LoadFromKSFFile( const CString &sPath, Notes &out )
if(sRowString.size() != 13) if(sRowString.size() != 13)
{ {
LOG->Warn("File %s had a RowString with an improper length (\"%s\"); corrupt notes ignored", LOG->Warn("File %s had a RowString with an improper length (\"%s\"); corrupt notes ignored",
sPath.GetString(), sRowString.GetString()); sPath.c_str(), sRowString.c_str());
return false; return false;
} }
@@ -158,14 +158,14 @@ void KSFLoader::GetApplicableFiles( CString sPath, CStringArray &out )
bool KSFLoader::LoadFromDir( CString sDir, Song &out ) bool KSFLoader::LoadFromDir( CString sDir, Song &out )
{ {
LOG->Trace( "Song::LoadFromKSFDir(%s)", sDir.GetString() ); LOG->Trace( "Song::LoadFromKSFDir(%s)", sDir.c_str() );
CStringArray arrayKSFFileNames; CStringArray arrayKSFFileNames;
GetDirListing( sDir + CString("*.ksf"), arrayKSFFileNames ); GetDirListing( sDir + CString("*.ksf"), arrayKSFFileNames );
/* We shouldn't have been called to begin with if there were no KSFs. */ /* We shouldn't have been called to begin with if there were no KSFs. */
if( arrayKSFFileNames.empty() ) if( arrayKSFFileNames.empty() )
RageException::Throw( "Couldn't find any KSF files in '%s'", sDir.GetString() ); RageException::Throw( "Couldn't find any KSF files in '%s'", sDir.c_str() );
// load the Notes from the rest of the KSF files // load the Notes from the rest of the KSF files
unsigned i; unsigned i;
@@ -188,7 +188,7 @@ bool KSFLoader::LoadFromDir( CString sDir, Song &out )
MsdFile msd; MsdFile msd;
bool bResult = msd.ReadFile( sPath ); bool bResult = msd.ReadFile( sPath );
if( !bResult ) if( !bResult )
RageException::Throw( "Error opening file '%s'.", sPath.GetString() ); RageException::Throw( "Error opening file '%s'.", sPath.c_str() );
for( i=0; i < msd.GetNumValues(); i++ ) for( i=0; i < msd.GetNumValues(); i++ )
{ {
@@ -259,7 +259,7 @@ bool KSFLoader::LoadFromDir( CString sDir, Song &out )
0==stricmp(sValueName,"DIFFICULTY")) 0==stricmp(sValueName,"DIFFICULTY"))
; /* Handled in LoadFromKSFFile; don't warn. */ ; /* Handled in LoadFromKSFFile; don't warn. */
else else
LOG->Trace( "Unexpected value named '%s'", sValueName.GetString() ); LOG->Trace( "Unexpected value named '%s'", sValueName.c_str() );
} }
// search for music with song in the file name // search for music with song in the file name
+9 -9
View File
@@ -59,7 +59,7 @@ void SMLoader::GetApplicableFiles( CString sPath, CStringArray &out )
bool SMLoader::LoadFromSMFile( CString sPath, Song &out ) bool SMLoader::LoadFromSMFile( CString sPath, Song &out )
{ {
LOG->Trace( "Song::LoadFromSMDir(%s)", sPath.GetString() ); LOG->Trace( "Song::LoadFromSMDir(%s)", sPath.c_str() );
out.m_BPMSegments.clear(); out.m_BPMSegments.clear();
out.m_StopSegments.clear(); out.m_StopSegments.clear();
@@ -67,7 +67,7 @@ bool SMLoader::LoadFromSMFile( CString sPath, Song &out )
MsdFile msd; MsdFile msd;
bool bResult = msd.ReadFile( sPath ); bool bResult = msd.ReadFile( sPath );
if( !bResult ) if( !bResult )
RageException::Throw( "Error opening file '%s'.", sPath.GetString() ); RageException::Throw( "Error opening file '%s'.", sPath.c_str() );
for( unsigned i=0; i<msd.GetNumValues(); i++ ) for( unsigned i=0; i<msd.GetNumValues(); i++ )
{ {
@@ -159,7 +159,7 @@ bool SMLoader::LoadFromSMFile( CString sPath, Song &out )
else if(!stricmp(sParams[1],"ROULETTE")) else if(!stricmp(sParams[1],"ROULETTE"))
out.m_SelectionDisplay = out.SHOW_ROULETTE; out.m_SelectionDisplay = out.SHOW_ROULETTE;
else else
LOG->Warn( "The song file '%s' has an unknown #SELECTABLE value, '%s'; ignored.", sPath.GetString(), sParams[1].GetString()); LOG->Warn( "The song file '%s' has an unknown #SELECTABLE value, '%s'; ignored.", sPath.c_str(), sParams[1].c_str());
} }
else if( 0==stricmp(sValueName,"STOPS") || 0==stricmp(sValueName,"FREEZES") ) else if( 0==stricmp(sValueName,"STOPS") || 0==stricmp(sValueName,"FREEZES") )
@@ -176,7 +176,7 @@ bool SMLoader::LoadFromSMFile( CString sPath, Song &out )
if(arrayFreezeValues.size() != 2) if(arrayFreezeValues.size() != 2)
{ {
LOG->Warn("Invalid #%s value \"%s\" (must have exactly one '='), ignored", LOG->Warn("Invalid #%s value \"%s\" (must have exactly one '='), ignored",
sValueName.GetString(), arrayFreezeExpressions[f].GetString()); sValueName.c_str(), arrayFreezeExpressions[f].c_str());
continue; continue;
} }
@@ -207,7 +207,7 @@ bool SMLoader::LoadFromSMFile( CString sPath, Song &out )
if(arrayBPMChangeValues.size() != 2) if(arrayBPMChangeValues.size() != 2)
{ {
LOG->Warn("Invalid #%s value \"%s\" (must have exactly one '='), ignored", LOG->Warn("Invalid #%s value \"%s\" (must have exactly one '='), ignored",
sValueName.GetString(), arrayBPMChangeExpressions[b].GetString()); sValueName.c_str(), arrayBPMChangeExpressions[b].c_str());
continue; continue;
} }
float fBeat = (float)atof( arrayBPMChangeValues[0] ); float fBeat = (float)atof( arrayBPMChangeValues[0] );
@@ -249,7 +249,7 @@ bool SMLoader::LoadFromSMFile( CString sPath, Song &out )
break; break;
default: default:
LOG->Warn("Invalid #BGCHANGES%s value \"%s\" was ignored", LOG->Warn("Invalid #BGCHANGES%s value \"%s\" was ignored",
sValueName.GetString(), aBGChangeExpressions[b].GetString()); sValueName.c_str(), aBGChangeExpressions[b].c_str());
break; break;
} }
} }
@@ -263,7 +263,7 @@ bool SMLoader::LoadFromSMFile( CString sPath, Song &out )
if( iNumParams != 7 ) if( iNumParams != 7 )
{ {
LOG->Trace( "The song file '%s' is has %d fields in a #NOTES tag, but should have %d.", sPath.GetString(), iNumParams, 7 ); LOG->Trace( "The song file '%s' is has %d fields in a #NOTES tag, but should have %d.", sPath.c_str(), iNumParams, 7 );
continue; continue;
} }
@@ -272,7 +272,7 @@ bool SMLoader::LoadFromSMFile( CString sPath, Song &out )
*pNewNotes); *pNewNotes);
} }
else else
LOG->Trace( "Unexpected value named '%s'", sValueName.GetString() ); LOG->Trace( "Unexpected value named '%s'", sValueName.c_str() );
} }
return true; return true;
@@ -285,7 +285,7 @@ bool SMLoader::LoadFromDir( CString sPath, Song &out )
GetApplicableFiles( sPath, aFileNames ); GetApplicableFiles( sPath, aFileNames );
if( aFileNames.size() > 1 ) if( aFileNames.size() > 1 )
RageException::Throw( "There is more than one SM file in '%s'. There should be only one!", sPath.GetString() ); RageException::Throw( "There is more than one SM file in '%s'. There should be only one!", sPath.c_str() );
/* We should have exactly one; if we had none, we shouldn't have been /* We should have exactly one; if we had none, we shouldn't have been
* called to begin with. */ * called to begin with. */
+4 -4
View File
@@ -217,18 +217,18 @@ bool NotesWriterDWI::Write( CString sPath, const Song &out )
{ {
FILE* fp = fopen( sPath, "w" ); FILE* fp = fopen( sPath, "w" );
if( fp == NULL ) if( fp == NULL )
RageException::Throw( "Error opening song file '%s' for writing.", sPath.GetString() ); RageException::Throw( "Error opening song file '%s' for writing.", sPath.c_str() );
/* Write transliterations, if we have them, since DWI doesn't support UTF-8. */ /* Write transliterations, if we have them, since DWI doesn't support UTF-8. */
fprintf( fp, "#TITLE:%s;\n", out.GetTranslitMainTitle().GetString() ); fprintf( fp, "#TITLE:%s;\n", out.GetTranslitMainTitle().c_str() );
fprintf( fp, "#ARTIST:%s;\n", out.GetTranslitArtist().GetString() ); fprintf( fp, "#ARTIST:%s;\n", out.GetTranslitArtist().c_str() );
ASSERT( out.m_BPMSegments[0].m_fStartBeat == 0 ); ASSERT( out.m_BPMSegments[0].m_fStartBeat == 0 );
fprintf( fp, "#BPM:%.3f;\n", out.m_BPMSegments[0].m_fBPM ); fprintf( fp, "#BPM:%.3f;\n", out.m_BPMSegments[0].m_fBPM );
fprintf( fp, "#GAP:%d;\n", int(-roundf( out.m_fBeat0OffsetInSeconds*1000 )) ); fprintf( fp, "#GAP:%d;\n", int(-roundf( out.m_fBeat0OffsetInSeconds*1000 )) );
fprintf( fp, "#SAMPLESTART:%.3f;\n", out.m_fMusicSampleStartSeconds ); fprintf( fp, "#SAMPLESTART:%.3f;\n", out.m_fMusicSampleStartSeconds );
fprintf( fp, "#SAMPLELENGTH:%.3f;\n", out.m_fMusicSampleLengthSeconds ); fprintf( fp, "#SAMPLELENGTH:%.3f;\n", out.m_fMusicSampleLengthSeconds );
if( out.m_sCDTitleFile.size() ) if( out.m_sCDTitleFile.size() )
fprintf( fp, "#CDTITLE:%s;\n", out.m_sCDTitleFile.GetString() ); fprintf( fp, "#CDTITLE:%s;\n", out.m_sCDTitleFile.c_str() );
if( !out.m_StopSegments.empty() ) if( !out.m_StopSegments.empty() )
{ {
+20 -20
View File
@@ -7,18 +7,18 @@
void NotesWriterSM::WriteGlobalTags(FILE *fp, const Song &out) void NotesWriterSM::WriteGlobalTags(FILE *fp, const Song &out)
{ {
fprintf( fp, "#TITLE:%s;\n", out.m_sMainTitle.GetString() ); fprintf( fp, "#TITLE:%s;\n", out.m_sMainTitle.c_str() );
fprintf( fp, "#SUBTITLE:%s;\n", out.m_sSubTitle.GetString() ); fprintf( fp, "#SUBTITLE:%s;\n", out.m_sSubTitle.c_str() );
fprintf( fp, "#ARTIST:%s;\n", out.m_sArtist.GetString() ); fprintf( fp, "#ARTIST:%s;\n", out.m_sArtist.c_str() );
fprintf( fp, "#TITLETRANSLIT:%s;\n", out.m_sMainTitleTranslit.GetString() ); fprintf( fp, "#TITLETRANSLIT:%s;\n", out.m_sMainTitleTranslit.c_str() );
fprintf( fp, "#SUBTITLETRANSLIT:%s;\n", out.m_sSubTitleTranslit.GetString() ); fprintf( fp, "#SUBTITLETRANSLIT:%s;\n", out.m_sSubTitleTranslit.c_str() );
fprintf( fp, "#ARTISTTRANSLIT:%s;\n", out.m_sArtistTranslit.GetString() ); fprintf( fp, "#ARTISTTRANSLIT:%s;\n", out.m_sArtistTranslit.c_str() );
fprintf( fp, "#CREDIT:%s;\n", out.m_sCredit.GetString() ); fprintf( fp, "#CREDIT:%s;\n", out.m_sCredit.c_str() );
fprintf( fp, "#BANNER:%s;\n", out.m_sBannerFile.GetString() ); fprintf( fp, "#BANNER:%s;\n", out.m_sBannerFile.c_str() );
fprintf( fp, "#BACKGROUND:%s;\n", out.m_sBackgroundFile.GetString() ); fprintf( fp, "#BACKGROUND:%s;\n", out.m_sBackgroundFile.c_str() );
fprintf( fp, "#LYRICSPATH:%s;\n", out.m_sLyricsFile.GetString() ); fprintf( fp, "#LYRICSPATH:%s;\n", out.m_sLyricsFile.c_str() );
fprintf( fp, "#CDTITLE:%s;\n", out.m_sCDTitleFile.GetString() ); fprintf( fp, "#CDTITLE:%s;\n", out.m_sCDTitleFile.c_str() );
fprintf( fp, "#MUSIC:%s;\n", out.m_sMusicFile.GetString() ); fprintf( fp, "#MUSIC:%s;\n", out.m_sMusicFile.c_str() );
fprintf( fp, "#MUSICBYTES:%u;\n", out.m_iMusicBytes ); fprintf( fp, "#MUSICBYTES:%u;\n", out.m_iMusicBytes );
fprintf( fp, "#MUSICLENGTH:%.3f;\n", out.m_fMusicLengthSeconds ); fprintf( fp, "#MUSICLENGTH:%.3f;\n", out.m_fMusicLengthSeconds );
fprintf( fp, "#OFFSET:%.3f;\n", out.m_fBeat0OffsetInSeconds ); fprintf( fp, "#OFFSET:%.3f;\n", out.m_fBeat0OffsetInSeconds );
@@ -65,7 +65,7 @@ void NotesWriterSM::WriteGlobalTags(FILE *fp, const Song &out)
{ {
const BackgroundChange &seg = out.m_BackgroundChanges[i]; const BackgroundChange &seg = out.m_BackgroundChanges[i];
fprintf( fp, "%.3f=%s=%.3f=%d=%d=%d", seg.m_fStartBeat, seg.m_sBGName.GetString(), seg.m_fRate, seg.m_bFadeLast, seg.m_bRewindMovie, seg.m_bLoop ); fprintf( fp, "%.3f=%s=%.3f=%d=%d=%d", seg.m_fStartBeat, seg.m_sBGName.c_str(), seg.m_fRate, seg.m_bFadeLast, seg.m_bRewindMovie, seg.m_bLoop );
if( i != out.m_BackgroundChanges.size()-1 ) if( i != out.m_BackgroundChanges.size()-1 )
fprintf( fp, "," ); fprintf( fp, "," );
} }
@@ -76,19 +76,19 @@ void NotesWriterSM::WriteGlobalTags(FILE *fp, const Song &out)
void NotesWriterSM::WriteSMNotesTag( const Notes &in, FILE* fp ) void NotesWriterSM::WriteSMNotesTag( const Notes &in, FILE* fp )
{ {
fprintf( fp, "\n//---------------%s - %s----------------\n", fprintf( fp, "\n//---------------%s - %s----------------\n",
GameManager::NotesTypeToString(in.m_NotesType).GetString(), in.GetDescription().GetString() ); GameManager::NotesTypeToString(in.m_NotesType).c_str(), in.GetDescription().c_str() );
fprintf( fp, "#NOTES:\n" ); fprintf( fp, "#NOTES:\n" );
fprintf( fp, " %s:\n", GameManager::NotesTypeToString(in.m_NotesType).GetString() ); fprintf( fp, " %s:\n", GameManager::NotesTypeToString(in.m_NotesType).c_str() );
fprintf( fp, " %s:\n", in.GetDescription().GetString() ); fprintf( fp, " %s:\n", in.GetDescription().c_str() );
fprintf( fp, " %s:\n", DifficultyToString(in.GetDifficulty()).GetString() ); fprintf( fp, " %s:\n", DifficultyToString(in.GetDifficulty()).c_str() );
fprintf( fp, " %d:\n", in.GetMeter() ); fprintf( fp, " %d:\n", in.GetMeter() );
CStringArray asRadarValues; CStringArray asRadarValues;
for( int r=0; r < NUM_RADAR_CATEGORIES; r++ ) for( int r=0; r < NUM_RADAR_CATEGORIES; r++ )
asRadarValues.push_back( ssprintf("%.3f", in.GetRadarValues()[r]) ); asRadarValues.push_back( ssprintf("%.3f", in.GetRadarValues()[r]) );
fprintf( fp, " %s:\n", join(",",asRadarValues).GetString() ); fprintf( fp, " %s:\n", join(",",asRadarValues).c_str() );
fprintf( fp, "%s;\n", in.GetSMNoteData().GetString() ); fprintf( fp, "%s;\n", in.GetSMNoteData().c_str() );
} }
bool NotesWriterSM::Write(CString sPath, const Song &out, bool bSavingCache) bool NotesWriterSM::Write(CString sPath, const Song &out, bool bSavingCache)
@@ -98,7 +98,7 @@ bool NotesWriterSM::Write(CString sPath, const Song &out, bool bSavingCache)
FILE* fp = fopen( sPath, "w" ); FILE* fp = fopen( sPath, "w" );
if( fp == NULL ) if( fp == NULL )
{ {
LOG->Warn( "Error opening song file '%s' for writing.", sPath.GetString() ); LOG->Warn( "Error opening song file '%s' for writing.", sPath.c_str() );
return false; return false;
} }
+1 -1
View File
@@ -51,7 +51,7 @@ void PlayerAI::InitFromDisk()
{ {
CString sKey = ssprintf("Skill%d", i); CString sKey = ssprintf("Skill%d", i);
if( ini.GetKey(sKey)==NULL ) if( ini.GetKey(sKey)==NULL )
RageException::Throw( "AI.ini: '%s' doesn't exist.", sKey.GetString() ); RageException::Throw( "AI.ini: '%s' doesn't exist.", sKey.c_str() );
TapScoreDistribution& dist = g_Distributions[i]; TapScoreDistribution& dist = g_Distributions[i];
dist.fPercent[TNS_NONE] = 0; dist.fPercent[TNS_NONE] = 0;
+3 -3
View File
@@ -154,7 +154,7 @@ SDL_Surface *RageBitmapTexture::CreateImg(int &pixfmt)
/* XXX: Wait, we don't want to throw for all images; in particular, we /* XXX: Wait, we don't want to throw for all images; in particular, we
* want to tolerate corrupt/unknown background images. */ * want to tolerate corrupt/unknown background images. */
if(img == NULL) if(img == NULL)
RageException::Throw( "RageBitmapTexture: Couldn't load %s: %s", GetFilePath().GetString(), SDL_GetError() ); RageException::Throw( "RageBitmapTexture: Couldn't load %s: %s", GetFilePath().c_str(), SDL_GetError() );
if(m_ActualID.bHotPinkColorKey) if(m_ActualID.bHotPinkColorKey)
{ {
@@ -479,8 +479,8 @@ retry:
if(IsPackedPixelFormat(pixfmt)) props += "paletted "; if(IsPackedPixelFormat(pixfmt)) props += "paletted ";
props.erase(props.size()-1); props.erase(props.size()-1);
LOG->Trace( "RageBitmapTexture: Loaded '%s' (%ux%u); %s, source %d,%d; image %d,%d.", LOG->Trace( "RageBitmapTexture: Loaded '%s' (%ux%u); %s, source %d,%d; image %d,%d.",
m_ActualID.filename.GetString(), GetTextureWidth(), GetTextureHeight(), m_ActualID.filename.c_str(), GetTextureWidth(), GetTextureHeight(),
props.GetString(), m_iSourceWidth, m_iSourceHeight, props.c_str(), m_iSourceWidth, m_iSourceHeight,
m_iImageWidth, m_iImageHeight); m_iImageWidth, m_iImageHeight);
} }
+2 -2
View File
@@ -287,9 +287,9 @@ void RageDisplay::DumpOpenGLDebugInfo()
if(i == Actual && skip) if(i == Actual && skip)
{ {
/* We chose a bogus format. */ /* We chose a bogus format. */
LOG->Warn("%s", str.GetString()); LOG->Warn("%s", str.c_str());
} else } else
LOG->Info("%s", str.GetString()); LOG->Info("%s", str.c_str());
} }
#endif #endif
} }
+5 -5
View File
@@ -45,15 +45,15 @@ void RageException::Throw(const char *fmt, ...)
"Exception: %s\n" "Exception: %s\n"
"//////////////////////////////////////////////////////\n" "//////////////////////////////////////////////////////\n"
"", "",
error.GetString()); error.c_str());
if(LOG) if(LOG)
{ {
LOG->Trace("%s", msg.GetString()); LOG->Trace("%s", msg.c_str());
LOG->Flush(); LOG->Flush();
} }
else else
{ {
printf("%s\n", msg.GetString()); printf("%s\n", msg.c_str());
fflush(stdout); fflush(stdout);
} }
@@ -62,7 +62,7 @@ void RageException::Throw(const char *fmt, ...)
DebugBreak(); DebugBreak();
#endif #endif
throw RageException("%s", error.GetString()); throw RageException("%s", error.c_str());
} }
void RageException::ThrowNonfatal(const char *fmt, ...) void RageException::ThrowNonfatal(const char *fmt, ...)
@@ -72,7 +72,7 @@ void RageException::ThrowNonfatal(const char *fmt, ...)
if(LOG) if(LOG)
{ {
LOG->Trace("Nonfatal exception thrown: %s", vssprintf( fmt, va ).GetString()); LOG->Trace("Nonfatal exception thrown: %s", vssprintf( fmt, va ).c_str());
LOG->Flush(); LOG->Flush();
} }
+5 -5
View File
@@ -167,7 +167,7 @@ void RageLog::Warn( const char *fmt, ...)
CString sBuff = vssprintf( fmt, va ); CString sBuff = vssprintf( fmt, va );
va_end(va); va_end(va);
Write(WRITE_TO_INFO | WRITE_LOUD, ssprintf("WARNING: %s", sBuff.GetString())); Write(WRITE_TO_INFO | WRITE_LOUD, ssprintf("WARNING: %s", sBuff.c_str()));
} }
/* When */ /* When */
@@ -177,7 +177,7 @@ void RageLog::Write( int where, CString str)
str = SecondsToTime(RageTimer::GetTimeSinceStart()) + ": " + str; str = SecondsToTime(RageTimer::GetTimeSinceStart()) + ": " + str;
if( where&WRITE_TO_INFO && m_fileInfo ) if( where&WRITE_TO_INFO && m_fileInfo )
fprintf(m_fileInfo, "%s\n", str.GetString() ); fprintf(m_fileInfo, "%s\n", str.c_str() );
HOOKS->Log(str, where & WRITE_TO_INFO); HOOKS->Log(str, where & WRITE_TO_INFO);
@@ -190,13 +190,13 @@ void RageLog::Write( int where, CString str)
"/////////////////////////////////////////\n" "/////////////////////////////////////////\n"
"%s\n" "%s\n"
"/////////////////////////////////////////", "/////////////////////////////////////////",
str.GetString()); str.c_str());
} }
if( m_fileLog ) if( m_fileLog )
fprintf(m_fileLog, "%s\n", str.GetString() ); fprintf(m_fileLog, "%s\n", str.c_str() );
printf("%s\n", str.GetString() ); printf("%s\n", str.c_str() );
#ifdef DEBUG #ifdef DEBUG
Flush(); Flush();
+2 -2
View File
@@ -220,7 +220,7 @@ void RageMatrixCommand( CString sCommandString, RageMatrix &mat )
else if( sName=="rotationz" ) RageMatrixRotationZ( &b, fParam(1) ); else if( sName=="rotationz" ) RageMatrixRotationZ( &b, fParam(1) );
else else
{ {
CString sError = ssprintf( "Unrecognized matrix command name '%s' in command string '%s'.", sName.GetString(), sCommandString.GetString() ); CString sError = ssprintf( "Unrecognized matrix command name '%s' in command string '%s'.", sName.c_str(), sCommandString.c_str() );
LOG->Warn( sError ); LOG->Warn( sError );
#if defined(WIN32) // XXX arch? #if defined(WIN32) // XXX arch?
if( DISPLAY->IsWindowed() ) if( DISPLAY->IsWindowed() )
@@ -232,7 +232,7 @@ void RageMatrixCommand( CString sCommandString, RageMatrix &mat )
if( iMaxIndexAccessed != (int)asTokens.size()-1 ) if( iMaxIndexAccessed != (int)asTokens.size()-1 )
{ {
CString sError = ssprintf( "Wrong number of parameters in command '%s'. Expected %d but there are %d.", join(",",asTokens).GetString(), iMaxIndexAccessed+1, (int)asTokens.size() ); CString sError = ssprintf( "Wrong number of parameters in command '%s'. Expected %d but there are %d.", join(",",asTokens).c_str(), iMaxIndexAccessed+1, (int)asTokens.size() );
LOG->Warn( sError ); LOG->Warn( sError );
#if defined(WIN32) // XXX arch? #if defined(WIN32) // XXX arch?
if( DISPLAY->IsWindowed() ) if( DISPLAY->IsWindowed() )
+8 -8
View File
@@ -151,14 +151,14 @@ void RageSound::Fail(CString reason)
position = 0; position = 0;
LOG->Warn("Decoding %s failed: %s", LOG->Warn("Decoding %s failed: %s",
GetLoadedFilePath().GetString(), reason.GetString() ); GetLoadedFilePath().c_str(), reason.c_str() );
error = reason; error = reason;
} }
bool RageSound::Load(CString sSoundFilePath, int precache) bool RageSound::Load(CString sSoundFilePath, int precache)
{ {
LOG->Trace( "RageSound::LoadSound( '%s' )", sSoundFilePath.GetString() ); LOG->Trace( "RageSound::LoadSound( '%s' )", sSoundFilePath.c_str() );
if(precache == 2) if(precache == 2)
precache = false; precache = false;
@@ -172,9 +172,9 @@ bool RageSound::Load(CString sSoundFilePath, int precache)
position = 0; position = 0;
SoundReader_SDL_Sound *NewSample = new SoundReader_SDL_Sound; SoundReader_SDL_Sound *NewSample = new SoundReader_SDL_Sound;
if(!NewSample->Open(sSoundFilePath.GetString())) if(!NewSample->Open(sSoundFilePath.c_str()))
RageException::Throw( "RageSoundManager::RageSoundManager: error opening sound %s: %s", RageException::Throw( "RageSoundManager::RageSoundManager: error opening sound %s: %s",
sSoundFilePath.GetString(), NewSample->GetError().c_str()); sSoundFilePath.c_str(), NewSample->GetError().c_str());
Sample = NewSample; Sample = NewSample;
if(SOUNDMAN->GetDriverSampleRate() != -1 && if(SOUNDMAN->GetDriverSampleRate() != -1 &&
@@ -435,7 +435,7 @@ int RageSound::GetPCM(char *buffer, int size, int sampleno)
* over the remainder. If we keep doing this, we'll chew CPU rewinding, * over the remainder. If we keep doing this, we'll chew CPU rewinding,
* so stop. */ * so stop. */
LOG->Warn("Sound %s is busy looping. Sound stopped (start = %i, length = %i)", LOG->Warn("Sound %s is busy looping. Sound stopped (start = %i, length = %i)",
GetLoadedFilePath().GetString(), m_StartSample, m_LengthSamples); GetLoadedFilePath().c_str(), m_StartSample, m_LengthSamples);
return 0; return 0;
} }
@@ -449,7 +449,7 @@ int RageSound::GetPCM(char *buffer, int size, int sampleno)
if(GetData(NULL, size) == 0) if(GetData(NULL, size) == 0)
{ {
LOG->Warn("Can't loop data in %s; no data available at start point %i", LOG->Warn("Can't loop data in %s; no data available at start point %i",
GetLoadedFilePath().GetString(), m_StartSample); GetLoadedFilePath().c_str(), m_StartSample);
/* Stop here. */ /* Stop here. */
return bytes_stored; return bytes_stored;
@@ -553,7 +553,7 @@ float RageSound::GetLengthSeconds()
if(len < 0) if(len < 0)
{ {
LOG->Warn("GetLengthSeconds failed on %s: %s", LOG->Warn("GetLengthSeconds failed on %s: %s",
GetLoadedFilePath().GetString(), Sample->GetError().c_str() ); GetLoadedFilePath().c_str(), Sample->GetError().c_str() );
return -1; return -1;
} }
@@ -695,7 +695,7 @@ bool RageSound::SetPositionSamples( int samples )
* we passed EOF. This could be a truncated file or invalid data. Warn * we passed EOF. This could be a truncated file or invalid data. Warn
* about it and jump back to the beginning. */ * about it and jump back to the beginning. */
LOG->Warn("SetPositionSamples: %i ms is beyond EOF in %s", LOG->Warn("SetPositionSamples: %i ms is beyond EOF in %s",
ms, GetLoadedFilePath().GetString()); ms, GetLoadedFilePath().c_str());
position = 0; position = 0;
return false; /* failed (but recoverable) */ return false; /* failed (but recoverable) */
+1 -1
View File
@@ -258,7 +258,7 @@ void RageSoundManager::MixAudio(Sint16 *dst, const Sint16 *src, Uint32 len, floa
void RageSoundManager::PlayMusic(CString file, bool loop, float start_sec, float length_sec, float fade_len) void RageSoundManager::PlayMusic(CString file, bool loop, float start_sec, float length_sec, float fade_len)
{ {
// LOG->Trace("play '%s' (current '%s')", file.GetString(), music->GetLoadedFilePath().GetString()); // LOG->Trace("play '%s' (current '%s')", file.c_str(), music->GetLoadedFilePath().c_str());
if(music->IsPlaying()) if(music->IsPlaying())
{ {
if( music->GetLoadedFilePath() == file ) if( music->GetLoadedFilePath() == file )
+1 -1
View File
@@ -42,7 +42,7 @@ bool SoundReader_SDL_Sound::Open(CString filename_)
sound_desired.format = AUDIO_S16SYS; sound_desired.format = AUDIO_S16SYS;
sound_desired.rate = 0; sound_desired.rate = 0;
Sample = Sound_NewSampleFromFile(filename.GetString(), Sample = Sound_NewSampleFromFile(filename.c_str(),
&sound_desired, read_block_size); &sound_desired, read_block_size);
if(Sample) if(Sample)
return true; return true;
+3 -3
View File
@@ -38,7 +38,7 @@ RageTextureManager::~RageTextureManager()
{ {
RageTexture* pTexture = i->second; RageTexture* pTexture = i->second;
if( pTexture->m_iRefCount ) if( pTexture->m_iRefCount )
LOG->Trace( "TEXTUREMAN LEAK: '%s', RefCount = %d.", i->first.filename.GetString(), pTexture->m_iRefCount ); LOG->Trace( "TEXTUREMAN LEAK: '%s', RefCount = %d.", i->first.filename.c_str(), pTexture->m_iRefCount );
SAFE_DELETE( pTexture ); SAFE_DELETE( pTexture );
} }
} }
@@ -58,7 +58,7 @@ void RageTextureManager::Update( float fDeltaTime )
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
RageTexture* RageTextureManager::LoadTexture( RageTextureID ID ) RageTexture* RageTextureManager::LoadTexture( RageTextureID ID )
{ {
Checkpoint( ssprintf( "RageTextureManager::LoadTexture(%s).", ID.filename.GetString() ) ); Checkpoint( ssprintf( "RageTextureManager::LoadTexture(%s).", ID.filename.c_str() ) );
/* We could have two copies of the same bitmap if there are equivalent but /* We could have two copies of the same bitmap if there are equivalent but
* different paths, e.g. "Bitmaps\me.bmp" and "..\Rage PC Edition\Bitmaps\me.bmp". */ * different paths, e.g. "Bitmaps\me.bmp" and "..\Rage PC Edition\Bitmaps\me.bmp". */
@@ -127,7 +127,7 @@ void RageTextureManager::UnloadTexture( RageTexture *t )
void RageTextureManager::DeleteTexture( RageTexture *t ) void RageTextureManager::DeleteTexture( RageTexture *t )
{ {
ASSERT( t->m_iRefCount==0 ); ASSERT( t->m_iRefCount==0 );
LOG->Trace( "RageTextureManager: deleting '%s'.", t->GetID().filename.GetString() ); LOG->Trace( "RageTextureManager: deleting '%s'.", t->GetID().filename.c_str() );
m_mapPathToTexture.erase( t->GetID() ); // remove map entry m_mapPathToTexture.erase( t->GetID() ); // remove map entry
SAFE_DELETE( t ); // free the texture SAFE_DELETE( t ); // free the texture
} }
+2 -2
View File
@@ -496,7 +496,7 @@ static const unsigned int crc32_tab[] = {
bool DoStat(CString sPath, struct stat *st) bool DoStat(CString sPath, struct stat *st)
{ {
TrimRight(sPath, "/\\"); TrimRight(sPath, "/\\");
return stat(sPath.GetString(), st) != -1; return stat(sPath.c_str(), st) != -1;
} }
unsigned int GetHashForFile( CString sPath ) unsigned int GetHashForFile( CString sPath )
@@ -1148,7 +1148,7 @@ bool FilenameDB::ResolvePath(CString &path)
if(lst.size() > 1) if(lst.size() > 1)
LOG->Warn("Ambiguous filenames \"%s\" and \"%s\"", LOG->Warn("Ambiguous filenames \"%s\" and \"%s\"",
lst[0].GetString(), lst[1].GetString()); lst[0].c_str(), lst[1].c_str());
ret += lst[0]; ret += lst[0];
} }
+6 -6
View File
@@ -496,12 +496,12 @@ void ScreenEdit::UpdateTextInfo()
CString sText; CString sText;
sText += ssprintf( "Current Beat:\n %.2f\n", GAMESTATE->m_fSongBeat ); sText += ssprintf( "Current Beat:\n %.2f\n", GAMESTATE->m_fSongBeat );
sText += ssprintf( "Snap to:\n %s\n", sNoteType.GetString() ); sText += ssprintf( "Snap to:\n %s\n", sNoteType.c_str() );
sText += ssprintf( "Selection begin:\n %s\n", m_NoteFieldEdit.m_fBeginMarker==-1 ? "not set" : ssprintf("%.2f",m_NoteFieldEdit.m_fBeginMarker).GetString() ); sText += ssprintf( "Selection begin:\n %s\n", m_NoteFieldEdit.m_fBeginMarker==-1 ? "not set" : ssprintf("%.2f",m_NoteFieldEdit.m_fBeginMarker).c_str() );
sText += ssprintf( "Selection end:\n %s\n", m_NoteFieldEdit.m_fEndMarker==-1 ? "not set" : ssprintf("%.2f",m_NoteFieldEdit.m_fEndMarker).GetString() ); sText += ssprintf( "Selection end:\n %s\n", m_NoteFieldEdit.m_fEndMarker==-1 ? "not set" : ssprintf("%.2f",m_NoteFieldEdit.m_fEndMarker).c_str() );
sText += ssprintf( "Difficulty:\n %s\n", DifficultyToString( m_pNotes->GetDifficulty() ).GetString() ); sText += ssprintf( "Difficulty:\n %s\n", DifficultyToString( m_pNotes->GetDifficulty() ).c_str() );
sText += ssprintf( "Description:\n %s\n", GAMESTATE->m_pCurNotes[PLAYER_1] ? GAMESTATE->m_pCurNotes[PLAYER_1]->GetDescription().GetString() : "no description" ); sText += ssprintf( "Description:\n %s\n", GAMESTATE->m_pCurNotes[PLAYER_1] ? GAMESTATE->m_pCurNotes[PLAYER_1]->GetDescription().c_str() : "no description" );
sText += ssprintf( "Main title:\n %s\n", m_pSong->m_sMainTitle.GetString() ); sText += ssprintf( "Main title:\n %s\n", m_pSong->m_sMainTitle.c_str() );
sText += ssprintf( "Tap Notes:\n %d\n", iNumTapNotes ); sText += ssprintf( "Tap Notes:\n %d\n", iNumTapNotes );
sText += ssprintf( "Hold Notes:\n %d\n", iNumHoldNotes ); sText += ssprintf( "Hold Notes:\n %d\n", iNumHoldNotes );
sText += ssprintf( "Beat 0 Offset:\n %.2f secs\n", m_pSong->m_fBeat0OffsetInSeconds ); sText += ssprintf( "Beat 0 Offset:\n %.2f secs\n", m_pSong->m_fBeat0OffsetInSeconds );
+1 -1
View File
@@ -1249,7 +1249,7 @@ void ShowSavePrompt( ScreenMessage SM_SendWhenDone )
"Would you like to save these changes back\n" "Would you like to save these changes back\n"
"to the song file?\n" "to the song file?\n"
"Choosing NO will discard your changes.", "Choosing NO will discard your changes.",
GAMESTATE->m_pCurSong->GetFullDisplayTitle().GetString() ); GAMESTATE->m_pCurSong->GetFullDisplayTitle().c_str() );
break; break;
case PLAY_MODE_NONSTOP: case PLAY_MODE_NONSTOP:
case PLAY_MODE_ONI: case PLAY_MODE_ONI:
+2 -2
View File
@@ -224,7 +224,7 @@ void ScreenSystemLayer::UpdateTimestampAndSkips()
RageColor(1,0.2f,0.2f,1) /* light red */ RageColor(1,0.2f,0.2f,1) /* light red */
}; };
m_Skips[m_LastSkip].SetText(ssprintf("%s: %.0fms (%.0f)", m_Skips[m_LastSkip].SetText(ssprintf("%s: %.0fms (%.0f)",
time.GetString(), 1000*UpdateTime, UpdateTime/ExpectedUpdate)); time.c_str(), 1000*UpdateTime, UpdateTime/ExpectedUpdate));
m_Skips[m_LastSkip].StopTweening(); m_Skips[m_LastSkip].StopTweening();
m_Skips[m_LastSkip].SetDiffuse(RageColor(1,1,1,1)); m_Skips[m_LastSkip].SetDiffuse(RageColor(1,1,1,1));
m_Skips[m_LastSkip].BeginTweening(0.2f); m_Skips[m_LastSkip].BeginTweening(0.2f);
@@ -440,7 +440,7 @@ void ScreenManager::SetNewScreen( CString sClassName )
// deletes it later on. This also convention will reduce includes because screens won't // deletes it later on. This also convention will reduce includes because screens won't
// have to include each other's headers of other screens. // have to include each other's headers of other screens.
Screen* pNewScreen = MakeNewScreen(sClassName); Screen* pNewScreen = MakeNewScreen(sClassName);
LOG->Trace( "Loaded %s in %f", sClassName.GetString(), t.GetDeltaTime()); LOG->Trace( "Loaded %s in %f", sClassName.c_str(), t.GetDeltaTime());
if( pOldTopScreen!=NULL && m_ScreenStack.back()!=pOldTopScreen ) if( pOldTopScreen!=NULL && m_ScreenStack.back()!=pOldTopScreen )
{ {
+3 -3
View File
@@ -131,7 +131,7 @@ ScreenSelectMode::ScreenSelectMode() : Screen("ScreenSelectMode")
for( unsigned i=0; i<m_apPossibleModeChoices.size(); i++ ) for( unsigned i=0; i<m_apPossibleModeChoices.size(); i++ )
{ {
CString sChoiceName = m_apPossibleModeChoices[i]->name; CString sChoiceName = m_apPossibleModeChoices[i]->name;
m_Infotext[i].Load( THEME->GetPathToG(ssprintf("ScreenSelectMode infotext %s %s", sGameName.GetString(), sChoiceName.GetString())) ); m_Infotext[i].Load( THEME->GetPathToG(ssprintf("ScreenSelectMode infotext %s %s", sGameName.c_str(), sChoiceName.c_str())) );
m_Infotext[i].SetXY( GUIDE_X, GUIDE_Y ); m_Infotext[i].SetXY( GUIDE_X, GUIDE_Y );
this->AddChild( &m_Infotext[i] ); this->AddChild( &m_Infotext[i] );
m_Infotext[i].SetDiffuse( RageColor(0,0,0,0)); m_Infotext[i].SetDiffuse( RageColor(0,0,0,0));
@@ -256,7 +256,7 @@ void ScreenSelectMode::RefreshModeChoices()
for( unsigned j=0; j<m_apPossibleModeChoices.size(); j++ ) for( unsigned j=0; j<m_apPossibleModeChoices.size(); j++ )
{ {
const ModeChoice* pChoice = m_apPossibleModeChoices[j]; const ModeChoice* pChoice = m_apPossibleModeChoices[j];
asGraphicPaths.push_back( THEME->GetPathToG( ssprintf("select mode choice %s %s", sGameName.GetString(), pChoice->name) ) ); asGraphicPaths.push_back( THEME->GetPathToG( ssprintf("select mode choice %s %s", sGameName.c_str(), pChoice->name) ) );
} }
m_ScrollingList.Load( asGraphicPaths ); m_ScrollingList.Load( asGraphicPaths );
@@ -269,7 +269,7 @@ void ScreenSelectMode::RefreshModeChoices()
for( unsigned i=0; i<m_apPossibleModeChoices.size(); i++ ) for( unsigned i=0; i<m_apPossibleModeChoices.size(); i++ )
{ {
CString sChoiceName = m_apPossibleModeChoices[i]->name; CString sChoiceName = m_apPossibleModeChoices[i]->name;
m_BGAnimations[i].LoadFromAniDir( THEME->GetPathToB(ssprintf("select mode %s %s", sGameName.GetString(), sChoiceName.GetString())) ); m_BGAnimations[i].LoadFromAniDir( THEME->GetPathToB(ssprintf("select mode %s %s", sGameName.c_str(), sChoiceName.c_str())) );
} }
} }
} }
+1 -1
View File
@@ -40,7 +40,7 @@ ScreenStyleSplash::ScreenStyleSplash() : Screen("ScreenStyleSplash")
CString sStyleName = GAMESTATE->GetCurrentStyleDef()->m_szName; CString sStyleName = GAMESTATE->GetCurrentStyleDef()->m_szName;
int iDifficulty = GAMESTATE->m_PreferredDifficulty[0]; int iDifficulty = GAMESTATE->m_PreferredDifficulty[0];
m_Background.LoadFromAniDir( THEME->GetPathToB(ssprintf("ScreenStyleSplash-%s-%s-%d",sGameName.GetString(),sStyleName.GetString(),iDifficulty) ) ); m_Background.LoadFromAniDir( THEME->GetPathToB(ssprintf("ScreenStyleSplash-%s-%s-%d",sGameName.c_str(),sStyleName.c_str(),iDifficulty) ) );
this->AddChild( &m_Background ); this->AddChild( &m_Background );
m_Menu.Load( "ScreenStyleSplash" ); m_Menu.Load( "ScreenStyleSplash" );
+2 -2
View File
@@ -90,14 +90,14 @@ void ScreenTestSound::UpdateText(int n)
"%s\n" "%s\n"
"(%s)\n" "(%s)\n"
"%s", "%s",
n+1, fn.GetString(), n+1, fn.c_str(),
s[n].s.IsPlaying()? "Playing":"Stopped", s[n].s.IsPlaying()? "Playing":"Stopped",
s[n].s.GetStopMode() == RageSound::M_STOP? s[n].s.GetStopMode() == RageSound::M_STOP?
"Stop when finished": "Stop when finished":
s[n].s.GetStopMode() == RageSound::M_CONTINUE? s[n].s.GetStopMode() == RageSound::M_CONTINUE?
"Continue until stopped": "Continue until stopped":
"Loop", "Loop",
pos.size()? pos.GetString(): "none playing", pos.size()? pos.c_str(): "none playing",
selected == n? "^^^^^^":"" selected == n? "^^^^^^":""
)); ));
} }
+8 -8
View File
@@ -109,7 +109,7 @@ void SongManager::SanityCheckGroupDir( CString sDir ) const
"This means that you have a music outside of a song folder.\n" "This means that you have a music outside of a song folder.\n"
"All song folders must reside in a group folder. For example, 'Songs/DDR 4th Mix/B4U'.\n" "All song folders must reside in a group folder. For example, 'Songs/DDR 4th Mix/B4U'.\n"
"See the StepMania readme for more info.", "See the StepMania readme for more info.",
sDir.GetString() sDir.c_str()
); );
} }
@@ -134,7 +134,7 @@ void SongManager::AddGroup( CString sDir, CString sGroupDirName )
if( !arrayGroupBanners.empty() ) if( !arrayGroupBanners.empty() )
{ {
sBannerPath = sDir+sGroupDirName+"/"+arrayGroupBanners[0] ; sBannerPath = sDir+sGroupDirName+"/"+arrayGroupBanners[0] ;
LOG->Trace( "Group banner for '%s' is '%s'.", sGroupDirName.GetString(), sBannerPath.GetString() ); LOG->Trace( "Group banner for '%s' is '%s'.", sGroupDirName.c_str(), sBannerPath.c_str() );
} }
m_arrayGroupNames.push_back( sGroupDirName ); m_arrayGroupNames.push_back( sGroupDirName );
@@ -179,8 +179,8 @@ void SongManager::LoadStepManiaSongDir( CString sDir, LoadingWindow *ld )
// this is a song directory. Load a new song! // this is a song directory. Load a new song!
if( ld ) { if( ld ) {
ld->SetText( ssprintf("Loading songs...\n%s\n%s", ld->SetText( ssprintf("Loading songs...\n%s\n%s",
Basename(sGroupDirName).GetString(), Basename(sGroupDirName).c_str(),
Basename(sSongDirName).GetString())); Basename(sSongDirName).c_str()));
ld->Paint(); ld->Paint();
} }
Song* pNewSong = new Song; Song* pNewSong = new Song;
@@ -311,7 +311,7 @@ void SongManager::InitMachineScoresFromDisk()
getline(f, line); getline(f, line);
int version; int version;
sscanf(line.GetString(), "%i", &version); sscanf(line.c_str(), "%i", &version);
if( version == NOTES_SCORES_VERSION ) if( version == NOTES_SCORES_VERSION )
{ {
@@ -322,7 +322,7 @@ void SongManager::InitMachineScoresFromDisk()
getline(f, line); getline(f, line);
unsigned uNumNotes; unsigned uNumNotes;
sscanf(line.GetString(), "%u", &uNumNotes); sscanf(line.c_str(), "%u", &uNumNotes);
Song* pSong = this->GetSongFromDir( sSongDir ); Song* pSong = this->GetSongFromDir( sSongDir );
@@ -332,7 +332,7 @@ void SongManager::InitMachineScoresFromDisk()
Difficulty dc; Difficulty dc;
getline(f, line); getline(f, line);
sscanf(line.GetString(), "%d %d", &nt, &dc); sscanf(line.c_str(), "%d %d", &nt, &dc);
CString sDescription; CString sDescription;
getline(f, sDescription); getline(f, sDescription);
@@ -350,7 +350,7 @@ void SongManager::InitMachineScoresFromDisk()
if( pNotes ) if( pNotes )
{ {
sscanf(line.GetString(), "%d %d %f\n", sscanf(line.c_str(), "%d %d %f\n",
&pNotes->m_MemCardScores[c].iNumTimesPlayed, &pNotes->m_MemCardScores[c].iNumTimesPlayed,
&pNotes->m_MemCardScores[c].grade, &pNotes->m_MemCardScores[c].grade,
&pNotes->m_MemCardScores[c].fScore); &pNotes->m_MemCardScores[c].fScore);
+5 -5
View File
@@ -74,7 +74,7 @@ bool Sprite::Load( RageTextureID ID )
// BaseZoomZ=1 // BaseZoomZ=1
bool Sprite::LoadFromSpriteFile( RageTextureID ID ) bool Sprite::LoadFromSpriteFile( RageTextureID ID )
{ {
LOG->Trace( ssprintf("Sprite::LoadFromSpriteFile(%s)", ID.filename.GetString()) ); LOG->Trace( ssprintf("Sprite::LoadFromSpriteFile(%s)", ID.filename.c_str()) );
//Init(); //Init();
@@ -90,17 +90,17 @@ bool Sprite::LoadFromSpriteFile( RageTextureID ID )
IniFile ini; IniFile ini;
ini.SetPath( m_sSpritePath ); ini.SetPath( m_sSpritePath );
if( !ini.ReadFile() ) if( !ini.ReadFile() )
RageException::Throw( "Error opening Sprite file '%s'.", m_sSpritePath.GetString() ); RageException::Throw( "Error opening Sprite file '%s'.", m_sSpritePath.c_str() );
CString sTextureFile; CString sTextureFile;
ini.GetValue( "Sprite", "Texture", sTextureFile ); ini.GetValue( "Sprite", "Texture", sTextureFile );
if( sTextureFile == "" ) if( sTextureFile == "" )
RageException::Throw( "Error reading value 'Texture' from %s.", m_sSpritePath.GetString() ); RageException::Throw( "Error reading value 'Texture' from %s.", m_sSpritePath.c_str() );
ID.filename = sFontDir + sTextureFile; // save the path of the real texture ID.filename = sFontDir + sTextureFile; // save the path of the real texture
if( !DoesFileExist(ID.filename) ) if( !DoesFileExist(ID.filename) )
RageException::Throw( "The sprite file '%s' points to a texture '%s' which doesn't exist.", m_sSpritePath.GetString(), ID.filename.GetString() ); RageException::Throw( "The sprite file '%s' points to a texture '%s' which doesn't exist.", m_sSpritePath.c_str(), ID.filename.c_str() );
// Load the texture // Load the texture
LoadFromTexture( ID ); LoadFromTexture( ID );
@@ -117,7 +117,7 @@ bool Sprite::LoadFromSpriteFile( RageTextureID ID )
break; break;
if( m_iStateToFrame[i] >= m_pTexture->GetNumFrames() ) if( m_iStateToFrame[i] >= 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.",
m_sSpritePath.GetString(), sFrameKey.GetString(), m_iStateToFrame[i], ID.filename.GetString(), m_pTexture->GetNumFrames() ); m_sSpritePath.c_str(), sFrameKey.c_str(), m_iStateToFrame[i], ID.filename.c_str(), m_pTexture->GetNumFrames() );
m_fDelay[i] = 0.2f; m_fDelay[i] = 0.2f;
if( !ini.GetValueF( "Sprite", sDelayKey, m_fDelay[i] ) ) if( !ini.GetValueF( "Sprite", sDelayKey, m_fDelay[i] ) )
break; break;
+19 -19
View File
@@ -159,7 +159,7 @@ try_element_again:
CString message = ssprintf( CString message = ssprintf(
"There is more than one theme element element that matches " "There is more than one theme element element that matches "
"'%s/%s/%s'. Please remove all but one of these matches.", "'%s/%s/%s'. Please remove all but one of these matches.",
sThemeName.GetString(), sCategory.GetString(), sFileName.GetString() ); sThemeName.c_str(), sCategory.c_str(), sFileName.c_str() );
#if defined(WIN32) // XXX arch? #if defined(WIN32) // XXX arch?
if( DISPLAY->IsWindowed() ) if( DISPLAY->IsWindowed() )
@@ -208,14 +208,14 @@ try_element_again:
CString message = ssprintf( CString message = ssprintf(
"The redirect '%s' points to the file '%s', which does not exist. " "The redirect '%s' points to the file '%s', which does not exist. "
"Verify that this redirect is correct.", "Verify that this redirect is correct.",
sPath.GetString(), sNewFileName.GetString()); sPath.c_str(), sNewFileName.c_str());
#if defined(WIN32) // XXX arch? #if defined(WIN32) // XXX arch?
if( DISPLAY->IsWindowed() ) if( DISPLAY->IsWindowed() )
if( MessageBox(NULL, message, "ThemeManager", MB_RETRYCANCEL ) == IDRETRY) if( MessageBox(NULL, message, "ThemeManager", MB_RETRYCANCEL ) == IDRETRY)
goto try_element_again; goto try_element_again;
#endif #endif
RageException::Throw( "%s", message.GetString() ); RageException::Throw( "%s", message.c_str() );
} }
} }
} }
@@ -239,7 +239,7 @@ try_element_again:
CString sCategory = ELEMENT_CATEGORY_STRING[category]; CString sCategory = ELEMENT_CATEGORY_STRING[category];
#if defined(DEBUG) && defined(WIN32) #if defined(DEBUG) && defined(WIN32)
CString sMessage = ssprintf("The theme element '%s/%s' is missing.",sCategory.GetString(),sFileName.GetString()); CString sMessage = ssprintf("The theme element '%s/%s' is missing.",sCategory.c_str(),sFileName.c_str());
switch( MessageBox(NULL, sMessage, "ThemeManager", MB_RETRYCANCEL ) ) switch( MessageBox(NULL, sMessage, "ThemeManager", MB_RETRYCANCEL ) )
{ {
case IDRETRY: case IDRETRY:
@@ -247,24 +247,24 @@ try_element_again:
goto try_element_again; goto try_element_again;
case IDCANCEL: case IDCANCEL:
RageException::Throw( "Theme element '%s/%s' could not be found in '%s' or '%s'.", RageException::Throw( "Theme element '%s/%s' could not be found in '%s' or '%s'.",
sCategory.GetString(), sCategory.c_str(),
sFileName.GetString(), sFileName.c_str(),
GetThemeDirFromName(m_sCurThemeName).GetString(), GetThemeDirFromName(m_sCurThemeName).c_str(),
GetThemeDirFromName(BASE_THEME_NAME).GetString() ); GetThemeDirFromName(BASE_THEME_NAME).c_str() );
break; break;
} }
#endif #endif
LOG->Warn( LOG->Warn(
"Theme element '%s/%s' could not be found in '%s' or '%s'.", "Theme element '%s/%s' could not be found in '%s' or '%s'.",
sCategory.GetString(), sCategory.c_str(),
sFileName.GetString(), sFileName.c_str(),
GetThemeDirFromName(m_sCurThemeName).GetString(), GetThemeDirFromName(m_sCurThemeName).c_str(),
GetThemeDirFromName(BASE_THEME_NAME).GetString() ); GetThemeDirFromName(BASE_THEME_NAME).c_str() );
/* Err? */ /* Err? */
if(sFileName == "_missing") if(sFileName == "_missing")
RageException::Throw("_missing element missing from %s/%s", GetThemeDirFromName(BASE_THEME_NAME).GetString(), sCategory.GetString() ); RageException::Throw("_missing element missing from %s/%s", GetThemeDirFromName(BASE_THEME_NAME).c_str(), sCategory.c_str() );
return GetPathTo( category, "_missing" ); return GetPathTo( category, "_missing" );
} }
@@ -310,15 +310,15 @@ try_metric_again:
return sValue; return sValue;
#if defined(DEBUG) && defined(WIN32) #if defined(DEBUG) && defined(WIN32)
if( IDRETRY == MessageBox(NULL,ssprintf("The theme metric '%s-%s' is missing. Correct this and click Retry, or Cancel to break.",sClassName.GetString(),sValueName.GetString()),"ThemeManager",MB_RETRYCANCEL ) ) if( IDRETRY == MessageBox(NULL,ssprintf("The theme metric '%s-%s' is missing. Correct this and click Retry, or Cancel to break.",sClassName.c_str(),sValueName.c_str()),"ThemeManager",MB_RETRYCANCEL ) )
goto try_metric_again; goto try_metric_again;
#endif #endif
RageException::Throw( "Theme metric '%s : %s' could not be found in '%s' or '%s'.", RageException::Throw( "Theme metric '%s : %s' could not be found in '%s' or '%s'.",
sClassName.GetString(), sClassName.c_str(),
sValueName.GetString(), sValueName.c_str(),
sCurMetricPath.GetString(), sCurMetricPath.c_str(),
sDefaultMetricPath.GetString() sDefaultMetricPath.c_str()
); );
} }
@@ -359,7 +359,7 @@ RageColor ThemeManager::GetMetricC( CString sClassName, CString sValueName )
int result = sscanf( GetMetricRaw(sClassName,sValueName), "%f,%f,%f,%f", &r, &g, &b, &a ); int result = sscanf( GetMetricRaw(sClassName,sValueName), "%f,%f,%f,%f", &r, &g, &b, &a );
if( result != 4 ) if( result != 4 )
{ {
LOG->Warn( "The color value '%s' for NoteSkin metric '%s : %s' is invalid.", GetMetricRaw(sClassName,sValueName).GetString(), sClassName.GetString(), sValueName.GetString() ); LOG->Warn( "The color value '%s' for NoteSkin metric '%s : %s' is invalid.", GetMetricRaw(sClassName,sValueName).c_str(), sClassName.c_str(), sValueName.c_str() );
} }
return RageColor(r,g,b,a); return RageColor(r,g,b,a);