From fe33dec3854f0755678a4136d02b727fe9683b6e Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 25 Apr 2003 00:01:35 +0000 Subject: [PATCH] Partial s/GetString/c_str/. (watch out for PlayerOptions::GetString and SongOptions::GetString) --- stepmania/src/Actor.cpp | 4 +- stepmania/src/AnnouncerManager.cpp | 2 +- stepmania/src/BitmapText.cpp | 4 +- stepmania/src/CodeDetector.cpp | 4 +- stepmania/src/Course.cpp | 24 +++++------ stepmania/src/Font.cpp | 46 ++++++++++----------- stepmania/src/FontManager.cpp | 8 ++-- stepmania/src/GameManager.cpp | 2 +- stepmania/src/InputMapper.cpp | 2 +- stepmania/src/NoteSkinManager.cpp | 24 +++++------ stepmania/src/NotesLoaderBMS.cpp | 24 +++++------ stepmania/src/NotesLoaderDWI.cpp | 14 +++---- stepmania/src/NotesLoaderKSF.cpp | 16 +++---- stepmania/src/NotesLoaderSM.cpp | 18 ++++---- stepmania/src/NotesWriterDWI.cpp | 8 ++-- stepmania/src/NotesWriterSM.cpp | 40 +++++++++--------- stepmania/src/PlayerAI.cpp | 2 +- stepmania/src/RageBitmapTexture.cpp | 6 +-- stepmania/src/RageDisplay.cpp | 4 +- stepmania/src/RageException.cpp | 10 ++--- stepmania/src/RageLog.cpp | 10 ++--- stepmania/src/RageMath.cpp | 4 +- stepmania/src/RageSound.cpp | 16 +++---- stepmania/src/RageSoundManager.cpp | 2 +- stepmania/src/RageSoundReader_SDL_Sound.cpp | 2 +- stepmania/src/RageTextureManager.cpp | 6 +-- stepmania/src/RageUtil.cpp | 4 +- stepmania/src/ScreenEdit.cpp | 12 +++--- stepmania/src/ScreenGameplay.cpp | 2 +- stepmania/src/ScreenManager.cpp | 4 +- stepmania/src/ScreenSelectMode.cpp | 6 +-- stepmania/src/ScreenStyleSplash.cpp | 2 +- stepmania/src/ScreenTestSound.cpp | 4 +- stepmania/src/SongManager.cpp | 16 +++---- stepmania/src/Sprite.cpp | 10 ++--- stepmania/src/ThemeManager.cpp | 38 ++++++++--------- 36 files changed, 200 insertions(+), 200 deletions(-) diff --git a/stepmania/src/Actor.cpp b/stepmania/src/Actor.cpp index db79060430..bae5579290 100644 --- a/stepmania/src/Actor.cpp +++ b/stepmania/src/Actor.cpp @@ -722,7 +722,7 @@ void Actor::Command( CString sCommandString ) else if( sName=="additiveblend" ) EnableAdditiveBlend( bParam(1) ); 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 ); #if defined(WIN32) // XXX arch? if( DISPLAY->IsWindowed() ) @@ -733,7 +733,7 @@ void Actor::Command( CString sCommandString ) 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 ); #if defined(WIN32) // XXX arch? if( DISPLAY->IsWindowed() ) diff --git a/stepmania/src/AnnouncerManager.cpp b/stepmania/src/AnnouncerManager.cpp index 7c7e8f3b06..4e490f3f66 100644 --- a/stepmania/src/AnnouncerManager.cpp +++ b/stepmania/src/AnnouncerManager.cpp @@ -133,7 +133,7 @@ CString AnnouncerManager::GetPathTo( CString sAnnouncerName, CString sFolderName * its preferred name. */ #ifdef DEBUG LOG->Trace( "The announcer in \"%s\" is missing the folder '%s'.", - AnnouncerPath.GetString(), sFolderName.GetString() ); + AnnouncerPath.c_str(), sFolderName.c_str() ); // MessageBeep( MB_OK ); CreateDirectories( AnnouncerPath+sFolderName ); #endif diff --git a/stepmania/src/BitmapText.cpp b/stepmania/src/BitmapText.cpp index 9cd7cf0d84..58a3dea587 100644 --- a/stepmania/src/BitmapText.cpp +++ b/stepmania/src/BitmapText.cpp @@ -87,7 +87,7 @@ BitmapText::~BitmapText() bool BitmapText::LoadFromFont( CString sFontFilePath ) { - Checkpoint( ssprintf("BitmapText::LoadFromFontName(%s)", sFontFilePath.GetString()) ); + Checkpoint( ssprintf("BitmapText::LoadFromFontName(%s)", sFontFilePath.c_str()) ); if( m_pFont ) { FONT->UnloadFont( m_pFont ); @@ -105,7 +105,7 @@ bool BitmapText::LoadFromFont( CString sFontFilePath ) 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 ) { FONT->UnloadFont( m_pFont ); diff --git a/stepmania/src/CodeDetector.cpp b/stepmania/src/CodeDetector.cpp index 8174f0de46..3193f4e543 100644 --- a/stepmania/src/CodeDetector.cpp +++ b/stepmania/src/CodeDetector.cpp @@ -76,7 +76,7 @@ void RefreshCacheItem( int iIndex ) 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; return; } @@ -99,7 +99,7 @@ void RefreshCacheItem( int iIndex ) } 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; return; } diff --git a/stepmania/src/Course.cpp b/stepmania/src/Course.cpp index 826dec49d4..199caab5e0 100644 --- a/stepmania/src/Course.cpp +++ b/stepmania/src/Course.cpp @@ -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", - m_sPath.GetString(), sGroup.GetString(), sGroup.size()? "/":"", sSong.GetString()); + m_sPath.c_str(), sGroup.c_str(), sGroup.size()? "/":"", sSong.c_str()); return NULL; } @@ -109,7 +109,7 @@ void Course::LoadFromCRSFile( CString sPath ) MsdFile msd; 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; splitrelpath( sPath, sDir, sFName, sExt ); @@ -179,12 +179,12 @@ void Course::LoadFromCRSFile( CString sPath ) else LOG->Warn( "Course file '%s' contains a random_within_group entry '%s' that is invalid. " "Song should be in the format '/*'.", - m_sPath.GetString(), sSong.GetString()); + m_sPath.c_str(), sSong.c_str()); if( !SONGMAN->DoesGroupExist(new_entry.group_name) ) { LOG->Warn( "Course file '%s' random_within_group entry '%s' specifies a group that doesn't exist. " "This entry will be ignored.", - m_sPath.GetString(), sSong.GetString()); + m_sPath.c_str(), sSong.c_str()); 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. " "Song should be in the format '/'.", - m_sPath.GetString(), sSong.GetString()); + m_sPath.c_str(), sSong.c_str()); continue; // skip this #SONG } if( !new_entry.pSong ) { LOG->Warn( "Course file '%s' contains a fixed song entry '%s' that does not exist. " "This entry will be ignored.", - m_sPath.GetString(), sSong.GetString()); + m_sPath.c_str(), sSong.c_str()); continue; // skip this #SONG } } @@ -233,7 +233,7 @@ void Course::LoadFromCRSFile( CString sPath ) } else - LOG->Trace( "Unexpected value named '%s'", sValueName.GetString() ); + LOG->Trace( "Unexpected value named '%s'", sValueName.c_str() ); } static TitleSubst tsub("courses"); @@ -250,11 +250,11 @@ void Course::Save() FILE* fp = fopen( m_sPath, "w" ); 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; } - 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, "#LIVES:%i;\n", m_iLives ); fprintf( fp, "#EXTRA:%i;\n", m_iExtra ); @@ -266,13 +266,13 @@ void Course::Save() switch( entry.type ) { case Entry::fixed: - fprintf( fp, "#SONG:%s", entry.pSong->GetSongDir().GetString() ); + fprintf( fp, "#SONG:%s", entry.pSong->GetSongDir().c_str() ); break; case Entry::random: fprintf( fp, "#SONG:*" ); break; case Entry::random_within_group: - fprintf( fp, "#SONG:%s/*", entry.group_name.GetString() ); + fprintf( fp, "#SONG:%s/*", entry.group_name.c_str() ); break; case Entry::best: fprintf( fp, "#SONG:BEST%d", entry.players_index+1 ); @@ -285,7 +285,7 @@ void Course::Save() } 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 ) fprintf( fp, ":%d..%d", entry.low_meter, entry.high_meter ); diff --git a/stepmania/src/Font.cpp b/stepmania/src/Font.cpp index c65373e4a0..efe85c862d 100644 --- a/stepmania/src/Font.cpp +++ b/stepmania/src/Font.cpp @@ -105,7 +105,7 @@ void FontPage::Load( FontPageSettings cfg ) SetExtraPixels(cfg.DrawExtraPixelsLeft, cfg.DrawExtraPixelsRight); // 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 &widths) @@ -216,7 +216,7 @@ int Font::GetLineHeightInSourcePixels( const wstring &szLine ) const Font::Font() { - //LOG->Trace( "Font::LoadFromFontName(%s)", sASCIITexturePath.GetString() ); + //LOG->Trace( "Font::LoadFromFontName(%s)", sASCIITexturePath.c_str() ); m_iRefCount = 1; 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()) - 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; } @@ -305,7 +305,7 @@ bool Font::FontCompleteForString( const wstring &str ) const { map::const_iterator def = m_iCharToGlyph.find(DEFAULT_GLYPH); 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) { @@ -367,7 +367,7 @@ CString Font::GetFontName(CString FileName) TrimRight(FileName); 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(); return FileName; @@ -426,7 +426,7 @@ void Font::GetFontPaths(const CString &sFontOrTextureFilePath, if(!Files[i].Right(4).CompareNoCase(".ini")) { 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]; continue; @@ -464,7 +464,7 @@ void Font::LoadFontPageSettings(FontPageSettings &cfg, IniFile &ini, const CStri ini.RenameKey("Char Widths", "main"); // 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, "DrawExtraPixelsRight", cfg.DrawExtraPixelsRight ); @@ -522,7 +522,7 @@ void Font::LoadFontPageSettings(FontPageSettings &cfg, IniFile &ini, const CStri if(game == GAME_INVALID) { LOG->Warn( "Font definition '%s' uses unknown game type '%s'", - ini.GetPath().GetString(), gamename.GetString() ); + ini.GetPath().c_str(), gamename.c_str() ); continue; } } @@ -536,12 +536,12 @@ void Font::LoadFontPageSettings(FontPageSettings &cfg, IniFile &ini, const CStri c = utf8_get_char(codepoint.c_str()); if(c == wchar_t(-1)) 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)) { LOG->Warn("Font definition '%s' has an invalid value '%s'.", - ini.GetPath().GetString(), val.GetString() ); + ini.GetPath().c_str(), val.c_str() ); continue; } @@ -581,7 +581,7 @@ void Font::LoadFontPageSettings(FontPageSettings &cfg, IniFile &ini, const CStri if(!match || matches[0].empty()) 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). */ @@ -589,12 +589,12 @@ void Font::LoadFontPageSettings(FontPageSettings &cfg, IniFile &ini, const CStri int first = 0; if(!matches[2].empty()) { - sscanf(matches[2].GetString(), "%x", &first); + sscanf(matches[2].c_str(), "%x", &first); int last; - sscanf(matches[3].GetString(), "%x", &last); + sscanf(matches[3].c_str(), "%x", &last); if(last < first) 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; } @@ -602,7 +602,7 @@ void Font::LoadFontPageSettings(FontPageSettings &cfg, IniFile &ini, const CStri CString ret = cfg.MapRange(matches[0], first, atoi(data), cnt); if(!ret.empty()) 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; } @@ -622,14 +622,14 @@ void Font::LoadFontPageSettings(FontPageSettings &cfg, IniFile &ini, const CStri if(row > NumFramesHigh) 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. */ const wstring wdata(CStringToWstring(data)); 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", - 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) cfg.CharToGlyphNo[wdata[i]] = first_frame+i; @@ -738,14 +738,14 @@ void Font::Load(const CString &sFontOrTextureFilePath, CString sChars) { CString str = join("\n", LoadStack); 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); } /* 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; Chars = sChars; @@ -815,12 +815,12 @@ void Font::Load(const CString &sFontOrTextureFilePath, CString sChars) { 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.", - 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", -// TexturePaths[i].GetString(), pagename.GetString(), -// sFontOrTextureFilePath.GetString(), fp->m_iCharToGlyphNo.size()); +// TexturePaths[i].c_str(), pagename.c_str(), +// sFontOrTextureFilePath.c_str(), fp->m_iCharToGlyphNo.size()); AddPage(fp); /* 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(); 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(); } diff --git a/stepmania/src/FontManager.cpp b/stepmania/src/FontManager.cpp index 5ffd2d7e04..45e88c9f21 100644 --- a/stepmania/src/FontManager.cpp +++ b/stepmania/src/FontManager.cpp @@ -31,7 +31,7 @@ FontManager::~FontManager() i != m_mapPathToFont.end(); ++i) { 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; } } @@ -74,7 +74,7 @@ Font* FontManager::LoadFont( const CString &sFontOrTextureFilePath, CString sCha map::iterator p = m_mapPathToFont.find(sFontOrTextureFilePath); if(p != m_mapPathToFont.end()) { 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++; return pFont; } @@ -90,7 +90,7 @@ Font* FontManager::LoadFont( const CString &sFontOrTextureFilePath, CString sCha 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::iterator i = m_mapPathToFont.begin(); i != m_mapPathToFont.end(); ++i) @@ -104,7 +104,7 @@ void FontManager::UnloadFont( Font *fp ) delete i->second; // free the texture 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; } diff --git a/stepmania/src/GameManager.cpp b/stepmania/src/GameManager.cpp index f396b8a186..0a2632cd0e 100644 --- a/stepmania/src/GameManager.cpp +++ b/stepmania/src/GameManager.cpp @@ -1644,7 +1644,7 @@ NotesType GameManager::StringToNotesType( CString sNotesType ) return NotesType(i); // 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; } diff --git a/stepmania/src/InputMapper.cpp b/stepmania/src/InputMapper.cpp index 2c45ca16bd..93f6de92d7 100644 --- a/stepmania/src/InputMapper.cpp +++ b/stepmania/src/InputMapper.cpp @@ -123,7 +123,7 @@ void InputMapper::SaveMappingsToDisk() GameInput GameI( (GameController)i, (GameButton)j ); sNameString = GameI.toString(); 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 ); } diff --git a/stepmania/src/NoteSkinManager.cpp b/stepmania/src/NoteSkinManager.cpp index 89354188ca..e816573a18 100644 --- a/stepmania/src/NoteSkinManager.cpp +++ b/stepmania/src/NoteSkinManager.cpp @@ -109,7 +109,7 @@ CString NoteSkinManager::GetNoteSkinDir( CString sSkinName ) { 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 @@ -122,7 +122,7 @@ CString NoteSkinManager::GetMetric( PlayerNumber pn, CString sButtonName, CStrin return sReturn; if( !data.metrics.GetValue( "NoteDisplay", sValue, sReturn ) ) 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; } @@ -150,7 +150,7 @@ RageColor NoteSkinManager::GetMetricC( PlayerNumber pn, CString sButtonName, CSt int result = sscanf( szValue, "%f,%f,%f,%f", &r, &g, &b, &a ); 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); } @@ -186,9 +186,9 @@ CString NoteSkinManager::GetPathTo( PlayerNumber pn, CString sButtonName, CStrin if( ret.empty() ) RageException::Throw( "The NoteSkin element '%s %s' could not be found in '%s' or '%s'.", - sButtonName.GetString(), sFileName.GetString(), - GetNoteSkinDir(sNoteSkinName).GetString(), - GetNoteSkinDir(BASE_NOTESKIN_NAME).GetString() ); + sButtonName.c_str(), sFileName.c_str(), + GetNoteSkinDir(sNoteSkinName).c_str(), + GetNoteSkinDir(BASE_NOTESKIN_NAME).c_str() ); return ret; } @@ -199,12 +199,12 @@ CString NoteSkinManager::GetPathTo( CString sSkinName, CString sButtonName, CStr 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*.png", sDir.GetString(), sButtonName.GetString(), sElementName.GetString()), arrayPossibleFileNames, false, true ); - GetDirListing( ssprintf("%s%s %s*.jpg", sDir.GetString(), sButtonName.GetString(), sElementName.GetString()), arrayPossibleFileNames, false, true ); - GetDirListing( ssprintf("%s%s %s*.bmp", sDir.GetString(), sButtonName.GetString(), sElementName.GetString()), arrayPossibleFileNames, false, true ); - GetDirListing( ssprintf("%s%s %s*.gif", sDir.GetString(), sButtonName.GetString(), sElementName.GetString()), arrayPossibleFileNames, false, true ); - GetDirListing( ssprintf("%s%s %s*", 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.c_str(), sButtonName.c_str(), sElementName.c_str()), 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.c_str(), sButtonName.c_str(), sElementName.c_str()), 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.c_str(), sButtonName.c_str(), sElementName.c_str()), arrayPossibleFileNames, false, true ); if( arrayPossibleFileNames.empty() ) return ""; diff --git a/stepmania/src/NotesLoaderBMS.cpp b/stepmania/src/NotesLoaderBMS.cpp index 0fd206296c..a17d4b5276 100644 --- a/stepmania/src/NotesLoaderBMS.cpp +++ b/stepmania/src/NotesLoaderBMS.cpp @@ -60,7 +60,7 @@ void BMSLoader::mapBMSTrackToDanceNote( int iBMSTrack, int &iDanceColOut, char & 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; @@ -69,7 +69,7 @@ bool BMSLoader::LoadFromBMSFile( const CString &sPath, Notes &out ) ifstream file(sPath); 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; while( getline(file, line) ) // foreach line @@ -134,7 +134,7 @@ bool BMSLoader::LoadFromBMSFile( const CString &sPath, Notes &out ) if( iPosOpenBracket != -1 && iPosCloseBracket != -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); @@ -164,7 +164,7 @@ bool BMSLoader::LoadFromBMSFile( const CString &sPath, Notes &out ) const unsigned iNumNotesInThisMeasure = arrayNotes.size(); //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; jTrace( "Song::LoadFromBMSDir(%s)", sDir.GetString() ); + LOG->Trace( "Song::LoadFromBMSDir(%s)", sDir.c_str() ); CStringArray arrayBMSFileNames; GetApplicableFiles( sDir, arrayBMSFileNames ); 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 unsigned i; @@ -277,7 +277,7 @@ bool BMSLoader::LoadFromDir( CString sDir, Song &out ) ifstream file(sPath); 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; while( getline(file, line) ) // foreach line @@ -367,7 +367,7 @@ bool BMSLoader::LoadFromDir( CString sDir, Song &out ) const unsigned iNumNotesInThisMeasure = arrayNotes.size(); //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; jTrace( "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 { @@ -478,7 +478,7 @@ bool BMSLoader::LoadFromDir( CString sDir, Song &out ) // open the song file again and and look for this tag's value ifstream file(sPath); if( file.bad() ) - RageException::Throw( "Failed to open %s for reading.", sPath.GetString() ); + RageException::Throw( "Failed to open %s for reading.", sPath.c_str() ); CString 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 { - 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 { diff --git a/stepmania/src/NotesLoaderDWI.cpp b/stepmania/src/NotesLoaderDWI.cpp index 8b6e7f33de..cabdf20d0d 100644 --- a/stepmania/src/NotesLoaderDWI.cpp +++ b/stepmania/src/NotesLoaderDWI.cpp @@ -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(arg1.find_first_of(".") != arg1.npos) - return (float)atof(arg1.GetString()); + return (float)atof(arg1.c_str()); else - return float(atof(arg1.GetString())) / 1000.f; + return float(atof(arg1.c_str())) / 1000.f; } /* 2+ args */ @@ -275,13 +275,13 @@ float DWILoader::ParseBrokenDWITimestamp(const CString &arg1, const CString &arg bool DWILoader::LoadFromDWIFile( CString sPath, Song &out ) { - LOG->Trace( "Song::LoadFromDWIFile(%s)", sPath.GetString() ); + LOG->Trace( "Song::LoadFromDWIFile(%s)", sPath.c_str() ); MsdFile msd; bool bResult = msd.ReadFile( sPath ); 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; iWarn("Got \"%s\" tag with no parameters", sValueName.GetString()); + LOG->Warn("Got \"%s\" tag with no parameters", sValueName.c_str()); continue; } @@ -349,7 +349,7 @@ bool DWILoader::LoadFromDWIFile( CString sPath, Song &out ) CStringArray arrayBPMChangeValues; split( arrayBPMChangeExpressions[b], "=", arrayBPMChangeValues ); if(arrayBPMChangeValues.size() != 2) { - LOG->Warn( "Invalid CHANGEBPM: '%s'", arrayBPMChangeExpressions[b].GetString()); + LOG->Warn( "Invalid CHANGEBPM: '%s'", arrayBPMChangeExpressions[b].c_str()); continue; } 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 ); 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 * called to begin with. */ diff --git a/stepmania/src/NotesLoaderKSF.cpp b/stepmania/src/NotesLoaderKSF.cpp index 95b34e6e91..642a3bd586 100644 --- a/stepmania/src/NotesLoaderKSF.cpp +++ b/stepmania/src/NotesLoaderKSF.cpp @@ -11,12 +11,12 @@ 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; bool bResult = msd.ReadFile( sPath ); 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 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 ) { 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 @@ -105,7 +105,7 @@ bool KSFLoader::LoadFromKSFFile( const CString &sPath, Notes &out ) if(sRowString.size() != 13) { 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; } @@ -158,14 +158,14 @@ void KSFLoader::GetApplicableFiles( CString sPath, CStringArray &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; GetDirListing( sDir + CString("*.ksf"), arrayKSFFileNames ); /* We shouldn't have been called to begin with if there were no KSFs. */ 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 unsigned i; @@ -188,7 +188,7 @@ bool KSFLoader::LoadFromDir( CString sDir, Song &out ) MsdFile msd; bool bResult = msd.ReadFile( sPath ); 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++ ) { @@ -259,7 +259,7 @@ bool KSFLoader::LoadFromDir( CString sDir, Song &out ) 0==stricmp(sValueName,"DIFFICULTY")) ; /* Handled in LoadFromKSFFile; don't warn. */ 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 diff --git a/stepmania/src/NotesLoaderSM.cpp b/stepmania/src/NotesLoaderSM.cpp index d6157974bc..547e01c2fc 100644 --- a/stepmania/src/NotesLoaderSM.cpp +++ b/stepmania/src/NotesLoaderSM.cpp @@ -59,7 +59,7 @@ void SMLoader::GetApplicableFiles( CString sPath, CStringArray &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_StopSegments.clear(); @@ -67,7 +67,7 @@ bool SMLoader::LoadFromSMFile( CString sPath, Song &out ) MsdFile msd; bool bResult = msd.ReadFile( sPath ); if( !bResult ) - RageException::Throw( "Error opening file '%s'.", sPath.GetString() ); + RageException::Throw( "Error opening file '%s'.", sPath.c_str() ); for( unsigned i=0; iWarn( "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") ) @@ -176,7 +176,7 @@ bool SMLoader::LoadFromSMFile( CString sPath, Song &out ) if(arrayFreezeValues.size() != 2) { LOG->Warn("Invalid #%s value \"%s\" (must have exactly one '='), ignored", - sValueName.GetString(), arrayFreezeExpressions[f].GetString()); + sValueName.c_str(), arrayFreezeExpressions[f].c_str()); continue; } @@ -207,7 +207,7 @@ bool SMLoader::LoadFromSMFile( CString sPath, Song &out ) if(arrayBPMChangeValues.size() != 2) { LOG->Warn("Invalid #%s value \"%s\" (must have exactly one '='), ignored", - sValueName.GetString(), arrayBPMChangeExpressions[b].GetString()); + sValueName.c_str(), arrayBPMChangeExpressions[b].c_str()); continue; } float fBeat = (float)atof( arrayBPMChangeValues[0] ); @@ -249,7 +249,7 @@ bool SMLoader::LoadFromSMFile( CString sPath, Song &out ) break; default: LOG->Warn("Invalid #BGCHANGES%s value \"%s\" was ignored", - sValueName.GetString(), aBGChangeExpressions[b].GetString()); + sValueName.c_str(), aBGChangeExpressions[b].c_str()); break; } } @@ -263,7 +263,7 @@ bool SMLoader::LoadFromSMFile( CString sPath, Song &out ) 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; } @@ -272,7 +272,7 @@ bool SMLoader::LoadFromSMFile( CString sPath, Song &out ) *pNewNotes); } else - LOG->Trace( "Unexpected value named '%s'", sValueName.GetString() ); + LOG->Trace( "Unexpected value named '%s'", sValueName.c_str() ); } return true; @@ -285,7 +285,7 @@ bool SMLoader::LoadFromDir( CString sPath, Song &out ) GetApplicableFiles( sPath, aFileNames ); 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 * called to begin with. */ diff --git a/stepmania/src/NotesWriterDWI.cpp b/stepmania/src/NotesWriterDWI.cpp index 51a65c3641..7f9d53e757 100644 --- a/stepmania/src/NotesWriterDWI.cpp +++ b/stepmania/src/NotesWriterDWI.cpp @@ -217,18 +217,18 @@ bool NotesWriterDWI::Write( CString sPath, const Song &out ) { FILE* fp = fopen( sPath, "w" ); 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. */ - fprintf( fp, "#TITLE:%s;\n", out.GetTranslitMainTitle().GetString() ); - fprintf( fp, "#ARTIST:%s;\n", out.GetTranslitArtist().GetString() ); + fprintf( fp, "#TITLE:%s;\n", out.GetTranslitMainTitle().c_str() ); + fprintf( fp, "#ARTIST:%s;\n", out.GetTranslitArtist().c_str() ); ASSERT( out.m_BPMSegments[0].m_fStartBeat == 0 ); fprintf( fp, "#BPM:%.3f;\n", out.m_BPMSegments[0].m_fBPM ); fprintf( fp, "#GAP:%d;\n", int(-roundf( out.m_fBeat0OffsetInSeconds*1000 )) ); fprintf( fp, "#SAMPLESTART:%.3f;\n", out.m_fMusicSampleStartSeconds ); fprintf( fp, "#SAMPLELENGTH:%.3f;\n", out.m_fMusicSampleLengthSeconds ); 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() ) { diff --git a/stepmania/src/NotesWriterSM.cpp b/stepmania/src/NotesWriterSM.cpp index 14b908ebbc..182945871f 100644 --- a/stepmania/src/NotesWriterSM.cpp +++ b/stepmania/src/NotesWriterSM.cpp @@ -7,18 +7,18 @@ void NotesWriterSM::WriteGlobalTags(FILE *fp, const Song &out) { - fprintf( fp, "#TITLE:%s;\n", out.m_sMainTitle.GetString() ); - fprintf( fp, "#SUBTITLE:%s;\n", out.m_sSubTitle.GetString() ); - fprintf( fp, "#ARTIST:%s;\n", out.m_sArtist.GetString() ); - fprintf( fp, "#TITLETRANSLIT:%s;\n", out.m_sMainTitleTranslit.GetString() ); - fprintf( fp, "#SUBTITLETRANSLIT:%s;\n", out.m_sSubTitleTranslit.GetString() ); - fprintf( fp, "#ARTISTTRANSLIT:%s;\n", out.m_sArtistTranslit.GetString() ); - fprintf( fp, "#CREDIT:%s;\n", out.m_sCredit.GetString() ); - fprintf( fp, "#BANNER:%s;\n", out.m_sBannerFile.GetString() ); - fprintf( fp, "#BACKGROUND:%s;\n", out.m_sBackgroundFile.GetString() ); - fprintf( fp, "#LYRICSPATH:%s;\n", out.m_sLyricsFile.GetString() ); - fprintf( fp, "#CDTITLE:%s;\n", out.m_sCDTitleFile.GetString() ); - fprintf( fp, "#MUSIC:%s;\n", out.m_sMusicFile.GetString() ); + fprintf( fp, "#TITLE:%s;\n", out.m_sMainTitle.c_str() ); + fprintf( fp, "#SUBTITLE:%s;\n", out.m_sSubTitle.c_str() ); + fprintf( fp, "#ARTIST:%s;\n", out.m_sArtist.c_str() ); + fprintf( fp, "#TITLETRANSLIT:%s;\n", out.m_sMainTitleTranslit.c_str() ); + fprintf( fp, "#SUBTITLETRANSLIT:%s;\n", out.m_sSubTitleTranslit.c_str() ); + fprintf( fp, "#ARTISTTRANSLIT:%s;\n", out.m_sArtistTranslit.c_str() ); + fprintf( fp, "#CREDIT:%s;\n", out.m_sCredit.c_str() ); + fprintf( fp, "#BANNER:%s;\n", out.m_sBannerFile.c_str() ); + fprintf( fp, "#BACKGROUND:%s;\n", out.m_sBackgroundFile.c_str() ); + fprintf( fp, "#LYRICSPATH:%s;\n", out.m_sLyricsFile.c_str() ); + fprintf( fp, "#CDTITLE:%s;\n", out.m_sCDTitleFile.c_str() ); + fprintf( fp, "#MUSIC:%s;\n", out.m_sMusicFile.c_str() ); fprintf( fp, "#MUSICBYTES:%u;\n", out.m_iMusicBytes ); fprintf( fp, "#MUSICLENGTH:%.3f;\n", out.m_fMusicLengthSeconds ); 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]; - 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 ) fprintf( fp, "," ); } @@ -76,19 +76,19 @@ void NotesWriterSM::WriteGlobalTags(FILE *fp, const Song &out) void NotesWriterSM::WriteSMNotesTag( const Notes &in, FILE* fp ) { 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, " %s:\n", GameManager::NotesTypeToString(in.m_NotesType).GetString() ); - fprintf( fp, " %s:\n", in.GetDescription().GetString() ); - fprintf( fp, " %s:\n", DifficultyToString(in.GetDifficulty()).GetString() ); + fprintf( fp, " %s:\n", GameManager::NotesTypeToString(in.m_NotesType).c_str() ); + fprintf( fp, " %s:\n", in.GetDescription().c_str() ); + fprintf( fp, " %s:\n", DifficultyToString(in.GetDifficulty()).c_str() ); fprintf( fp, " %d:\n", in.GetMeter() ); CStringArray asRadarValues; for( int r=0; r < NUM_RADAR_CATEGORIES; 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) @@ -98,7 +98,7 @@ bool NotesWriterSM::Write(CString sPath, const Song &out, bool bSavingCache) FILE* fp = fopen( sPath, "w" ); 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; } diff --git a/stepmania/src/PlayerAI.cpp b/stepmania/src/PlayerAI.cpp index e05193f8de..98480f6902 100644 --- a/stepmania/src/PlayerAI.cpp +++ b/stepmania/src/PlayerAI.cpp @@ -51,7 +51,7 @@ void PlayerAI::InitFromDisk() { CString sKey = ssprintf("Skill%d", i); 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]; dist.fPercent[TNS_NONE] = 0; diff --git a/stepmania/src/RageBitmapTexture.cpp b/stepmania/src/RageBitmapTexture.cpp index 38799ef88a..f8fc034274 100644 --- a/stepmania/src/RageBitmapTexture.cpp +++ b/stepmania/src/RageBitmapTexture.cpp @@ -154,7 +154,7 @@ SDL_Surface *RageBitmapTexture::CreateImg(int &pixfmt) /* XXX: Wait, we don't want to throw for all images; in particular, we * want to tolerate corrupt/unknown background images. */ 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) { @@ -479,8 +479,8 @@ retry: if(IsPackedPixelFormat(pixfmt)) props += "paletted "; props.erase(props.size()-1); LOG->Trace( "RageBitmapTexture: Loaded '%s' (%ux%u); %s, source %d,%d; image %d,%d.", - m_ActualID.filename.GetString(), GetTextureWidth(), GetTextureHeight(), - props.GetString(), m_iSourceWidth, m_iSourceHeight, + m_ActualID.filename.c_str(), GetTextureWidth(), GetTextureHeight(), + props.c_str(), m_iSourceWidth, m_iSourceHeight, m_iImageWidth, m_iImageHeight); } diff --git a/stepmania/src/RageDisplay.cpp b/stepmania/src/RageDisplay.cpp index af40ef7ca4..9480c1fcc9 100644 --- a/stepmania/src/RageDisplay.cpp +++ b/stepmania/src/RageDisplay.cpp @@ -287,9 +287,9 @@ void RageDisplay::DumpOpenGLDebugInfo() if(i == Actual && skip) { /* We chose a bogus format. */ - LOG->Warn("%s", str.GetString()); + LOG->Warn("%s", str.c_str()); } else - LOG->Info("%s", str.GetString()); + LOG->Info("%s", str.c_str()); } #endif } diff --git a/stepmania/src/RageException.cpp b/stepmania/src/RageException.cpp index be86f1af4e..1e8ea4dafa 100644 --- a/stepmania/src/RageException.cpp +++ b/stepmania/src/RageException.cpp @@ -45,15 +45,15 @@ void RageException::Throw(const char *fmt, ...) "Exception: %s\n" "//////////////////////////////////////////////////////\n" "", - error.GetString()); + error.c_str()); if(LOG) { - LOG->Trace("%s", msg.GetString()); + LOG->Trace("%s", msg.c_str()); LOG->Flush(); } else { - printf("%s\n", msg.GetString()); + printf("%s\n", msg.c_str()); fflush(stdout); } @@ -62,7 +62,7 @@ void RageException::Throw(const char *fmt, ...) DebugBreak(); #endif - throw RageException("%s", error.GetString()); + throw RageException("%s", error.c_str()); } void RageException::ThrowNonfatal(const char *fmt, ...) @@ -72,7 +72,7 @@ void RageException::ThrowNonfatal(const char *fmt, ...) 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(); } diff --git a/stepmania/src/RageLog.cpp b/stepmania/src/RageLog.cpp index dfeb161a08..6ee7a193a2 100644 --- a/stepmania/src/RageLog.cpp +++ b/stepmania/src/RageLog.cpp @@ -167,7 +167,7 @@ void RageLog::Warn( const char *fmt, ...) CString sBuff = vssprintf( fmt, 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 */ @@ -177,7 +177,7 @@ void RageLog::Write( int where, CString str) str = SecondsToTime(RageTimer::GetTimeSinceStart()) + ": " + str; 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); @@ -190,13 +190,13 @@ void RageLog::Write( int where, CString str) "/////////////////////////////////////////\n" "%s\n" "/////////////////////////////////////////", - str.GetString()); + str.c_str()); } 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 Flush(); diff --git a/stepmania/src/RageMath.cpp b/stepmania/src/RageMath.cpp index 988b7f7d4c..a7968bc2b9 100644 --- a/stepmania/src/RageMath.cpp +++ b/stepmania/src/RageMath.cpp @@ -220,7 +220,7 @@ void RageMatrixCommand( CString sCommandString, RageMatrix &mat ) else if( sName=="rotationz" ) RageMatrixRotationZ( &b, fParam(1) ); 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 ); #if defined(WIN32) // XXX arch? if( DISPLAY->IsWindowed() ) @@ -232,7 +232,7 @@ void RageMatrixCommand( CString sCommandString, RageMatrix &mat ) 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 ); #if defined(WIN32) // XXX arch? if( DISPLAY->IsWindowed() ) diff --git a/stepmania/src/RageSound.cpp b/stepmania/src/RageSound.cpp index e5af741f9f..12d98ca3d6 100644 --- a/stepmania/src/RageSound.cpp +++ b/stepmania/src/RageSound.cpp @@ -151,14 +151,14 @@ void RageSound::Fail(CString reason) position = 0; LOG->Warn("Decoding %s failed: %s", - GetLoadedFilePath().GetString(), reason.GetString() ); + GetLoadedFilePath().c_str(), reason.c_str() ); error = reason; } 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) precache = false; @@ -172,9 +172,9 @@ bool RageSound::Load(CString sSoundFilePath, int precache) position = 0; 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", - sSoundFilePath.GetString(), NewSample->GetError().c_str()); + sSoundFilePath.c_str(), NewSample->GetError().c_str()); Sample = NewSample; 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, * so stop. */ 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; } @@ -449,7 +449,7 @@ int RageSound::GetPCM(char *buffer, int size, int sampleno) if(GetData(NULL, size) == 0) { 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. */ return bytes_stored; @@ -553,7 +553,7 @@ float RageSound::GetLengthSeconds() if(len < 0) { LOG->Warn("GetLengthSeconds failed on %s: %s", - GetLoadedFilePath().GetString(), Sample->GetError().c_str() ); + GetLoadedFilePath().c_str(), Sample->GetError().c_str() ); return -1; } @@ -695,7 +695,7 @@ bool RageSound::SetPositionSamples( int samples ) * we passed EOF. This could be a truncated file or invalid data. Warn * about it and jump back to the beginning. */ LOG->Warn("SetPositionSamples: %i ms is beyond EOF in %s", - ms, GetLoadedFilePath().GetString()); + ms, GetLoadedFilePath().c_str()); position = 0; return false; /* failed (but recoverable) */ diff --git a/stepmania/src/RageSoundManager.cpp b/stepmania/src/RageSoundManager.cpp index bb9f9d2999..902d127939 100644 --- a/stepmania/src/RageSoundManager.cpp +++ b/stepmania/src/RageSoundManager.cpp @@ -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) { -// 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->GetLoadedFilePath() == file ) diff --git a/stepmania/src/RageSoundReader_SDL_Sound.cpp b/stepmania/src/RageSoundReader_SDL_Sound.cpp index ab99190081..8352e8aedb 100644 --- a/stepmania/src/RageSoundReader_SDL_Sound.cpp +++ b/stepmania/src/RageSoundReader_SDL_Sound.cpp @@ -42,7 +42,7 @@ bool SoundReader_SDL_Sound::Open(CString filename_) sound_desired.format = AUDIO_S16SYS; sound_desired.rate = 0; - Sample = Sound_NewSampleFromFile(filename.GetString(), + Sample = Sound_NewSampleFromFile(filename.c_str(), &sound_desired, read_block_size); if(Sample) return true; diff --git a/stepmania/src/RageTextureManager.cpp b/stepmania/src/RageTextureManager.cpp index 02691b466a..880d3f0e3a 100644 --- a/stepmania/src/RageTextureManager.cpp +++ b/stepmania/src/RageTextureManager.cpp @@ -38,7 +38,7 @@ RageTextureManager::~RageTextureManager() { RageTexture* pTexture = i->second; 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 ); } } @@ -58,7 +58,7 @@ void RageTextureManager::Update( float fDeltaTime ) //----------------------------------------------------------------------------- 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 * 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 ) { 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 SAFE_DELETE( t ); // free the texture } diff --git a/stepmania/src/RageUtil.cpp b/stepmania/src/RageUtil.cpp index 96eb77a749..189c8cbcb1 100644 --- a/stepmania/src/RageUtil.cpp +++ b/stepmania/src/RageUtil.cpp @@ -496,7 +496,7 @@ static const unsigned int crc32_tab[] = { bool DoStat(CString sPath, struct stat *st) { TrimRight(sPath, "/\\"); - return stat(sPath.GetString(), st) != -1; + return stat(sPath.c_str(), st) != -1; } unsigned int GetHashForFile( CString sPath ) @@ -1148,7 +1148,7 @@ bool FilenameDB::ResolvePath(CString &path) if(lst.size() > 1) LOG->Warn("Ambiguous filenames \"%s\" and \"%s\"", - lst[0].GetString(), lst[1].GetString()); + lst[0].c_str(), lst[1].c_str()); ret += lst[0]; } diff --git a/stepmania/src/ScreenEdit.cpp b/stepmania/src/ScreenEdit.cpp index 00c87fcaff..438328e492 100644 --- a/stepmania/src/ScreenEdit.cpp +++ b/stepmania/src/ScreenEdit.cpp @@ -496,12 +496,12 @@ void ScreenEdit::UpdateTextInfo() CString sText; sText += ssprintf( "Current Beat:\n %.2f\n", GAMESTATE->m_fSongBeat ); - sText += ssprintf( "Snap to:\n %s\n", sNoteType.GetString() ); - sText += ssprintf( "Selection begin:\n %s\n", m_NoteFieldEdit.m_fBeginMarker==-1 ? "not set" : ssprintf("%.2f",m_NoteFieldEdit.m_fBeginMarker).GetString() ); - sText += ssprintf( "Selection end:\n %s\n", m_NoteFieldEdit.m_fEndMarker==-1 ? "not set" : ssprintf("%.2f",m_NoteFieldEdit.m_fEndMarker).GetString() ); - sText += ssprintf( "Difficulty:\n %s\n", DifficultyToString( m_pNotes->GetDifficulty() ).GetString() ); - sText += ssprintf( "Description:\n %s\n", GAMESTATE->m_pCurNotes[PLAYER_1] ? GAMESTATE->m_pCurNotes[PLAYER_1]->GetDescription().GetString() : "no description" ); - sText += ssprintf( "Main title:\n %s\n", m_pSong->m_sMainTitle.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).c_str() ); + 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() ).c_str() ); + 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.c_str() ); sText += ssprintf( "Tap Notes:\n %d\n", iNumTapNotes ); sText += ssprintf( "Hold Notes:\n %d\n", iNumHoldNotes ); sText += ssprintf( "Beat 0 Offset:\n %.2f secs\n", m_pSong->m_fBeat0OffsetInSeconds ); diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index 376c28ee74..5a8db07b1e 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -1249,7 +1249,7 @@ void ShowSavePrompt( ScreenMessage SM_SendWhenDone ) "Would you like to save these changes back\n" "to the song file?\n" "Choosing NO will discard your changes.", - GAMESTATE->m_pCurSong->GetFullDisplayTitle().GetString() ); + GAMESTATE->m_pCurSong->GetFullDisplayTitle().c_str() ); break; case PLAY_MODE_NONSTOP: case PLAY_MODE_ONI: diff --git a/stepmania/src/ScreenManager.cpp b/stepmania/src/ScreenManager.cpp index 8bd3b8f6d5..68da5e2ad8 100644 --- a/stepmania/src/ScreenManager.cpp +++ b/stepmania/src/ScreenManager.cpp @@ -224,7 +224,7 @@ void ScreenSystemLayer::UpdateTimestampAndSkips() RageColor(1,0.2f,0.2f,1) /* light red */ }; 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].SetDiffuse(RageColor(1,1,1,1)); 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 // have to include each other's headers of other screens. 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 ) { diff --git a/stepmania/src/ScreenSelectMode.cpp b/stepmania/src/ScreenSelectMode.cpp index b80719cfa2..4ddf85cda9 100644 --- a/stepmania/src/ScreenSelectMode.cpp +++ b/stepmania/src/ScreenSelectMode.cpp @@ -131,7 +131,7 @@ ScreenSelectMode::ScreenSelectMode() : Screen("ScreenSelectMode") for( unsigned i=0; iname; - 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 ); this->AddChild( &m_Infotext[i] ); m_Infotext[i].SetDiffuse( RageColor(0,0,0,0)); @@ -256,7 +256,7 @@ void ScreenSelectMode::RefreshModeChoices() for( unsigned j=0; jGetPathToG( 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 ); @@ -269,7 +269,7 @@ void ScreenSelectMode::RefreshModeChoices() for( unsigned i=0; iname; - 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())) ); } } } diff --git a/stepmania/src/ScreenStyleSplash.cpp b/stepmania/src/ScreenStyleSplash.cpp index a6b23d9bf3..7840238132 100644 --- a/stepmania/src/ScreenStyleSplash.cpp +++ b/stepmania/src/ScreenStyleSplash.cpp @@ -40,7 +40,7 @@ ScreenStyleSplash::ScreenStyleSplash() : Screen("ScreenStyleSplash") CString sStyleName = GAMESTATE->GetCurrentStyleDef()->m_szName; 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 ); m_Menu.Load( "ScreenStyleSplash" ); diff --git a/stepmania/src/ScreenTestSound.cpp b/stepmania/src/ScreenTestSound.cpp index bd745c05d1..fbea4670f9 100644 --- a/stepmania/src/ScreenTestSound.cpp +++ b/stepmania/src/ScreenTestSound.cpp @@ -90,14 +90,14 @@ void ScreenTestSound::UpdateText(int n) "%s\n" "(%s)\n" "%s", - n+1, fn.GetString(), + n+1, fn.c_str(), s[n].s.IsPlaying()? "Playing":"Stopped", s[n].s.GetStopMode() == RageSound::M_STOP? "Stop when finished": s[n].s.GetStopMode() == RageSound::M_CONTINUE? "Continue until stopped": "Loop", - pos.size()? pos.GetString(): "none playing", + pos.size()? pos.c_str(): "none playing", selected == n? "^^^^^^":"" )); } diff --git a/stepmania/src/SongManager.cpp b/stepmania/src/SongManager.cpp index 5b904c91ca..5024bbccdd 100644 --- a/stepmania/src/SongManager.cpp +++ b/stepmania/src/SongManager.cpp @@ -109,7 +109,7 @@ void SongManager::SanityCheckGroupDir( CString sDir ) const "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" "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() ) { 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 ); @@ -179,8 +179,8 @@ void SongManager::LoadStepManiaSongDir( CString sDir, LoadingWindow *ld ) // this is a song directory. Load a new song! if( ld ) { ld->SetText( ssprintf("Loading songs...\n%s\n%s", - Basename(sGroupDirName).GetString(), - Basename(sSongDirName).GetString())); + Basename(sGroupDirName).c_str(), + Basename(sSongDirName).c_str())); ld->Paint(); } Song* pNewSong = new Song; @@ -311,7 +311,7 @@ void SongManager::InitMachineScoresFromDisk() getline(f, line); int version; - sscanf(line.GetString(), "%i", &version); + sscanf(line.c_str(), "%i", &version); if( version == NOTES_SCORES_VERSION ) { @@ -322,7 +322,7 @@ void SongManager::InitMachineScoresFromDisk() getline(f, line); unsigned uNumNotes; - sscanf(line.GetString(), "%u", &uNumNotes); + sscanf(line.c_str(), "%u", &uNumNotes); Song* pSong = this->GetSongFromDir( sSongDir ); @@ -332,7 +332,7 @@ void SongManager::InitMachineScoresFromDisk() Difficulty dc; getline(f, line); - sscanf(line.GetString(), "%d %d", &nt, &dc); + sscanf(line.c_str(), "%d %d", &nt, &dc); CString sDescription; getline(f, sDescription); @@ -350,7 +350,7 @@ void SongManager::InitMachineScoresFromDisk() 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].grade, &pNotes->m_MemCardScores[c].fScore); diff --git a/stepmania/src/Sprite.cpp b/stepmania/src/Sprite.cpp index 5b4f96f2bb..a5041362f0 100644 --- a/stepmania/src/Sprite.cpp +++ b/stepmania/src/Sprite.cpp @@ -74,7 +74,7 @@ bool Sprite::Load( RageTextureID ID ) // BaseZoomZ=1 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(); @@ -90,17 +90,17 @@ bool Sprite::LoadFromSpriteFile( RageTextureID ID ) IniFile ini; ini.SetPath( m_sSpritePath ); 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; ini.GetValue( "Sprite", "Texture", 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 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 LoadFromTexture( ID ); @@ -117,7 +117,7 @@ bool Sprite::LoadFromSpriteFile( RageTextureID ID ) break; if( m_iStateToFrame[i] >= m_pTexture->GetNumFrames() ) 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; if( !ini.GetValueF( "Sprite", sDelayKey, m_fDelay[i] ) ) break; diff --git a/stepmania/src/ThemeManager.cpp b/stepmania/src/ThemeManager.cpp index 5fcf1927d4..214d14f48c 100644 --- a/stepmania/src/ThemeManager.cpp +++ b/stepmania/src/ThemeManager.cpp @@ -159,7 +159,7 @@ try_element_again: CString message = ssprintf( "There is more than one theme element element that 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( DISPLAY->IsWindowed() ) @@ -208,14 +208,14 @@ try_element_again: CString message = ssprintf( "The redirect '%s' points to the file '%s', which does not exist. " "Verify that this redirect is correct.", - sPath.GetString(), sNewFileName.GetString()); + sPath.c_str(), sNewFileName.c_str()); #if defined(WIN32) // XXX arch? if( DISPLAY->IsWindowed() ) if( MessageBox(NULL, message, "ThemeManager", MB_RETRYCANCEL ) == IDRETRY) goto try_element_again; #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]; #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 ) ) { case IDRETRY: @@ -247,24 +247,24 @@ try_element_again: goto try_element_again; case IDCANCEL: RageException::Throw( "Theme element '%s/%s' could not be found in '%s' or '%s'.", - sCategory.GetString(), - sFileName.GetString(), - GetThemeDirFromName(m_sCurThemeName).GetString(), - GetThemeDirFromName(BASE_THEME_NAME).GetString() ); + sCategory.c_str(), + sFileName.c_str(), + GetThemeDirFromName(m_sCurThemeName).c_str(), + GetThemeDirFromName(BASE_THEME_NAME).c_str() ); break; } #endif LOG->Warn( "Theme element '%s/%s' could not be found in '%s' or '%s'.", - sCategory.GetString(), - sFileName.GetString(), - GetThemeDirFromName(m_sCurThemeName).GetString(), - GetThemeDirFromName(BASE_THEME_NAME).GetString() ); + sCategory.c_str(), + sFileName.c_str(), + GetThemeDirFromName(m_sCurThemeName).c_str(), + GetThemeDirFromName(BASE_THEME_NAME).c_str() ); /* Err? */ 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" ); } @@ -310,15 +310,15 @@ try_metric_again: return sValue; #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; #endif RageException::Throw( "Theme metric '%s : %s' could not be found in '%s' or '%s'.", - sClassName.GetString(), - sValueName.GetString(), - sCurMetricPath.GetString(), - sDefaultMetricPath.GetString() + sClassName.c_str(), + sValueName.c_str(), + sCurMetricPath.c_str(), + 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 ); 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);