Added .GetString() to all CStrings passed in vargs

This commit is contained in:
Chris Danford
2002-10-29 07:58:44 +00:00
parent 621d419f22
commit ec202633e9
34 changed files with 184 additions and 182 deletions
+2 -2
View File
@@ -74,13 +74,13 @@ CString AnnouncerManager::GetPathTo( CString sFolderName )
#ifdef _DEBUG
if( m_sCurAnnouncerName!="" && !DoesFileExist(sPathToFolderCurrent) )
{
LOG->Trace( "The current announcer is missing the folder '%s'.", sFolderName );
LOG->Trace( "The current announcer is missing the folder '%s'.", sFolderName.GetString() );
// MessageBeep( MB_OK );
CreateDirectories( sPathToFolderCurrent );
}
if( !DoesFileExist(sPathToFolderEmpty) )
{
LOG->Trace( "The empty announcer is missing the folder '%s'.", sFolderName );
LOG->Trace( "The empty announcer is missing the folder '%s'.", sFolderName.GetString() );
// MessageBeep( MB_OK );
CreateDirectories( sPathToFolderEmpty );
CreateDirectories( sPathToFolderEmpty );
+3 -3
View File
@@ -75,7 +75,7 @@ BitmapText::~BitmapText()
bool BitmapText::LoadFromFont( CString sFontFilePath )
{
LOG->Trace( "BitmapText::LoadFromFontName(%s)", sFontFilePath );
LOG->Trace( "BitmapText::LoadFromFontName(%s)", sFontFilePath.GetString() );
if( m_pFont ) {
FONT->UnloadFont( m_pFont->m_sTexturePath );
@@ -91,7 +91,7 @@ bool BitmapText::LoadFromFont( CString sFontFilePath )
bool BitmapText::LoadFromTextureAndChars( CString sTexturePath, CString sChars )
{
LOG->Trace( "BitmapText::LoadFromTextureAndChars(%s)", sTexturePath );
LOG->Trace( "BitmapText::LoadFromTextureAndChars(%s)", sTexturePath.GetString() );
if( m_pFont ) {
FONT->UnloadFont( m_pFont->m_sTexturePath );
@@ -239,7 +239,7 @@ void BitmapText::DrawPrimitives()
const char c = szLine[j];
const int iFrameNo = m_pFont->m_iCharToFrameNo[ (unsigned char)c ];
if( iFrameNo == -1 ) // this font doesn't impelemnt this character
throw RageException( "The font '%s' does not implement the character '%c'", m_sFontFilePath, c );
throw RageException( "The font '%s' does not implement the character '%c'", m_sFontFilePath.GetString(), c );
const int iCharWidth = m_pFont->m_iFrameNoToWidth[iFrameNo];
// The right side of any italic letter is being cropped. So, we're going to draw a little bit
+2 -2
View File
@@ -96,7 +96,7 @@ void RefreshCacheItem( int iIndex )
if( asButtonNames.GetSize() < 2 )
{
LOG->Trace( "The code '%s' is less than 2 buttons, so it will be ignored.", sCodeName );
LOG->Trace( "The code '%s' is less than 2 buttons, so it will be ignored.", sCodeName.GetString() );
item.iNumButtons = 0;
return;
}
@@ -119,7 +119,7 @@ void RefreshCacheItem( int iIndex )
}
if( gb == -1 ) // didn't find it
{
LOG->Trace( "The code '%s' contains an unrecognized button '%s'.", sCodeName, sButtonName );
LOG->Trace( "The code '%s' contains an unrecognized button '%s'.", sCodeName.GetString(), sButtonName.GetString() );
item.iNumButtons = 0;
return;
}
+3 -4
View File
@@ -27,7 +27,7 @@ void Course::LoadFromCRSFile( CString sPath, CArray<Song*,Song*> &apSongs )
{
MsdFile msd;
if( !msd.ReadFile(sPath) )
throw RageException( "Error opening CRS file '%s'.", sPath );
throw RageException( "Error opening CRS file '%s'.", sPath.GetString() );
CString sDir, sFName, sExt;
splitrelpath( sPath, sDir, sFName, sExt );
@@ -74,8 +74,7 @@ void Course::LoadFromCRSFile( CString sPath, CArray<Song*,Song*> &apSongs )
if(!sSongDir.GetLength()) {
/* Err. */
LOG->Trace( "Course file \"%s\" has an empty #SONG. Ignored.",
(const char *) sPath, (const char *) sSongDir);
LOG->Trace( "Course file '%s' has an empty #SONG. Ignored.", sPath.GetString(), sSongDir.GetString() );
continue;
}
@@ -132,7 +131,7 @@ void Course::LoadFromCRSFile( CString sPath, CArray<Song*,Song*> &apSongs )
}
else
LOG->Trace( "Unexpected value named '%s'", sValueName );
LOG->Trace( "Unexpected value named '%s'", sValueName.GetString() );
}
}
+1 -1
View File
@@ -106,7 +106,7 @@ void CourseContentsFrame::SetFromCourse( Course* pCourse )
if( pNotes == NULL )
continue; // skip
printf( "Adding song '%s'\n", pSong->m_sMainTitle );
printf( "Adding song '%s'\n", pSong->m_sMainTitle.GetString() );
m_CourseContentDisplays[m_iNumContents].Load( m_iNumContents+1, pSong, pNotes );
m_CourseContentDisplays[m_iNumContents].SetXY( 0, -((MAX_VISIBLE_CONTENTS-1)/2) * CONTENTS_BAR_HEIGHT );
m_CourseContentDisplays[m_iNumContents].StopTweening();
+1 -1
View File
@@ -23,7 +23,7 @@ bool DifficultyIcon::Load( CString sPath )
{
Sprite::Load( sPath );
if( GetNumStates() != 6 && GetNumStates() != 12 )
throw RageException( "The difficulty icon graphic '%s' must have 6 or 12 states.", sPath );
throw RageException( "The difficulty icon graphic '%s' must have 6 or 12 states.", sPath.GetString() );
StopAnimating();
return true;
}
+6 -6
View File
@@ -23,7 +23,7 @@
Font::Font( const CString &sASCIITexturePath )
{
//LOG->Trace( "Font::LoadFromFontName(%s)", sASCIITexturePath );
//LOG->Trace( "Font::LoadFromFontName(%s)", sASCIITexturePath.GetString() );
int i;
@@ -41,7 +41,7 @@ Font::Font( const CString &sASCIITexturePath )
m_pTexture = TEXTUREMAN->LoadTexture( m_sTexturePath );
ASSERT( m_pTexture != NULL );
if( m_pTexture->GetNumFrames() != 16*16 )
throw RageException( "The font '%s' has only %d frames. All fonts must have 16*16 frames.", m_sTexturePath );
throw RageException( "The font '%s' has only %d frames. All fonts must have 16*16 frames.", m_sTexturePath.GetString() );
for( i=0; i<256; i++ )
m_iCharToFrameNo[i] = i;
@@ -57,7 +57,7 @@ Font::Font( const CString &sASCIITexturePath )
// load character widths
for( i=0; i<256; i++ )
if( !ini.GetValueI( "Char Widths", ssprintf("%d",i), m_iFrameNoToWidth[i] ) )
throw RageException( "Error reading width value '%d' from '%s'.", i, sIniPath );
throw RageException( "Error reading width value '%d' from '%s'.", i, sIniPath.GetString() );
m_bCapitalsOnly = false;
ini.GetValueB( "Char Widths", "CapitalsOnly", m_bCapitalsOnly );
@@ -94,7 +94,7 @@ Font::Font( const CString &sASCIITexturePath )
Font::Font( const CString &sTexturePath, const CString& sCharacters )
{
//LOG->Trace( "Font::LoadFromFontName(%s)", sFontFilePath );
//LOG->Trace( "Font::LoadFromFontName(%s)", sFontFilePath.GetString() );
int i;
for( i=0; i<MAX_FONT_CHARS; i++ )
{
@@ -126,7 +126,7 @@ Font::Font( const CString &sTexturePath, const CString& sCharacters )
// sanity check
if( sCharacters.GetLength() != m_pTexture->GetNumFrames() )
throw RageException( "The image '%s' doesn't have the correct number of frames. It has %d frames but should have %d frames.",
m_sTexturePath, m_pTexture->GetNumFrames(), sCharacters.GetLength() );
m_sTexturePath.GetString(), m_pTexture->GetNumFrames(), sCharacters.GetLength() );
// set the char to frame number map
for( i=0; i<sCharacters.GetLength(); i++ )
@@ -159,7 +159,7 @@ int Font::GetLineWidthInSourcePixels( const char *szLine, int iLength )
const char c = szLine[i];
const int iFrameNo = m_iCharToFrameNo[ (unsigned char)c ];
if( iFrameNo == -1 ) // this font doesn't impelemnt this character
throw RageException( "The font '%s' does not implement the character '%c'", m_sTexturePath, c );
throw RageException( "The font '%s' does not implement the character '%c'", m_sTexturePath.GetString(), c );
iLineWidth += m_iFrameNoToWidth[iFrameNo];
}
+8 -8
View File
@@ -36,7 +36,7 @@ FontManager::~FontManager()
i != m_mapPathToFont.end(); ++i)
{
Font* pFont = i->second;
LOG->Trace( "FONT LEAK: '%s', RefCount = %d.", i->first, pFont->m_iRefCount );
LOG->Trace( "FONT LEAK: '%s', RefCount = %d.", i->first.GetString(), pFont->m_iRefCount );
SAFE_DELETE( pFont );
}
}
@@ -49,7 +49,7 @@ Font* FontManager::LoadFont( CString sFontOrTextureFilePath, CString sChars )
{
sFontOrTextureFilePath.MakeLower();
// LOG->Trace( "FontManager::LoadFont(%s).", sFontFilePath );
// LOG->Trace( "FontManager::LoadFont(%s).", sFontFilePath.GetString() );
// Convert the path to lowercase so that we don't load duplicates.
@@ -61,7 +61,7 @@ Font* FontManager::LoadFont( CString sFontOrTextureFilePath, CString sChars )
std::map<CString, Font*>::iterator p = m_mapPathToFont.find(sFontOrTextureFilePath);
if(p != m_mapPathToFont.end()) {
// LOG->Trace( ssprintf("FontManager: The Font '%s' now has %d references.", sFontFilePath, pFont->m_iRefCount) );
// LOG->Trace( ssprintf("FontManager: The Font '%s' now has %d references.", sFontFilePath.GetString(), pFont->m_iRefCount) );
pFont=p->second;
pFont->m_iRefCount++;
}
@@ -75,7 +75,7 @@ Font* FontManager::LoadFont( CString sFontOrTextureFilePath, CString sChars )
else
pFont = (Font*) new Font( sFontOrTextureFilePath, sChars );
// LOG->Trace( "FontManager: Loading '%s' from disk.", sFontFilePath);
// LOG->Trace( "FontManager: Loading '%s' from disk.", sFontFilePath.GetString());
m_mapPathToFont[sFontOrTextureFilePath] = pFont;
}
@@ -95,7 +95,7 @@ void FontManager::UnloadFont( CString sFontFilePath )
{
sFontFilePath.MakeLower();
// LOG->Trace( "FontManager::UnloadTexture(%s).", sFontFilePath );
// LOG->Trace( "FontManager::UnloadTexture(%s).", sFontFilePath.GetString() );
if( sFontFilePath == "" )
{
@@ -106,18 +106,18 @@ void FontManager::UnloadFont( CString sFontFilePath )
Font* pFont;
std::map<CString, Font*>::iterator p = m_mapPathToFont.find(sFontFilePath);
if(p == m_mapPathToFont.end())
throw RageException( ssprintf("Tried to Unload a font that wasn't loaded. '%s'", sFontFilePath) );
throw RageException( "Tried to Unload a font that wasn't loaded. '%s'", sFontFilePath.GetString() );
pFont=p->second;
pFont->m_iRefCount--;
if( pFont->m_iRefCount != 0 )
{
// LOG->Trace( ssprintf("FontManager: '%s' will not be deleted. It still has %d references.", sFontFilePath, pFont->m_iRefCount) );
// LOG->Trace( "FontManager: '%s' will not be deleted. It still has %d references.", sFontFilePath.GetString(), pFont->m_iRefCount );
return;
}
// There are no more references to this texture.
// LOG->Trace( "FontManager: '%s' will be deleted. It has %d references.", sFontFilePath, pFont->m_iRefCount );
// LOG->Trace( "FontManager: '%s' will be deleted. It has %d references.", sFontFilePath.GetString(), pFont->m_iRefCount );
SAFE_DELETE( pFont ); // free the texture
m_mapPathToFont.erase( p ); // and remove the key in the map
}
+12 -12
View File
@@ -1247,7 +1247,7 @@ void GameManager::SwitchNoteSkin( CString sNewNoteSkin )
CString sPath = GetCurNoteSkinDir() + "metrics.ini";
m_pIniFile->SetPath(sPath);
if( !m_pIniFile->ReadFile() )
throw RageException( "Could not read NoteSkin metrics file '%s'", sPath );
throw RageException( "Could not read NoteSkin metrics file '%s'", sPath.GetString() );
}
}
@@ -1255,14 +1255,14 @@ CString GameManager::GetCurNoteSkinDir()
{
const GameDef* pGameDef = GAMESTATE->GetCurrentGameDef();
return NOTESKIN_DIR + ssprintf("%s\\%s\\", pGameDef->m_szName, m_sCurNoteSkin);
return NOTESKIN_DIR + ssprintf("%s\\%s\\", pGameDef->m_szName, m_sCurNoteSkin.GetString());
}
CString GameManager::GetMetric( CString sClassName, CString sValue ) // looks in GAMESTATE for the current Style
{
CString sReturn;
if( !m_pIniFile->GetValue( sClassName, sValue, sReturn ) )
throw RageException( "Could not read metric '%s - %s' from '%s'", sClassName, sValue, GetCurNoteSkinDir() + "metrics.ini" );
throw RageException( "Could not read metric '%s - %s' from '%smetrics.ini'", sClassName.GetString(), sValue.GetString(), GetCurNoteSkinDir().GetString() );
return sReturn;
}
@@ -1290,7 +1290,7 @@ RageColor GameManager::GetMetricC( CString sClassName, CString sValueName )
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, sClassName, sValueName );
LOG->Warn( "The color value '%s' for theme metric '%s : %s' is invalid.", szValue, sClassName.GetString(), sValueName.GetString() );
ASSERT(0);
}
@@ -1311,17 +1311,17 @@ CString GameManager::GetPathTo( const int col, CString sElementName ) // looks i
CStringArray arrayPossibleFileNames; // fill this with the possible files
GetDirListing( ssprintf("%s%s %s*.sprite", sDir, sButtonName, sElementName), arrayPossibleFileNames, false, true );
GetDirListing( ssprintf("%s%s %s*.png", sDir, sButtonName, sElementName), arrayPossibleFileNames, false, true );
GetDirListing( ssprintf("%s%s %s*.jpg", sDir, sButtonName, sElementName), arrayPossibleFileNames, false, true );
GetDirListing( ssprintf("%s%s %s*.bmp", sDir, sButtonName, sElementName), arrayPossibleFileNames, false, true );
GetDirListing( ssprintf("%s%s %s*.gif", sDir, sButtonName, sElementName), arrayPossibleFileNames, false, true );
GetDirListing( ssprintf("%s%s %s*", sDir, sButtonName, sElementName), arrayPossibleFileNames, false, true );
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 );
if( arrayPossibleFileNames.GetSize() > 0 )
return arrayPossibleFileNames[0];
throw RageException( "The NoteSkin element '%s %s' is missing from '%s'.", sButtonName, sElementName, sDir );
throw RageException( "The NoteSkin element '%s %s' is missing from '%s'.", sButtonName.GetString(), sElementName.GetString(), sDir.GetString() );
}
void GameManager::GetEnabledGames( CArray<Game,Game>& aGamesOut )
@@ -1383,7 +1383,7 @@ NotesType GameManager::StringToNotesType( CString sNotesType )
return NotesType(i);
// invalid NotesType
LOG->Warn( "Invalid NotesType string '%s' encountered. Assuming this is 'dance-single'.", sNotesType );
LOG->Warn( "Invalid NotesType string '%s' encountered. Assuming this is 'dance-single'.", sNotesType.GetString() );
return NOTES_TYPE_DANCE_SINGLE;
}
+1 -1
View File
@@ -248,7 +248,7 @@ CString GameState::GetStageText()
default:sNumberSuffix = "th"; break;
}
}
return ssprintf( "%d%s", iStageNo, sNumberSuffix );
return ssprintf( "%d%s", iStageNo, sNumberSuffix.GetString() );
}
RageColor GameState::GetStageColor()
+1 -1
View File
@@ -38,7 +38,7 @@ void GrayArrowRow::Load( PlayerNumber pn )
CString sPath = GAMEMAN->GetPathTo(c, "receptor");
m_GrayArrow[c].Load( sPath );
if( m_GrayArrow[c].GetNumStates() != 2 )
throw RageException( "'%s' must have two frames", sPath );
throw RageException( "'%s' must have two frames", sPath.GetString() );
m_GrayArrow[c].SetX( pStyleDef->m_ColumnInfo[pn][c].fXOffset );
}
}
+2 -2
View File
@@ -72,7 +72,7 @@ void InputMapper::ReadMappingsFromDisk()
IniFile ini;
ini.SetPath( sPath );
if( !ini.ReadFile() )
LOG->Warn( "could not input mapping file '%s'.", sPath );
LOG->Warn( "could not input mapping file '%s'.", sPath.GetString() );
IniFile::const_iterator Key = ini.GetKey( "Input" );
@@ -121,7 +121,7 @@ void InputMapper::SaveMappingsToDisk()
GameInput GameI( (GameController)i, (GameButton)j );
sNameString = GameI.toString();
sValueString = ssprintf( "%s,%s,%s",
m_GItoDI[i][j][0].toString(), m_GItoDI[i][j][1].toString(), m_GItoDI[i][j][2].toString() );
m_GItoDI[i][j][0].toString().GetString(), m_GItoDI[i][j][1].toString().GetString(), m_GItoDI[i][j][2].toString().GetString() );
ini.SetValue( "Input", sNameString, sValueString );
}
+3 -3
View File
@@ -44,14 +44,14 @@ void NoteDisplay::Load( int iColNum, PlayerNumber pn )
CString sTapPartsPath = GAMEMAN->GetPathTo(iColNum, "tap parts");
m_sprTapParts.Load( sTapPartsPath );
if( m_sprTapParts.GetNumStates() % 2 != 0 )
throw RageException( "Tap Parts '%s' must have an even number of frames.", sTapPartsPath );
throw RageException( "Tap Parts '%s' must have an even number of frames.", sTapPartsPath.GetString() );
m_sprTapParts.StopAnimating();
m_sprTapParts.TurnShadowOff();
CString sHoldPartsPath = GAMEMAN->GetPathTo(iColNum, "hold parts");
m_sprHoldParts.Load( sHoldPartsPath );
if( m_sprHoldParts.GetTexture()->GetFramesWide() != 4 || m_sprHoldParts.GetTexture()->GetFramesHigh() != 2 )
throw RageException( "Hold Parts '%s' must have 4x2 frames.", sHoldPartsPath );
throw RageException( "Hold Parts '%s' must have 4x2 frames.", sHoldPartsPath.GetString() );
m_sprHoldParts.StopAnimating();
m_sprHoldParts.TurnShadowOff();
@@ -60,7 +60,7 @@ void NoteDisplay::Load( int iColNum, PlayerNumber pn )
const CString sColorsFilePath = GAMEMAN->GetPathTo( iColNum, "Tap.colors" );
FILE* fp = fopen( sColorsFilePath, "r" );
if( fp == NULL )
throw RageException( "Couldn't open .colors file '%s'", sColorsFilePath );
throw RageException( "Couldn't open .colors file '%s'", sColorsFilePath.GetString() );
bool bSuccess;
do
+6 -6
View File
@@ -57,19 +57,19 @@ Notes::~Notes()
void Notes::WriteSMNotesTag( FILE* fp )
{
fprintf( fp, "\n//---------------%s - %s----------------\n",
GameManager::NotesTypeToString(m_NotesType), m_sDescription );
GameManager::NotesTypeToString(m_NotesType).GetString(), m_sDescription.GetString() );
fprintf( fp, "#NOTES:\n" );
fprintf( fp, " %s:\n", GameManager::NotesTypeToString(m_NotesType) );
fprintf( fp, " %s:\n", m_sDescription );
fprintf( fp, " %s:\n", DifficultyToString(m_Difficulty) );
fprintf( fp, " %s:\n", GameManager::NotesTypeToString(m_NotesType).GetString() );
fprintf( fp, " %s:\n", m_sDescription.GetString() );
fprintf( fp, " %s:\n", DifficultyToString(m_Difficulty).GetString() );
fprintf( fp, " %d:\n", m_iMeter );
CStringArray asRadarValues;
for( int r=0; r<NUM_RADAR_VALUES; r++ )
asRadarValues.Add( ssprintf("%.3f", m_fRadarValues[r]) );
fprintf( fp, " %s:\n", join(",",asRadarValues) );
fprintf( fp, " %s:\n", join(",",asRadarValues).GetString() );
fprintf( fp, "%s;\n", m_sSMNoteData );
fprintf( fp, "%s;\n", m_sSMNoteData.GetString() );
}
void Notes::SetNoteData( NoteData* pNewNoteData )
+12 -12
View File
@@ -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 );
LOG->Trace( "Notes::LoadFromBMSFile( '%s' )", sPath.GetString() );
out.m_NotesType = NOTES_TYPE_INVALID;
@@ -69,7 +69,7 @@ bool BMSLoader::LoadFromBMSFile( const CString &sPath, Notes &out )
CStdioFile file;
if( !file.Open( sPath, CFile::modeRead|CFile::shareDenyNone ) )
throw RageException( "Failed to open %s for reading.", sPath );
throw RageException( "Failed to open %s for reading.", sPath.GetString() );
CString line;
while( file.ReadString(line) ) // foreach line
@@ -134,7 +134,7 @@ bool BMSLoader::LoadFromBMSFile( const CString &sPath, Notes &out )
if( iPosOpenBracket != -1 && iPosCloseBracket != -1 )
out.m_sDescription = out.m_sDescription.Mid( iPosOpenBracket+1, iPosCloseBracket-iPosOpenBracket-1 );
out.m_sDescription.MakeLower();
LOG->Trace( "Notes description found to be '%s'", out.m_sDescription );
LOG->Trace( "Notes description found to be '%s'", out.m_sDescription.GetString() );
// if there's a 6 in the description, it's probably part of "6panel" or "6-panel"
if( out.m_sDescription.Find("6") != -1 )
@@ -163,7 +163,7 @@ bool BMSLoader::LoadFromBMSFile( const CString &sPath, Notes &out )
const int iNumNotesInThisMeasure = arrayNotes.GetSize();
//LOG->Trace( "%s:%s: iMeasureNo = %d, iNoteNum = %d, iNumNotesInThisMeasure = %d",
// valuename, sNoteData, iMeasureNo, iNoteNum, iNumNotesInThisMeasure );
// valuename.GetString(), sNoteData.GetString(), iMeasureNo, iNoteNum, iNumNotesInThisMeasure );
for( int j=0; j<iNumNotesInThisMeasure; j++ )
{
if( arrayNotes[j] )
@@ -253,13 +253,13 @@ void BMSLoader::GetApplicableFiles( CString sPath, CStringArray &out )
bool BMSLoader::LoadFromDir( CString sDir, Song &out )
{
LOG->Trace( "Song::LoadFromBMSDir(%s)", sDir );
LOG->Trace( "Song::LoadFromBMSDir(%s)", sDir.GetString() );
CStringArray arrayBMSFileNames;
GetApplicableFiles( sDir, arrayBMSFileNames );
if( arrayBMSFileNames.GetSize() == 0 )
throw RageException( "Couldn't find any BMS files in '%s'", sDir );
throw RageException( "Couldn't find any BMS files in '%s'", sDir.GetString() );
// load the Notes from the rest of the BMS files
for( int i=0; i<arrayBMSFileNames.GetSize(); i++ )
@@ -278,7 +278,7 @@ bool BMSLoader::LoadFromDir( CString sDir, Song &out )
CStdioFile file;
if( !file.Open( sPath, CFile::modeRead|CFile::shareDenyNone ) )
throw RageException( "Failed to open %s for reading.", sPath );
throw RageException( "Failed to open %s for reading.", sPath.GetString() );
CString line;
while( file.ReadString(line) ) // foreach line
@@ -366,7 +366,7 @@ bool BMSLoader::LoadFromDir( CString sDir, Song &out )
const int iNumNotesInThisMeasure = arrayNotes.GetSize();
//LOG->Trace( "%s:%s: iMeasureNo = %d, iBMSTrackNo = %d, iNumNotesInThisMeasure = %d",
// valuename, sNoteData, iMeasureNo, iBMSTrackNo, iNumNotesInThisMeasure );
// valuename.GetString(), sNoteData.GetString(), iMeasureNo, iBMSTrackNo, iNumNotesInThisMeasure );
for( int j=0; j<iNumNotesInThisMeasure; j++ )
{
if( arrayNotes[j] == 0 )
@@ -415,7 +415,7 @@ bool BMSLoader::LoadFromDir( CString sDir, Song &out )
// open the song file again and and look for this tag's value
CStdioFile file;
if( !file.Open( sPath, CFile::modeRead|CFile::shareDenyNone ) )
throw RageException( "Failed to open %s for reading.", sPath );
throw RageException( "Failed to open %s for reading.", sPath.GetString() );
CString line;
while( file.ReadString(line) ) // foreach line
@@ -454,7 +454,7 @@ bool BMSLoader::LoadFromDir( CString sDir, Song &out )
if( fBPM == -1 ) // we didn't find the line we were looking for
{
LOG->Trace( "WARNING: Couldn't find tag '%s' in '%s'.", sTagToLookFor, sPath );
LOG->Trace( "WARNING: Couldn't find tag '%s' in '%s'.", sTagToLookFor.GetString(), sPath.GetString() );
}
else
{
@@ -477,7 +477,7 @@ bool BMSLoader::LoadFromDir( CString sDir, Song &out )
// open the song file again and and look for this tag's value
CStdioFile file;
if( !file.Open( sPath, CFile::modeRead|CFile::shareDenyNone ) )
throw RageException( "Failed to open %s for reading.", sPath );
throw RageException( "Failed to open %s for reading.", sPath.GetString() );
CString line;
while( file.ReadString(line) ) // foreach line
@@ -531,7 +531,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, sPath );
LOG->Trace( "WARNING: Couldn't find tag '%s' in '%s'.", sTagToLookFor.GetString(), sPath.GetString() );
}
else
{
+4 -4
View File
@@ -244,13 +244,13 @@ bool DWILoader::LoadFromDWITokens(
bool DWILoader::LoadFromDWIFile( CString sPath, Song &out )
{
LOG->Trace( "Song::LoadFromDWIFile(%s)", sPath );
LOG->Trace( "Song::LoadFromDWIFile(%s)", sPath.GetString() );
MsdFile msd;
bool bResult = msd.ReadFile( sPath );
if( !bResult )
throw RageException( "Error opening file '%s' for reading.", sPath );
throw RageException( "Error opening file '%s' for reading.", sPath.GetString() );
for( int i=0; i<msd.m_iNumValues; i++ )
{
@@ -329,7 +329,7 @@ bool DWILoader::LoadFromDWIFile( CString sPath, Song &out )
CStringArray arrayBPMChangeValues;
split( arrayBPMChangeExpressions[b], "=", arrayBPMChangeValues );
if(arrayBPMChangeValues.GetSize() != 2) {
LOG->Warn( "Invalid CHANGEBPM: \"%s\"", arrayBPMChangeExpressions[b]);
LOG->Warn( "Invalid CHANGEBPM: '%s'", arrayBPMChangeExpressions[b].GetString());
continue;
}
float fIndex = (float)atof( arrayBPMChangeValues[0] ) * ROWS_PER_BEAT / 4.0f;
@@ -378,7 +378,7 @@ bool DWILoader::LoadFromDir( CString sPath, Song &out )
GetApplicableFiles( sPath, aFileNames );
if( aFileNames.GetSize() > 1 )
throw RageException( "There is more than one DWI file in '%s'. There should be only one!", sPath );
throw RageException( "There is more than one DWI file in '%s'. There should be only one!", sPath.GetString() );
/* We should have exactly one; if we had none, we shouldn't have been
* called to begin with. */
+7 -7
View File
@@ -11,12 +11,12 @@
bool KSFLoader::LoadFromKSFFile( const CString &sPath, Notes &out )
{
LOG->Trace( "Notes::LoadFromKSFFile( '%s' )", sPath );
LOG->Trace( "Notes::LoadFromKSFFile( '%s' )", sPath.GetString() );
MsdFile msd;
bool bResult = msd.ReadFile( sPath );
if( !bResult )
throw RageException( "Error opening file '%s'.", sPath );
throw RageException( "Error opening file '%s'.", sPath.GetString() );
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, iTickCount );
LOG->Warn( "%s:\nTICKCOUNT not found; defaulting to %i", sPath.GetString(), iTickCount );
}
NoteData notedata; // read it into here
@@ -146,13 +146,13 @@ void KSFLoader::GetApplicableFiles( CString sPath, CStringArray &out )
bool KSFLoader::LoadFromDir( CString sDir, Song &out )
{
LOG->Trace( "Song::LoadFromKSFDir(%s)", sDir );
LOG->Trace( "Song::LoadFromKSFDir(%s)", sDir.GetString() );
CStringArray arrayKSFFileNames;
GetDirListing( sDir + CString("*.ksf"), arrayKSFFileNames );
if( arrayKSFFileNames.GetSize() == 0 )
throw RageException( "Couldn't find any KSF files in '%s'", sDir );
throw RageException( "Couldn't find any KSF files in '%s'", sDir.GetString() );
// load the Notes from the rest of the KSF files
for( int i=0; i<arrayKSFFileNames.GetSize(); i++ )
@@ -167,7 +167,7 @@ bool KSFLoader::LoadFromDir( CString sDir, Song &out )
MsdFile msd;
bool bResult = msd.ReadFile( sPath );
if( !bResult )
throw RageException( "Error opening file '%s'.", sPath );
throw RageException( "Error opening file '%s'.", sPath.GetString() );
for( i=0; i<msd.m_iNumValues; i++ )
{
@@ -238,7 +238,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 );
LOG->Trace( "Unexpected value named '%s'", sValueName.GetString() );
}
// search for music with song in the file name
+6 -6
View File
@@ -49,7 +49,7 @@ void SMLoader::GetApplicableFiles( CString sPath, CStringArray &out )
bool SMLoader::LoadFromSMFile( CString sPath, Song &out )
{
LOG->Trace( "Song::LoadFromSMDir(%s)", sPath );
LOG->Trace( "Song::LoadFromSMDir(%s)", sPath.GetString() );
out.m_BPMSegments.clear();
out.m_StopSegments.clear();
@@ -59,7 +59,7 @@ bool SMLoader::LoadFromSMFile( CString sPath, Song &out )
MsdFile msd;
bool bResult = msd.ReadFile( sPath );
if( !bResult )
throw RageException( "Error opening file '%s'.", sPath );
throw RageException( "Error opening file '%s'.", sPath.GetString() );
for( i=0; i<msd.m_iNumValues; i++ )
{
@@ -131,7 +131,7 @@ bool SMLoader::LoadFromSMFile( CString sPath, Song &out )
else if(!stricmp(sParams[1],"ROULETTE"))
out.m_SelectionDisplay = out.SHOW_ROULETTE;
else
LOG->Warn( "The song file '%s' has an unknown #SELECTABLE value, \"%s\"; ignored.", sPath, sParams[1]);
LOG->Warn( "The song file '%s' has an unknown #SELECTABLE value, '%s'; ignored.", sPath.GetString(), sParams[1].GetString());
}
else if( 0==stricmp(sValueName,"STOPS") || 0==stricmp(sValueName,"FREEZES") )
@@ -201,7 +201,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, iNumParams, 7 );
LOG->Trace( "The song file '%s' is has %d fields in a #NOTES tag, but should have %d.", sPath.GetString(), iNumParams, 7 );
}
else
{
@@ -217,7 +217,7 @@ bool SMLoader::LoadFromSMFile( CString sPath, Song &out )
}
else
LOG->Trace( "Unexpected value named '%s'", sValueName );
LOG->Trace( "Unexpected value named '%s'", sValueName.GetString() );
}
return true;
@@ -230,7 +230,7 @@ bool SMLoader::LoadFromDir( CString sPath, Song &out )
GetApplicableFiles( sPath, aFileNames );
if( aFileNames.GetSize() > 1 )
throw RageException( "There is more than one SM file in '%s'. There should be only one!", sPath );
throw RageException( "There is more than one SM file in '%s'. There should be only one!", sPath.GetString() );
/* We should have exactly one; if we had none, we shouldn't have been
* called to begin with. */
+3 -3
View File
@@ -216,12 +216,12 @@ bool NotesWriterDWI::Write( CString sPath, const Song &out )
{
FILE* fp = fopen( sPath, "w" );
if( fp == NULL )
throw RageException( "Error opening song file '%s' for writing.", sPath );
throw RageException( "Error opening song file '%s' for writing.", sPath.GetString() );
if(out.GetFullTitle().GetLength() != 0)
fprintf( fp, "#TITLE:%s;\n", out.GetFullTitle() );
fprintf( fp, "#TITLE:%s;\n", out.GetFullTitle().GetString() );
if(out.m_sArtist.GetLength() != 0)
fprintf( fp, "#ARTIST:%s;\n", out.m_sArtist );
fprintf( fp, "#ARTIST:%s;\n", out.m_sArtist.GetString() );
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 )) );
+1 -1
View File
@@ -79,7 +79,7 @@ int OptionToPreferredColumn( CString sOptionText )
if( g_OptionColumnEntries[i].szString == sOptionText )
return g_OptionColumnEntries[i].iSlotIndex;
LOG->Warn("Unknown option: \"%s\"", sOptionText );
LOG->Warn("Unknown option: '%s'", sOptionText.GetString() );
return -1;
}
+6 -6
View File
@@ -222,7 +222,7 @@ void RageBitmapTexture::Create(
D3DPOOL_MANAGED, // which memory pool
&m_pd3dTexture) ))
{
throw RageException( hr, "CreateTexture() failed for file '%s'.", m_sFilePath );
throw RageException( hr, "CreateTexture() failed for file '%s'.", m_sFilePath.GetString() );
}
{
@@ -297,7 +297,7 @@ void RageBitmapTexture::Create(
{
D3DLOCKED_RECT d3dlr;
if( FAILED( hr=m_pd3dTexture->LockRect(0, &d3dlr, 0, 0) ) )
throw RageException( hr, "LockRect failed for file '%s'.", m_sFilePath );
throw RageException( hr, "LockRect failed for file '%s'.", m_sFilePath.GetString() );
memcpy( (byte *)(d3dlr.pBits), img->pixels, img->h*img->pitch );
ASSERT( !FAILED( m_pd3dTexture->UnlockRect(0) ) ) ;
@@ -305,7 +305,7 @@ void RageBitmapTexture::Create(
SDL_FreeSurface(img);
LOG->Trace( "RageBitmapTexture: Loaded '%s' (%ux%u) from disk. bStretch = %d, source %d,%d; image %d,%d.",
m_sFilePath, GetTextureWidth(), GetTextureHeight(),
m_sFilePath.GetString(), GetTextureWidth(), GetTextureHeight(),
bStretch, m_iSourceWidth, m_iSourceHeight,
m_iImageWidth, m_iImageHeight);
}
@@ -347,7 +347,7 @@ void RageBitmapTexture::Create(
D3DXIMAGE_INFO ddii;
if( FAILED( hr = D3DXGetImageInfoFromFile(m_sFilePath,&ddii) ) )
{
throw RageException( hr, "D3DXGetImageInfoFromFile() failed for file '%s'.", m_sFilePath );
throw RageException( hr, "D3DXGetImageInfoFromFile() failed for file '%s'.", m_sFilePath.GetString() );
}
@@ -402,7 +402,7 @@ void RageBitmapTexture::Create(
::Sleep( 10 );
continue;
}
throw RageException( hr, "D3DXCreateTextureFromFileEx() failed for file '%s'.", m_sFilePath );
throw RageException( hr, "D3DXCreateTextureFromFileEx() failed for file '%s'.", m_sFilePath.GetString() );
}
else
break;
@@ -435,7 +435,7 @@ void RageBitmapTexture::Create(
}
LOG->Trace( "RageBitmapTexture: Loaded '%s' (%ux%u) from disk. bStretch = %d, source %d,%d; image %d,%d.",
m_sFilePath,
m_sFilePath.GetString(),
GetTextureWidth(),
GetTextureHeight(),
bStretch,
+4 -4
View File
@@ -71,8 +71,8 @@ void RageLog::Trace( const char *fmt, ...)
CString sBuff = vssprintf( fmt, va );
va_end(va);
fprintf( m_fileLog, "%s\n", sBuff );
printf( "%s\n", sBuff );
fprintf( m_fileLog, "%s\n", sBuff.GetString() );
printf( "%s\n", sBuff.GetString() );
CrashLog(sBuff);
#ifdef DEBUG
@@ -88,7 +88,7 @@ void RageLog::Trace( HRESULT hr, const char *fmt, ...)
va_end(va);
s += ssprintf( "(%s)", DXGetErrorString8(hr) );
this->Trace( "%s", s );
this->Trace( "%s", s.GetString() );
}
void RageLog::Warn( const char *fmt, ...)
@@ -101,7 +101,7 @@ void RageLog::Warn( const char *fmt, ...)
Trace( "/////////////////////////////////////////\n"
"WARNING: %s\n"
"/////////////////////////////////////////",
sBuff );
sBuff.GetString() );
}
void RageLog::Flush()
+8 -8
View File
@@ -42,7 +42,7 @@ RageTextureManager::~RageTextureManager()
{
RageTexture* pTexture = i->second;
if( pTexture->m_iRefCount )
LOG->Trace( "TEXTUREMAN LEAK: '%s', RefCount = %d.", i->first, pTexture->m_iRefCount );
LOG->Trace( "TEXTUREMAN LEAK: '%s', RefCount = %d.", i->first.GetString(), pTexture->m_iRefCount );
SAFE_DELETE( pTexture );
}
}
@@ -55,7 +55,7 @@ RageTexture* RageTextureManager::LoadTexture( CString sTexturePath, bool bForceR
{
sTexturePath.MakeLower();
// LOG->Trace( "RageTextureManager::LoadTexture(%s).", sTexturePath );
// LOG->Trace( "RageTextureManager::LoadTexture(%s).", sTexturePath.GetString() );
// holder for the new texture
RageTexture* pTexture;
@@ -73,7 +73,7 @@ RageTexture* RageTextureManager::LoadTexture( CString sTexturePath, bool bForceR
if( bForceReload )
pTexture->Reload( m_iMaxTextureSize, m_iTextureColorDepth, iMipMaps, iAlphaBits, bDither, bStretch );
// LOG->Trace( "RageTextureManager: '%s' now has %d references.", sTexturePath, pTexture->m_iRefCount );
// LOG->Trace( "RageTextureManager: '%s' now has %d references.", sTexturePath.GetString(), pTexture->m_iRefCount );
}
else // the texture is not already loaded
{
@@ -85,7 +85,7 @@ RageTexture* RageTextureManager::LoadTexture( CString sTexturePath, bool bForceR
else
pTexture = new RageBitmapTexture( m_pScreen, sTexturePath, m_iMaxTextureSize, m_iTextureColorDepth, iMipMaps, iAlphaBits, bDither, bStretch );
LOG->Trace( "RageTextureManager: Finished loading '%s'.", sTexturePath );
LOG->Trace( "RageTextureManager: Finished loading '%s'.", sTexturePath.GetString() );
m_mapPathToTexture[sTexturePath] = pTexture;
}
@@ -140,7 +140,7 @@ void RageTextureManager::UnloadTexture( CString sTexturePath )
{
sTexturePath.MakeLower();
// LOG->Trace( "RageTextureManager::UnloadTexture(%s).", sTexturePath );
// LOG->Trace( "RageTextureManager::UnloadTexture(%s).", sTexturePath.GetString() );
if( sTexturePath == "" )
{
@@ -150,7 +150,7 @@ void RageTextureManager::UnloadTexture( CString sTexturePath )
std::map<CString, RageTexture*>::iterator p = m_mapPathToTexture.find(sTexturePath);
if(p == m_mapPathToTexture.end())
throw RageException( "Tried to Unload texture '%s' that wasn't loaded.", sTexturePath );
throw RageException( "Tried to Unload texture '%s' that wasn't loaded.", sTexturePath.GetString() );
RageTexture* pTexture = p->second;
pTexture->m_iRefCount--;
@@ -168,14 +168,14 @@ void RageTextureManager::UnloadTexture( CString sTexturePath )
if( pTexture->m_iRefCount == 0 &&
(pTexture->IsAMovie() || !m_iSecondsBeforeUnload ))
{
// LOG->Trace( "RageTextureManager: '%s' will be deleted. It has %d references.", sTexturePath, pTexture->m_iRefCount );
// LOG->Trace( "RageTextureManager: '%s' will be deleted. It has %d references.", sTexturePath.GetString(), pTexture->m_iRefCount );
SAFE_DELETE( pTexture ); // free the texture
m_mapPathToTexture.erase(p); // and remove the key in the map
}
GCTextures();
//LOG->Trace( "RageTextureManager: '%s' will not be deleted. It still has %d references.", sTexturePath, pTexture->m_iRefCount );
//LOG->Trace( "RageTextureManager: '%s' will not be deleted. It still has %d references.", sTexturePath.GetString(), pTexture->m_iRefCount );
}
void RageTextureManager::ReloadAll()
+1 -1
View File
@@ -51,7 +51,7 @@ bool RandomSample::LoadSoundDir( CString sDir )
bool RandomSample::LoadSound( CString sSoundFilePath )
{
LOG->Trace( "RandomSample::LoadSound( %s )", sSoundFilePath );
LOG->Trace( "RandomSample::LoadSound( %s )", sSoundFilePath.GetString() );
RageSoundSample* pSS = new RageSoundSample;
pSS->Load( sSoundFilePath );
+5 -5
View File
@@ -516,14 +516,14 @@ void ScreenEdit::Update( float fDeltaTime )
"Assist tick is %s\n"
"MusicOffsetSeconds: %.2f\n"
"Preview start: %.2f, length = %.2f\n",
sNoteType,
sNoteType.GetString(),
GAMESTATE->m_fSongBeat,
m_NoteFieldEdit.m_fBeginMarker, m_NoteFieldEdit.m_fEndMarker,
GAMESTATE->m_SongOptions.m_fMusicRate,
DifficultyToString( m_pNotes->m_Difficulty ),
GAMESTATE->m_pCurNotes[PLAYER_1] ? GAMESTATE->m_pCurNotes[PLAYER_1]->m_sDescription : "no description",
m_pSong->m_sMainTitle,
m_pSong->m_sSubTitle,
DifficultyToString( m_pNotes->m_Difficulty ).GetString(),
GAMESTATE->m_pCurNotes[PLAYER_1] ? GAMESTATE->m_pCurNotes[PLAYER_1]->m_sDescription.GetString() : "no description",
m_pSong->m_sMainTitle.GetString(),
m_pSong->m_sSubTitle.GetString(),
iNumTapNotes, iNumHoldNotes,
GAMESTATE->m_SongOptions.m_AssistType==SongOptions::ASSIST_TICK ? "ON" : "OFF",
m_pSong->m_fBeat0OffsetInSeconds,
+2 -2
View File
@@ -197,7 +197,7 @@ void ScreenEz2SelectStyle::RefreshModeChoices()
const ModeChoice& choice = m_aPossibleModeChoices[i];
if( choice.numSidesJoinedToPlay == iNumSidesJoined )
asGraphicPaths.Add( THEME->GetPathTo("Graphics", ssprintf("select mode %s %s", sGameName, choice.name) ) );
asGraphicPaths.Add( THEME->GetPathTo("Graphics", ssprintf("select mode %s %s", sGameName.GetString(), choice.name) ) );
}
m_ScrollingList.Load( asGraphicPaths );
@@ -221,7 +221,7 @@ void ScreenEz2SelectStyle::AfterChange()
CString sGameName = GAMESTATE->GetCurrentGameDef()->m_szName;
const ModeChoice& choice = m_aPossibleModeChoices[ m_ScrollingList.GetSelection() ];
if( CHANGE_BG_ANIMATIONS )
m_Menu.m_Background.LoadFromAniDir( THEME->GetPathTo("BGAnimations",ssprintf("select mode %s %s", sGameName, choice.name)) );
m_Menu.m_Background.LoadFromAniDir( THEME->GetPathTo("BGAnimations",ssprintf("select mode %s %s", sGameName.GetString(), choice.name)) );
}
void ScreenEz2SelectStyle::MenuLeft( PlayerNumber pn )
+1 -1
View File
@@ -1032,7 +1032,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->GetFullTitle() );
GAMESTATE->m_pCurSong->GetFullTitle().GetString() );
break;
case PLAY_MODE_ONI:
case PLAY_MODE_ENDLESS:
+2 -2
View File
@@ -223,7 +223,7 @@ Screen* ScreenManager::MakeNewScreen( CString sClassName )
// else if( 0==stricmp(sClassName, "ScreenEz2SelectMusic") ) return new ScreenEz2SelectMusic;
else if( 0==stricmp(sClassName, "ScreenNetworkGame") ) return new ScreenNetworkGame;
else
throw RageException( "Invalid Screen class name '%s'", sClassName );
throw RageException( "Invalid Screen class name '%s'", sClassName.GetString() );
}
void ScreenManager::PrepNewScreen( CString sClassName )
@@ -264,7 +264,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, t.GetDeltaTime());
LOG->Trace( "Loaded %s in %f", sClassName.GetString(), t.GetDeltaTime());
SetNewScreen( pNewScreen );
}
+2 -2
View File
@@ -240,7 +240,7 @@ void ScreenSelectMode::RefreshModeChoices()
for( i=0; i<m_aPossibleModeChoices.GetSize(); i++ )
{
const ModeChoice& choice = m_aPossibleModeChoices[i];
asGraphicPaths.Add( THEME->GetPathTo("Graphics", ssprintf("select mode choice %s %s", sGameName, choice.name) ) );
asGraphicPaths.Add( THEME->GetPathTo("Graphics", ssprintf("select mode choice %s %s", sGameName.GetString(), choice.name) ) );
}
m_ScrollingList.Load( asGraphicPaths );
@@ -253,7 +253,7 @@ void ScreenSelectMode::RefreshModeChoices()
for( int i=0; i<m_aPossibleModeChoices.GetSize(); i++ )
{
CString sChoiceName = m_aPossibleModeChoices[i].name;
m_BGAnimations[i].LoadFromAniDir( THEME->GetPathTo("BGAnimations",ssprintf("select mode %s %s", sGameName, sChoiceName)) );
m_BGAnimations[i].LoadFromAniDir( THEME->GetPathTo("BGAnimations",ssprintf("select mode %s %s", sGameName.GetString(), sChoiceName.GetString())) );
}
}
}
+19 -19
View File
@@ -267,7 +267,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 );
LOG->Warn( "Couldn't find any SM, DWI, BMS, or KSF files in '%s'. This is not a valid song directory.", sDir.GetString() );
return false;
}
@@ -288,7 +288,7 @@ bool Song::LoadWithoutCache( CString sDir )
bool Song::LoadFromSongDir( CString sDir )
{
LOG->Trace( "Song::LoadFromSongDir(%s)", sDir );
LOG->Trace( "Song::LoadFromSongDir(%s)", sDir.GetString() );
// make sure there is a trailing '\\' at the end of sDir
if( sDir.Right(1) != "\\" )
@@ -309,7 +309,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, GetCacheFilePath() );
LOG->Trace( "Loading '%s' from cache file '%s'.", m_sSongDir.GetString(), GetCacheFilePath().GetString() );
SMLoader ld;
ld.LoadFromSMFile( GetCacheFilePath(), *this );
}
@@ -371,7 +371,7 @@ void Song::TidyUpData()
m_sSubTitle.TrimRight();
if( m_sArtist == "" ) m_sArtist = "Unknown artist";
if( m_BPMSegments.GetSize() == 0 )
throw RageException( "No #BPM specified in '%s.'", m_sSongDir+m_sSongFileName );
throw RageException( "No #BPM specified in '%s%s.'", m_sSongDir.GetString(), m_sSongFileName.GetString() );
if( !HasMusic() )
{
@@ -384,7 +384,7 @@ void Song::TidyUpData()
m_sMusicFile = arrayPossibleMusic[0];
// Don't throw on missing music. -Chris
// else
// throw RageException( "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 );
// throw RageException( "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() );
}
if( HasMusic() )
@@ -641,25 +641,25 @@ void Song::Save()
void Song::SaveToSMFile( CString sPath, bool bSavingCache )
{
LOG->Trace( "Song::SaveToSMDir('%s')", sPath );
LOG->Trace( "Song::SaveToSMDir('%s')", sPath.GetString() );
int i;
FILE* fp = fopen( sPath, "w" );
if( fp == NULL )
throw RageException( "Error opening song file '%s' for writing.", sPath );
throw RageException( "Error opening song file '%s' for writing.", sPath.GetString() );
fprintf( fp, "#TITLE:%s;\n", m_sMainTitle );
fprintf( fp, "#SUBTITLE:%s;\n", m_sSubTitle );
fprintf( fp, "#ARTIST:%s;\n", m_sArtist );
fprintf( fp, "#TITLETRANSLIT:%s;\n", m_sMainTitleTranslit );
fprintf( fp, "#SUBTITLETRANSLIT:%s;\n", m_sSubTitleTranslit );
fprintf( fp, "#ARTISTTRANSLIT:%s;\n", m_sArtistTranslit );
fprintf( fp, "#CREDIT:%s;\n", m_sCredit );
fprintf( fp, "#BANNER:%s;\n", m_sBannerFile );
fprintf( fp, "#BACKGROUND:%s;\n", m_sBackgroundFile );
fprintf( fp, "#CDTITLE:%s;\n", m_sCDTitleFile );
fprintf( fp, "#MUSIC:%s;\n", m_sMusicFile );
fprintf( fp, "#TITLE:%s;\n", m_sMainTitle.GetString() );
fprintf( fp, "#SUBTITLE:%s;\n", m_sSubTitle.GetString() );
fprintf( fp, "#ARTIST:%s;\n", m_sArtist.GetString() );
fprintf( fp, "#TITLETRANSLIT:%s;\n", m_sMainTitleTranslit.GetString() );
fprintf( fp, "#SUBTITLETRANSLIT:%s;\n", m_sSubTitleTranslit.GetString() );
fprintf( fp, "#ARTISTTRANSLIT:%s;\n", m_sArtistTranslit.GetString() );
fprintf( fp, "#CREDIT:%s;\n", m_sCredit.GetString() );
fprintf( fp, "#BANNER:%s;\n", m_sBannerFile.GetString() );
fprintf( fp, "#BACKGROUND:%s;\n", m_sBackgroundFile.GetString() );
fprintf( fp, "#CDTITLE:%s;\n", m_sCDTitleFile.GetString() );
fprintf( fp, "#MUSIC:%s;\n", m_sMusicFile.GetString() );
fprintf( fp, "#MUSICBYTES:%u;\n", m_iMusicBytes );
fprintf( fp, "#MUSICLENGTH:%.3f;\n", m_fMusicLengthSeconds );
if(bSavingCache) {
@@ -708,7 +708,7 @@ void Song::SaveToSMFile( CString sPath, bool bSavingCache )
{
BackgroundChange &seg = m_BackgroundChanges[i];
fprintf( fp, "%.3f=%s", seg.m_fStartBeat, seg.m_sBGName );
fprintf( fp, "%.3f=%s", seg.m_fStartBeat, seg.m_sBGName.GetString() );
if( i != m_BackgroundChanges.GetSize()-1 )
fprintf( fp, "," );
}
+24 -24
View File
@@ -69,16 +69,16 @@ void SongManager::SanityCheckGroupDir( CString sDir ) const
{
// Check to see if they put a song directly inside the group folder.
CStringArray arrayFiles;
GetDirListing( ssprintf("%s\\*.mp3", sDir), arrayFiles );
GetDirListing( ssprintf("%s\\*.ogg", sDir), arrayFiles );
GetDirListing( ssprintf("%s\\*.wav", sDir), arrayFiles );
GetDirListing( sDir + "\\*.mp3", arrayFiles );
GetDirListing( sDir + "\\*.ogg", arrayFiles );
GetDirListing( sDir + "\\*.wav", arrayFiles );
if( arrayFiles.GetSize() > 0 )
throw RageException(
ssprintf( "The folder '%s' contains music files.\n\n"
"This probably means that you have a song outside of a group 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.",
ssprintf("%s\\%s", sDir ) )
"The folder '%s' contains music files.\n\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"
"See the StepMania readme for more info.",
sDir.GetString()
);
}
@@ -94,16 +94,16 @@ void SongManager::AddGroup( CString sDir, CString sGroupDirName )
// Look for a group banner in this group folder
CStringArray arrayGroupBanners;
GetDirListing( ssprintf("%s\\%s\\*.png", sDir, sGroupDirName), arrayGroupBanners );
GetDirListing( ssprintf("%s\\%s\\*.jpg", sDir, sGroupDirName), arrayGroupBanners );
GetDirListing( ssprintf("%s\\%s\\*.gif", sDir, sGroupDirName), arrayGroupBanners );
GetDirListing( ssprintf("%s\\%s\\*.bmp", sDir, sGroupDirName), arrayGroupBanners );
GetDirListing( ssprintf("%s\\%s\\*.png", sDir.GetString(), sGroupDirName.GetString()), arrayGroupBanners );
GetDirListing( ssprintf("%s\\%s\\*.jpg", sDir.GetString(), sGroupDirName.GetString()), arrayGroupBanners );
GetDirListing( ssprintf("%s\\%s\\*.gif", sDir.GetString(), sGroupDirName.GetString()), arrayGroupBanners );
GetDirListing( ssprintf("%s\\%s\\*.bmp", sDir.GetString(), sGroupDirName.GetString()), arrayGroupBanners );
CString sBannerPath;
if( arrayGroupBanners.GetSize() > 0 )
{
sBannerPath = ssprintf("%s\\%s\\%s", sDir, sGroupDirName, arrayGroupBanners[0] );
LOG->Trace( ssprintf("Group banner for '%s' is '%s'.", sGroupDirName, sBannerPath) );
sBannerPath = ssprintf("%s\\%s\\%s", sDir.GetString(), sGroupDirName.GetString(), arrayGroupBanners[0].GetString() );
LOG->Trace( "Group banner for '%s' is '%s'.", sGroupDirName.GetString(), sBannerPath.GetString() );
}
m_arrayGroupNames.Add( sGroupDirName );
@@ -131,7 +131,7 @@ void SongManager::LoadStepManiaSongDir( CString sDir, void(*callback)() )
// Find all Song folders in this group directory
CStringArray arraySongDirs;
GetDirListing( ssprintf("%s\\%s\\*.*", sDir, sGroupDirName), arraySongDirs, true );
GetDirListing( ssprintf("%s\\%s\\*.*", sDir.GetString(), sGroupDirName.GetString()), arraySongDirs, true );
SortCStringArray( arraySongDirs );
int j;
@@ -145,11 +145,11 @@ void SongManager::LoadStepManiaSongDir( CString sDir, void(*callback)() )
continue; // ignore it
// this is a song directory. Load a new song!
GAMESTATE->m_sLoadingMessage = ssprintf("Loading songs...\n%s\n%s", sGroupDirName, sSongDirName);
GAMESTATE->m_sLoadingMessage = ssprintf("Loading songs...\n%s\n%s", sGroupDirName.GetString(), sSongDirName.GetString());
if( callback )
callback();
Song* pNewSong = new Song;
if( !pNewSong->LoadFromSongDir( ssprintf("%s\\%s\\%s", sDir, sGroupDirName, sSongDirName) ) ) {
if( !pNewSong->LoadFromSongDir( ssprintf("%s\\%s\\%s", sDir.GetString(), sGroupDirName.GetString(), sSongDirName.GetString()) ) ) {
/* The song failed to load. */
delete pNewSong;
continue;
@@ -189,7 +189,7 @@ void SongManager::LoadDWISongDir( CString DWIHome )
// now we've got the listing of the mix directories
// and we need to use THOSE directories to find our
// dwis
GetDirListing( ssprintf("%s\\Songs\\*.*", DWIHome ), MixDirs, true );
GetDirListing( ssprintf("%s\\Songs\\*.*", DWIHome ), MixDirs.GetString(), true );
SortCStringArray( MixDirs );
for( int i=0; i< MixDirs.GetSize(); i++ ) // for each dir in /Songs/
@@ -200,14 +200,14 @@ void SongManager::LoadDWISongDir( CString DWIHome )
sDirName.MakeLower();
if( sDirName == "cvs" ) // ignore the directory called "CVS"
continue;
GetDirListing( ssprintf("%s\\Songs\\%s\\*.*", DWIHome, MixDirs[i]), arrayDirs, true);
GetDirListing( ssprintf("%s\\Songs\\%s\\*.*", DWIHome.GetString(), MixDirs[i].GetString()), arrayDirs, true);
SortCStringArray(arrayDirs, true);
for( int b = 0; b < arrayDirs.GetSize(); b++)
{
// Find all DWIs in this directory
CStringArray arrayDWIFiles;
GetDirListing( ssprintf("%s\\Songs\\%s\\%s\\*.dwi", DWIHome, MixDirs[i], arrayDirs[b]), arrayDWIFiles, false);
GetDirListing( ssprintf("%s\\Songs\\%s\\%s\\*.dwi", DWIHome.GetString(), MixDirs[i].GetString(), arrayDirs[b].GetString()), arrayDWIFiles, false);
SortCStringArray( arrayDWIFiles );
for( int j=0; j< arrayDWIFiles.GetSize(); j++ ) // for each DWI file
@@ -219,7 +219,7 @@ void SongManager::LoadDWISongDir( CString DWIHome )
DWILoader ld;
Song* pNewSong = new Song;
ld.LoadFromDWIFile(
ssprintf("%s\\Songs\\%s\\%s\\%s", DWIHome, MixDirs[i], arrayDirs[b], sDWIFileName),
ssprintf("%s\\Songs\\%s\\%s\\%s", DWIHome.GetString(), MixDirs[i].GetString(), arrayDirs[b].GetString(), sDWIFileName.GetString()),
*pNewSong);
m_pSongs.Add( pNewSong );
}
@@ -252,7 +252,7 @@ void SongManager::ReadStatisticsFromDisk()
IniFile ini;
ini.SetPath( g_sStatisticsFileName );
if( !ini.ReadFile() ) {
LOG->Trace( "WARNING: Could not read config file '%s'.", g_sStatisticsFileName );
LOG->Trace( "WARNING: Could not read config file '%s'.", g_sStatisticsFileName.GetString() );
return; // load nothing
}
@@ -348,11 +348,11 @@ void SongManager::SaveStatisticsToDisk()
// Each value has the format "SongName::NotesName=TimesPlayed::TopGrade::TopScore::MaxCombo".
CString sName = ssprintf( "%s::%s::%s", pSong->m_sSongDir, GameManager::NotesTypeToString(pNotes->m_NotesType), pNotes->m_sDescription );
CString sName = ssprintf( "%s::%s::%s", pSong->m_sSongDir.GetString(), GameManager::NotesTypeToString(pNotes->m_NotesType).GetString(), pNotes->m_sDescription.GetString() );
CString sValue = ssprintf(
"%d::%s::%d::%d",
pNotes->m_iNumTimesPlayed,
GradeToString( pNotes->m_TopGrade ),
GradeToString( pNotes->m_TopGrade ).GetString(),
pNotes->m_iTopScore,
pNotes->m_iMaxCombo
);
+6 -6
View File
@@ -42,7 +42,7 @@ Sprite::~Sprite()
bool Sprite::LoadFromTexture( CString sTexturePath, bool bForceReload, int iMipMaps, int iAlphaBits, bool bDither, bool bStretch )
{
LOG->Trace( ssprintf("Sprite::LoadFromTexture(%s)", sTexturePath) );
LOG->Trace( ssprintf("Sprite::LoadFromTexture(%s)", sTexturePath.GetString()) );
//Init();
return LoadTexture( sTexturePath, bForceReload, iMipMaps, iAlphaBits, bDither, bStretch );
@@ -58,7 +58,7 @@ bool Sprite::LoadFromTexture( CString sTexturePath, bool bForceReload, int iMipM
// Delay0000=2.0
bool Sprite::LoadFromSpriteFile( CString sSpritePath, bool bForceReload, int iMipMaps, int iAlphaBits, bool bDither, bool bStretch )
{
LOG->Trace( ssprintf("Sprite::LoadFromSpriteFile(%s)", sSpritePath) );
LOG->Trace( ssprintf("Sprite::LoadFromSpriteFile(%s)", sSpritePath.GetString()) );
//Init();
@@ -77,17 +77,17 @@ bool Sprite::LoadFromSpriteFile( CString sSpritePath, bool bForceReload, int iMi
IniFile ini;
ini.SetPath( m_sSpritePath );
if( !ini.ReadFile() )
throw RageException( "Error opening Sprite file '%s'.", m_sSpritePath );
throw RageException( "Error opening Sprite file '%s'.", m_sSpritePath.GetString() );
CString sTextureFile;
ini.GetValue( "Sprite", "Texture", sTextureFile );
if( sTextureFile == "" )
throw RageException( "Error reading value 'Texture' from %s.", m_sSpritePath );
throw RageException( "Error reading value 'Texture' from %s.", m_sSpritePath.GetString() );
CString sTexturePath = sFontDir + sTextureFile; // save the path of the new texture
if( !DoesFileExist(sTexturePath) )
throw RageException( "The sprite file '%s' points to a texture '%s' which doesn't exist.", m_sSpritePath, sTexturePath );
throw RageException( "The sprite file '%s' points to a texture '%s' which doesn't exist.", m_sSpritePath.GetString(), sTexturePath.GetString() );
@@ -108,7 +108,7 @@ bool Sprite::LoadFromSpriteFile( CString sSpritePath, bool bForceReload, int iMi
break;
if( m_iStateToFrame[i] >= m_pTexture->GetNumFrames() )
throw RageException( "In '%s', %s is %d, but the texture %s only has %d frames.",
m_sSpritePath, sFrameKey, m_iStateToFrame[i], sTexturePath, m_pTexture->GetNumFrames() );
m_sSpritePath.GetString(), sFrameKey.GetString(), m_iStateToFrame[i], sTexturePath, m_pTexture->GetNumFrames() );
m_fDelay[i] = 0.2f;
if( !ini.GetValueF( "Sprite", sDelayKey, m_fDelay[i] ) )
break;
+7 -4
View File
@@ -220,6 +220,9 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE, LPSTR CmdLine, int nCmdShow
SetCurrentDirectory( szFullAppPath );
}
/*
This was a stupid idea... -Chris
//
// Check for packages in the AutoInstall folder
//
@@ -227,7 +230,7 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE, LPSTR CmdLine, int nCmdShow
GetDirListing( "AutoInstall\\*.smzip", asPackagePaths, false, true );
for( i=0; i<asPackagePaths.GetSize(); i++ )
{
CString sCommandLine = ssprintf( "smpackage.exe %s", asPackagePaths[i] );
CString sCommandLine = ssprintf( "smpackage.exe %s", asPackagePaths[i].GetString() );
PROCESS_INFORMATION pi;
STARTUPINFO si;
@@ -246,7 +249,7 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE, LPSTR CmdLine, int nCmdShow
&pi // pointer to PROCESS_INFORMATION
);
}
*/
CoInitialize (NULL); // Initialize COM
@@ -360,7 +363,7 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE, LPSTR CmdLine, int nCmdShow
"Exception: %s\n"
"//////////////////////////////////////////////////////\n"
"\n",
g_sErrorString
g_sErrorString.GetString()
);
}
@@ -1040,7 +1043,7 @@ void ApplyGraphicOptions()
iDisplayHeight,
iTextureSize,
iTextureSize,
bWindowed ? "" : ssprintf(", %dHz", iRefreshRate)
bWindowed ? "" : ssprintf(", %dHz", iRefreshRate).GetString()
);
//
+13 -13
View File
@@ -163,7 +163,7 @@ try_element_again:
if( asPossibleElementFilePaths.GetSize() == 0 )
{
#ifdef _DEBUG
switch( AfxMessageBox( ssprintf("The theme element %s/%s is missing.",sAssetCategory,sFileName), MB_ABORTRETRYIGNORE ) )
switch( AfxMessageBox( ssprintf("The theme element %s/%s is missing.",sAssetCategory.GetString(),sFileName.GetString()), MB_ABORTRETRYIGNORE ) )
{
case IDRETRY:
goto try_element_again;
@@ -171,16 +171,16 @@ try_element_again:
case IDABORT:
#endif
throw RageException( "Theme element '%s/%s' could not be found in '%s' or '%s'.",
sAssetCategory,
sFileName,
sAssetCategory.GetString(),
sFileName.GetString(),
GetThemeDirFromName(m_sCurThemeName),
GetThemeDirFromName(BASE_THEME_NAME) );
#ifdef _DEBUG
case IDIGNORE:
LOG->Warn(
"Theme element '%s/%s' could not be found in '%s' or '%s'.",
sAssetCategory,
sFileName,
sAssetCategory.GetString(),
sFileName.GetString(),
GetThemeDirFromName(m_sCurThemeName),
GetThemeDirFromName(BASE_THEME_NAME) );
return GetPathTo( sAssetCategory, "_missing" );
@@ -207,10 +207,10 @@ try_element_again:
if( sNewFileName == "" || !DoesFileExist(sNewFilePath) )
{
#ifdef _DEBUG
if( IDRETRY == AfxMessageBox( ssprintf("The redirect '%s' points to the file '%s', which does not exist. Verify that this redirect is correct.", sRedirFilePath, sNewFilePath), MB_RETRYCANCEL ) )
if( IDRETRY == AfxMessageBox( ssprintf("The redirect '%s' points to the file '%s', which does not exist. Verify that this redirect is correct.", sRedirFilePath.GetString(), sNewFilePath.GetString()), MB_RETRYCANCEL ) )
goto try_element_again;
#endif
throw RageException( "The redirect '%s' points to the file '%s', which does not exist. Verify that this redirect is correct.", sRedirFilePath, sNewFilePath );
throw RageException( "The redirect '%s' points to the file '%s', which does not exist. Verify that this redirect is correct.", sRedirFilePath.GetString(), sNewFilePath.GetString() );
}
else
return sNewFilePath;
@@ -253,15 +253,15 @@ try_metric_again:
}
#ifdef _DEBUG
if( IDRETRY == AfxMessageBox( ssprintf("The theme metric %s-%s is missing. Correct this and click Retry, or Cancel to break.",sClassName,sValueName), MB_RETRYCANCEL ) )
if( IDRETRY == AfxMessageBox( ssprintf("The theme metric %s-%s is missing. Correct this and click Retry, or Cancel to break.",sClassName.GetString(),sValueName.GetString()), MB_RETRYCANCEL ) )
goto try_metric_again;
#endif
throw RageException( "Theme metric '%s : %s' could not be found in '%s' or '%s'.",
sClassName,
sValueName,
sCurMetricPath,
sDefaultMetricPath
sClassName.GetString(),
sValueName.GetString(),
sCurMetricPath.GetString(),
sDefaultMetricPath.GetString()
);
}
@@ -289,7 +289,7 @@ RageColor ThemeManager::GetMetricC( CString sClassName, CString sValueName )
int result = sscanf( szValue, "%f,%f,%f,%f", &r, &g, &b, &a );
if( result != 4 )
{
LOG->Warn( "The color value '%s' for NoteSkin metric '%s : %s' is invalid.", szValue, sClassName, sValueName );
LOG->Warn( "The color value '%s' for NoteSkin metric '%s : %s' is invalid.", szValue, sClassName.GetString(), sValueName.GetString() );
ASSERT(0);
}