Rest of s/GetString/c_str/.

(watch out for PlayerOptions::GetString and SongOptions::GetString)
This commit is contained in:
Glenn Maynard
2003-04-25 00:27:30 +00:00
parent fe33dec385
commit 09967df461
18 changed files with 34 additions and 34 deletions
+1 -1
View File
@@ -75,7 +75,7 @@ void ActiveItemList::Update( float fDelta )
else
{
int iDisplaySecondsLeft = (int)(a.fSecsRemaining+1);
m_text[s].SetText( ssprintf("%s %02d:%02d", sDisplayText.GetString(), iDisplaySecondsLeft/60, iDisplaySecondsLeft%60) );
m_text[s].SetText( ssprintf("%s %02d:%02d", sDisplayText.c_str(), iDisplaySecondsLeft/60, iDisplaySecondsLeft%60) );
}
}
}
+2 -2
View File
@@ -480,11 +480,11 @@ void BGAnimationLayer::LoadFromIni( CString sAniDir, CString sLayer )
}
else if( sFile == "" )
{
RageException::Throw( "In the ini file for BGAnimation '%s', '%s' is missing a the line 'File='.", sAniDir.GetString(), sLayer.GetString() );
RageException::Throw( "In the ini file for BGAnimation '%s', '%s' is missing a the line 'File='.", sAniDir.c_str(), sLayer.c_str() );
}
if( !DoesFileExist(sPath) )
RageException::Throw( "In the ini file for BGAnimation '%s', the specified File '%s' does not exist.", sAniDir.GetString(), sFile.GetString() );
RageException::Throw( "In the ini file for BGAnimation '%s', the specified File '%s' does not exist.", sAniDir.c_str(), sFile.c_str() );
ini.GetValueI( sLayer, "Type", (int&)m_Type );
ini.GetValue ( sLayer, "Command", m_sCommand );
+1 -1
View File
@@ -23,7 +23,7 @@ bool DifficultyIcon::Load( CString sPath )
{
Sprite::Load( sPath );
if( GetNumStates() != 5 && GetNumStates() != 10 )
RageException::Throw( "The difficulty icon graphic '%s' must have 5 or 10 frames.", sPath.GetString() );
RageException::Throw( "The difficulty icon graphic '%s' must have 5 or 10 frames.", sPath.c_str() );
StopAnimating();
return true;
}
+1 -1
View File
@@ -283,7 +283,7 @@ static void InitCharAliases()
for(aliasmap::const_iterator i = CharAliases.begin(); i != CharAliases.end(); ++i)
{
CString from = ssprintf("&%s;", i->first.GetString());
CString from = ssprintf("&%s;", i->first.c_str());
CString to = WcharToUTF8(i->second);
from.MakeUpper();
CharAliasRepl[from] = to;
+1 -1
View File
@@ -39,7 +39,7 @@ bool GradeDisplay::Load( RageTextureID ID )
Sprite::StopAnimating();
if( Sprite::GetNumStates() != 8 && Sprite::GetNumStates() != 16 )
RageException::Throw( "The grade graphic '%s' must have either 8 or 16 frames.", ID.filename.GetString() );
RageException::Throw( "The grade graphic '%s' must have either 8 or 16 frames.", ID.filename.c_str() );
return true;
}
+1 -1
View File
@@ -45,7 +45,7 @@ void GrayArrowRow::Load( PlayerNumber pn )
// XXX
if( m_GrayArrow[c].GetNumStates() != 2 &&
m_GrayArrow[c].GetNumStates() != 3 )
RageException::Throw( "'%s' must have 2 or 3 frames", sPath.GetString() );
RageException::Throw( "'%s' must have 2 or 3 frames", sPath.c_str() );
m_GrayArrow[c].SetX( pStyleDef->m_ColumnInfo[pn][c].fXOffset );
}
}
+2 -2
View File
@@ -102,10 +102,10 @@ void IniFile::WriteFile()
if (k->second.empty())
continue;
fprintf( fp, "[%s]\n", k->first.GetString() );
fprintf( fp, "[%s]\n", k->first.c_str() );
for (key::const_iterator i = k->second.begin(); i != k->second.end(); ++i)
fprintf( fp, "%s=%s\n", i->first.GetString(), i->second.GetString() );
fprintf( fp, "%s=%s\n", i->first.c_str(), i->second.c_str() );
fprintf( fp, "\n" );
}
+4 -4
View File
@@ -19,12 +19,12 @@ static int CompareLyricSegments(const LyricSegment &seg1, const LyricSegment &se
bool LyricsLoader::LoadFromLRCFile( CString sPath, Song &out )
{
LOG->Trace( "LyricsLoader::LoadFromLRCFile(%s)", sPath.GetString() );
LOG->Trace( "LyricsLoader::LoadFromLRCFile(%s)", sPath.c_str() );
ifstream input(sPath);
if(input.bad())
{
LOG->Warn( "Error opening file '%s' for reading.", sPath.GetString() );
LOG->Warn( "Error opening file '%s' for reading.", sPath.c_str() );
return false;
}
@@ -55,11 +55,11 @@ bool LyricsLoader::LoadFromLRCFile( CString sPath, Song &out )
{
// set color var here for this segment
int r, g, b;
int result = sscanf( sValueData.GetString(), "0x%2x%2x%2x", &r, &g, &b );
int result = sscanf( sValueData.c_str(), "0x%2x%2x%2x", &r, &g, &b );
if(result != 3)
{
LOG->Trace( "The color value '%s' in '%s' is invalid.",
sValueData.GetString(), sPath.GetString() );
sValueData.c_str(), sPath.c_str() );
continue;
}
+1 -1
View File
@@ -64,7 +64,7 @@ MusicWheel::MusicWheel()
{
LOG->Trace( "MusicWheel::MusicWheel()" );
if (GAMESTATE->m_pCurSong != NULL)
LOG->Trace( "Current Song: %s", GAMESTATE->m_pCurSong->GetSongDir().GetString() );
LOG->Trace( "Current Song: %s", GAMESTATE->m_pCurSong->GetSongDir().c_str() );
else
LOG->Trace( "Current Song: NULL" );
+1 -1
View File
@@ -322,7 +322,7 @@ void NoteField::DrawPrimitives()
{
const BackgroundChange& change = aBackgroundChanges[i];
CString sChangeText = ssprintf("%s\n%.0f%%%s%s%s",
change.m_sBGName.GetString(),
change.m_sBGName.c_str(),
change.m_fRate*100,
change.m_bFadeLast ? " Fade" : "",
change.m_bRewindMovie ? " Rewind" : "",
+1 -1
View File
@@ -82,7 +82,7 @@ int OptionToPreferredColumn( CString sOptionText )
if( g_OptionColumnEntries[i].szString == sOptionText )
return g_OptionColumnEntries[i].iSlotIndex;
LOG->Warn("Unknown option: '%s'", sOptionText.GetString() );
LOG->Warn("Unknown option: '%s'", sOptionText.c_str() );
return 0;
}
+1 -1
View File
@@ -78,7 +78,7 @@ bool RandomSample::LoadSoundDir( CString sDir, int iMaxToLoad )
bool RandomSample::LoadSound( CString sSoundFilePath )
{
LOG->Trace( "RandomSample::LoadSound( %s )", sSoundFilePath.GetString() );
LOG->Trace( "RandomSample::LoadSound( %s )", sSoundFilePath.c_str() );
RageSound *pSS = new RageSound;
pSS->Load( sSoundFilePath );
+1 -1
View File
@@ -364,5 +364,5 @@ Screen* Screen::Create( CString sClassName )
IF_RETURN( ScreenSelectCharacter );
IF_RETURN( ScreenRaveOptions );
RageException::Throw( "Invalid Screen class name '%s'", sClassName.GetString() );
RageException::Throw( "Invalid Screen class name '%s'", sClassName.c_str() );
}
+2 -2
View File
@@ -97,7 +97,7 @@ ScreenSelect::ScreenSelect( CString sClassName ) : Screen(sClassName)
continue;
}
LOG->Warn( "The choice token '%s' is not recognized as a Game, Style, PlayMode, or Difficulty. The choice containing this token will be ignored.", sBit.GetString() );
LOG->Warn( "The choice token '%s' is not recognized as a Game, Style, PlayMode, or Difficulty. The choice containing this token will be ignored.", sBit.c_str() );
bChoiceIsInvalid |= true;
}
@@ -122,7 +122,7 @@ ScreenSelect::ScreenSelect( CString sClassName ) : Screen(sClassName)
m_aModeChoices.push_back( mc );
CString sBGAnimationDir = THEME->GetPathTo(BGAnimations, ssprintf("%s %s",m_sName.GetString(),mc.name), true); // true="optional"
CString sBGAnimationDir = THEME->GetPathTo(BGAnimations, ssprintf("%s %s",m_sName.c_str(),mc.name), true); // true="optional"
if( sBGAnimationDir == "" )
sBGAnimationDir = THEME->GetPathToB(m_sName+" background");
m_BGAnimations[c].LoadFromAniDir( sBGAnimationDir );
+10 -10
View File
@@ -291,7 +291,7 @@ bool Song::LoadWithoutCache( CString sDir )
NotesLoader *ld = MakeLoader( sDir );
if(!ld)
{
LOG->Warn( "Couldn't find any SM, DWI, BMS, or KSF files in '%s'. This is not a valid song directory.", sDir.GetString() );
LOG->Warn( "Couldn't find any SM, DWI, BMS, or KSF files in '%s'. This is not a valid song directory.", sDir.c_str() );
return false;
}
@@ -310,7 +310,7 @@ bool Song::LoadWithoutCache( CString sDir )
bool Song::LoadFromSongDir( CString sDir )
{
// LOG->Trace( "Song::LoadFromSongDir(%s)", sDir.GetString() );
// LOG->Trace( "Song::LoadFromSongDir(%s)", sDir.c_str() );
sDir.Replace("\\", "/");
// make sure there is a trailing slash at the end of sDir
@@ -332,7 +332,7 @@ bool Song::LoadFromSongDir( CString sDir )
if( GetHashForDirectory(m_sSongDir) == uDirHash && // this cache is up to date
DoesFileExist(GetCacheFilePath()))
{
// LOG->Trace( "Loading '%s' from cache file '%s'.", m_sSongDir.GetString(), GetCacheFilePath().GetString() );
// LOG->Trace( "Loading '%s' from cache file '%s'.", m_sSongDir.c_str(), GetCacheFilePath().c_str() );
SMLoader ld;
ld.LoadFromSMFile( GetCacheFilePath(), *this, true );
}
@@ -406,7 +406,7 @@ void Song::TidyUpData()
m_sMusicFile = arrayPossibleMusic[0];
// Don't throw on missing music. -Chris
// else
// RageException::Throw( "The song in '%s' is missing a music file. You must place a music file in the song folder or remove the song", m_sSongDir.GetString() );
// RageException::Throw( "The song in '%s' is missing a music file. You must place a music file in the song folder or remove the song", m_sSongDir.c_str() );
}
/* This must be done before radar calculation. */
@@ -423,9 +423,9 @@ void Song::TidyUpData()
* so just set the file to 0 seconds. */
m_fMusicLengthSeconds = 0;
} else if(m_fMusicLengthSeconds == 0) {
LOG->Warn("File %s is empty?", GetMusicPath().GetString());
LOG->Warn("File %s is empty?", GetMusicPath().c_str());
} else if(m_fMusicLengthSeconds == -1) {
LOG->Warn("File %s: error getting length", GetMusicPath().GetString());
LOG->Warn("File %s: error getting length", GetMusicPath().c_str());
}
}
else // ! HasMusic()
@@ -436,7 +436,7 @@ void Song::TidyUpData()
if(m_fMusicLengthSeconds < 0)
{
LOG->Warn("File %i has negative length? (%i)", GetMusicPath().GetString(), m_fMusicLengthSeconds);
LOG->Warn("File %i has negative length? (%i)", GetMusicPath().c_str(), m_fMusicLengthSeconds);
m_fMusicLengthSeconds = 0;
}
@@ -465,7 +465,7 @@ void Song::TidyUpData()
/* XXX: Once we have a way to display warnings that the user actually
* cares about (unlike most warnings), this should be one of them. */
LOG->Warn( "No BPM segments specified in '%s%s', default provided.",
m_sSongDir.GetString(), m_sSongFileName.GetString() );
m_sSongDir.c_str(), m_sSongFileName.c_str() );
AddBPMSegment( BPMSegment(0, 60) );
}
@@ -617,7 +617,7 @@ void Song::TidyUpData()
if( !img )
{
LOG->Trace("Couldn't load %s%s: %s",
m_sSongDir.GetString(), arrayImages[i].GetString(), SDL_GetError());
m_sSongDir.c_str(), arrayImages[i].c_str(), SDL_GetError());
continue;
}
@@ -872,7 +872,7 @@ void Song::Save()
void Song::SaveToSMFile( CString sPath, bool bSavingCache )
{
LOG->Trace( "Song::SaveToSMFile('%s')", sPath.GetString() );
LOG->Trace( "Song::SaveToSMFile('%s')", sPath.c_str() );
NotesWriterSM wr;
wr.Write(sPath, *this, bSavingCache);
+1 -1
View File
@@ -80,7 +80,7 @@ static void ChangeToDirOfExecutable(const char *argv0)
unsigned n = dir.find_last_of("/\\");
if (n != dir.npos) dir.erase(n);
chdir( dir.GetString() );
chdir( dir.c_str() );
}
}
+1 -1
View File
@@ -23,7 +23,7 @@ TimingAssist::TimingAssist()
case TNS_GREAT: name = "great"; break;
case TNS_PERFECT: name = "perfect"; break;
}
CString path = ssprintf("gameplay assist %s %s", direction.GetString(), name.GetString());
CString path = ssprintf("gameplay assist %s %s", direction.c_str(), name.c_str());
Timing[j][i].Load(ANNOUNCER->GetPathTo(path));
}
}
+2 -2
View File
@@ -74,9 +74,9 @@ using namespace std;
#endif
#ifdef DEBUG
#define DEBUG_ASSERT ASSERT
#define DEBUG_ASSERT(x) ASSERT(x)
#else
#define DEBUG_ASSERT (void*)(0)
#define DEBUG_ASSERT(x)
#endif