From c8a2b7601c8381da64a0370b0cb1a4dc847234fb Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Sun, 24 Sep 2006 03:57:26 +0000 Subject: [PATCH] LogType -> string. --- stepmania/src/CourseLoaderCRS.cpp | 22 ++++++------ stepmania/src/CourseWriterCRS.cpp | 2 +- stepmania/src/NotesLoaderBMS.cpp | 28 +++++++-------- stepmania/src/NotesLoaderDWI.cpp | 20 +++++------ stepmania/src/NotesLoaderKSF.cpp | 18 +++++----- stepmania/src/NotesLoaderSM.cpp | 38 ++++++++++---------- stepmania/src/NotesWriterDWI.cpp | 2 +- stepmania/src/NotesWriterSM.cpp | 2 +- stepmania/src/RageSoundReader_FileReader.cpp | 2 +- stepmania/src/Song.cpp | 20 +++++------ 10 files changed, 77 insertions(+), 77 deletions(-) diff --git a/stepmania/src/CourseLoaderCRS.cpp b/stepmania/src/CourseLoaderCRS.cpp index 9cf884b12e..de2eadabea 100644 --- a/stepmania/src/CourseLoaderCRS.cpp +++ b/stepmania/src/CourseLoaderCRS.cpp @@ -75,7 +75,7 @@ bool CourseLoaderCRS::LoadFromMsd( const RString &sPath, const MsdFile &msd, Cou const CourseDifficulty cd = StringToCourseDifficulty( sParams[1] ); if( cd == DIFFICULTY_INVALID ) { - LOG->UserLog( RageLog::LogType_CourseFile, sPath, "contains an invalid #METER string: \"%s\"", sParams[1].c_str() ); + LOG->UserLog( "Course file", sPath, "contains an invalid #METER string: \"%s\"", sParams[1].c_str() ); continue; } out.m_iCustomMeter[cd] = max( atoi(sParams[2]), 0 ); @@ -113,7 +113,7 @@ bool CourseLoaderCRS::LoadFromMsd( const RString &sPath, const MsdFile &msd, Cou if( attack.fSecsRemaining <= 0.0f) { - LOG->UserLog( RageLog::LogType_CourseFile, sPath, "has an attack with a nonpositive length: %s", sBits[1].c_str() ); + LOG->UserLog( "Course file", sPath, "has an attack with a nonpositive length: %s", sBits[1].c_str() ); attack.fSecsRemaining = 0.0f; } @@ -125,7 +125,7 @@ bool CourseLoaderCRS::LoadFromMsd( const RString &sPath, const MsdFile &msd, Cou } else { - LOG->UserLog( RageLog::LogType_CourseFile, sPath, "has an unexpected value named '%s'", sBits[0].c_str() ); + LOG->UserLog( "Course file", sPath, "has an unexpected value named '%s'", sBits[0].c_str() ); } } @@ -165,13 +165,13 @@ bool CourseLoaderCRS::LoadFromMsd( const RString &sPath, const MsdFile &msd, Cou } else { - LOG->UserLog( RageLog::LogType_CourseFile, sPath, "contains a random_within_group entry \"%s\" that is invalid. " + LOG->UserLog( "Course file", sPath, "contains a random_within_group entry \"%s\" that is invalid. " "Song should be in the format \"/*\".", sSong.c_str() ); } if( !SONGMAN->DoesSongGroupExist(new_entry.songCriteria.m_sGroupName) ) { - LOG->UserLog( RageLog::LogType_CourseFile, sPath, "random_within_group entry \"%s\" specifies a group that doesn't exist. " + LOG->UserLog( "Course file", sPath, "random_within_group entry \"%s\" specifies a group that doesn't exist. " "This entry will be ignored.", sSong.c_str() ); continue; // skip this #SONG } @@ -195,7 +195,7 @@ bool CourseLoaderCRS::LoadFromMsd( const RString &sPath, const MsdFile &msd, Cou if( new_entry.pSong == NULL ) { - LOG->UserLog( RageLog::LogType_CourseFile, sPath, "contains a fixed song entry \"%s\" that does not exist. " + LOG->UserLog( "Course file", sPath, "contains a fixed song entry \"%s\" that does not exist. " "This entry will be ignored.", sSong.c_str()); continue; // skip this #SONG } @@ -209,7 +209,7 @@ bool CourseLoaderCRS::LoadFromMsd( const RString &sPath, const MsdFile &msd, Cou new_entry.stepsCriteria.m_iHighMeter = new_entry.stepsCriteria.m_iLowMeter; else if( retval != 2 ) { - LOG->UserLog( RageLog::LogType_CourseFile, sPath, "contains an invalid difficulty setting: \"%s\", 3..6 used instead", + LOG->UserLog( "Course file", sPath, "contains an invalid difficulty setting: \"%s\", 3..6 used instead", sParams[2].c_str() ); new_entry.stepsCriteria.m_iLowMeter = 3; new_entry.stepsCriteria.m_iHighMeter = 6; @@ -265,7 +265,7 @@ bool CourseLoaderCRS::LoadFromMsd( const RString &sPath, const MsdFile &msd, Cou } else { - LOG->UserLog( RageLog::LogType_CourseFile, sPath, "contains an unexpected value named \"%s\"", sValueName.c_str() ); + LOG->UserLog( "Course file", sPath, "contains an unexpected value named \"%s\"", sValueName.c_str() ); } } static TitleSubst tsub("Courses"); @@ -336,7 +336,7 @@ bool CourseLoaderCRS::LoadFromCRSFile( const RString &_sPath, Course &out ) if( !msd.ReadFile(sPath) ) { - LOG->UserLog( RageLog::LogType_CourseFile, sPath, "couldn't be opened: %s.", msd.GetError().c_str() ); + LOG->UserLog( "Course file", sPath, "couldn't be opened: %s.", msd.GetError().c_str() ); return false; } @@ -365,14 +365,14 @@ bool CourseLoaderCRS::LoadEditFromFile( const RString &sEditFilePath, ProfileSlo int iBytes = FILEMAN->GetFileSizeInBytes( sEditFilePath ); if( iBytes > MAX_EDIT_COURSE_SIZE_BYTES ) { - LOG->UserLog( RageLog::LogType_EditFile, sEditFilePath, "is unreasonably large. It won't be loaded." ); + LOG->UserLog( "Edit file", sEditFilePath, "is unreasonably large. It won't be loaded." ); return false; } MsdFile msd; if( !msd.ReadFile( sEditFilePath ) ) { - LOG->UserLog( RageLog::LogType_EditFile, sEditFilePath, "couldn't be opened: %s", msd.GetError().c_str() ); + LOG->UserLog( "Edit file", sEditFilePath, "couldn't be opened: %s", msd.GetError().c_str() ); return false; } Course *pCourse = new Course; diff --git a/stepmania/src/CourseWriterCRS.cpp b/stepmania/src/CourseWriterCRS.cpp index b085e41d00..1f2817497e 100644 --- a/stepmania/src/CourseWriterCRS.cpp +++ b/stepmania/src/CourseWriterCRS.cpp @@ -13,7 +13,7 @@ bool CourseWriterCRS::Write( const Course &course, const RString &sPath, bool bS RageFile f; if( !f.Open( sPath, RageFile::WRITE ) ) { - LOG->UserLog( RageLog::LogType_CourseFile, sPath, "couldn't be written: %s", f.GetError().c_str() ); + LOG->UserLog( "Course file", sPath, "couldn't be written: %s", f.GetError().c_str() ); return false; } diff --git a/stepmania/src/NotesLoaderBMS.cpp b/stepmania/src/NotesLoaderBMS.cpp index 37e1b8be49..10ba2141fd 100644 --- a/stepmania/src/NotesLoaderBMS.cpp +++ b/stepmania/src/NotesLoaderBMS.cpp @@ -197,7 +197,7 @@ static StepsType DetermineStepsType( int iPlayer, const NoteData &nd, const RStr default: return STEPS_TYPE_INVALID; } default: - LOG->UserLog( RageLog::LogType_SongFile, sPath, "has an invalid #PLAYER value %d.", iPlayer ); + LOG->UserLog( "Song file", sPath, "has an invalid #PLAYER value %d.", iPlayer ); return STEPS_TYPE_INVALID; } } @@ -410,7 +410,7 @@ bool BMSLoader::LoadFromBMSFile( const RString &sPath, const NameToData_t &mapNa if( out.m_StepsType == STEPS_TYPE_INVALID ) { - LOG->UserLog( RageLog::LogType_SongFile, sPath, "has an unknown steps type" ); + LOG->UserLog( "Song file", sPath, "has an unknown steps type" ); return false; } @@ -429,7 +429,7 @@ bool BMSLoader::LoadFromBMSFile( const RString &sPath, const NameToData_t &mapNa } else { - LOG->UserLog( RageLog::LogType_SongFile, sPath, "has no room to shift the autokeysound tracks." ); + LOG->UserLog( "Song file", sPath, "has no room to shift the autokeysound tracks." ); } } } @@ -556,7 +556,7 @@ bool BMSLoader::ReadBMSFile( const RString &sPath, NameToData_t &mapNameToData ) RageFile file; if( !file.Open(sPath) ) { - LOG->UserLog( RageLog::LogType_SongFile, sPath, "couldn't be opened: %s", file.GetError().c_str() ); + LOG->UserLog( "Song file", sPath, "couldn't be opened: %s", file.GetError().c_str() ); return false; } @@ -565,7 +565,7 @@ bool BMSLoader::ReadBMSFile( const RString &sPath, NameToData_t &mapNameToData ) RString line; if( file.GetLine(line) == -1 ) { - LOG->UserLog( RageLog::LogType_SongFile, sPath, "had a read error: %s", file.GetError().c_str() ); + LOG->UserLog( "Song file", sPath, "had a read error: %s", file.GetError().c_str() ); return false; } @@ -652,7 +652,7 @@ void BMSLoader::ReadGlobalTags( const NameToData_t &mapNameToData, Song &out ) } else { - LOG->UserLog( RageLog::LogType_SongFile, m_sDir, "has an invalid BPM change at beat %f, BPM %f.", + LOG->UserLog( "Song file", m_sDir, "has an invalid BPM change at beat %f, BPM %f.", NoteRowToBeat(0), fBPM ); } } @@ -687,7 +687,7 @@ void BMSLoader::ReadGlobalTags( const NameToData_t &mapNameToData, Song &out ) } } if( !IsAFile(out.GetSongDir()+sData) ) - LOG->UserLog( RageLog::LogType_SongFile, m_sDir, "references key \"%s\" that can't be found", sData.c_str() ); + LOG->UserLog( "Song file", m_sDir, "references key \"%s\" that can't be found", sData.c_str() ); sWavID.MakeUpper(); // HACK: undo the MakeLower() out.m_vsKeysoundFile.push_back( sData ); @@ -734,7 +734,7 @@ void BMSLoader::ReadGlobalTags( const NameToData_t &mapNameToData, Song &out ) } else { - LOG->UserLog( RageLog::LogType_SongFile, m_sDir, "has an invalid BPM change at beat %f, BPM %d.", + LOG->UserLog( "Song file", m_sDir, "has an invalid BPM change at beat %f, BPM %d.", fBeat, iVal ); } break; @@ -755,13 +755,13 @@ void BMSLoader::ReadGlobalTags( const NameToData_t &mapNameToData, Song &out ) } else { - LOG->UserLog( RageLog::LogType_SongFile, m_sDir, "has an invalid BPM change at beat %f, BPM %f", + LOG->UserLog( "Song file", m_sDir, "has an invalid BPM change at beat %f, BPM %f", fBeat, fBPM ); } } else { - LOG->UserLog( RageLog::LogType_SongFile, m_sDir, "has tag \"%s\" which cannot be found.", sTagToLookFor.c_str() ); + LOG->UserLog( "Song file", m_sDir, "has tag \"%s\" which cannot be found.", sTagToLookFor.c_str() ); } break; } @@ -782,7 +782,7 @@ void BMSLoader::ReadGlobalTags( const NameToData_t &mapNameToData, Song &out ) } else { - LOG->UserLog( RageLog::LogType_SongFile, m_sDir, "has tag \"%s\" which cannot be found.", sTagToLookFor.c_str() ); + LOG->UserLog( "Song file", m_sDir, "has tag \"%s\" which cannot be found.", sTagToLookFor.c_str() ); } break; } @@ -812,13 +812,13 @@ void BMSLoader::ReadGlobalTags( const NameToData_t &mapNameToData, Song &out ) } else { - LOG->UserLog( RageLog::LogType_SongFile, m_sDir, "has an invalid BPM change at beat %f, BPM %f.", + LOG->UserLog( "Song file", m_sDir, "has an invalid BPM change at beat %f, BPM %f.", NoteRowToBeat(iStepIndex), fBPM ); } } else { - LOG->UserLog( RageLog::LogType_SongFile, m_sDir, "has tag \"%s\" which cannot be found.", sTagToLookFor.c_str() ); + LOG->UserLog( "Song file", m_sDir, "has tag \"%s\" which cannot be found.", sTagToLookFor.c_str() ); } break; @@ -948,7 +948,7 @@ bool BMSLoader::LoadFromDir( const RString &sDir, Song &out ) { // All bets are off; the titles don't match at all. // At this rate we're lucky if we even get the title right. - LOG->UserLog( RageLog::LogType_Song, sDir, "has BMS files with inconsistent titles." ); + LOG->UserLog( "Song", sDir, "has BMS files with inconsistent titles." ); } /* Create a Steps for each. */ diff --git a/stepmania/src/NotesLoaderDWI.cpp b/stepmania/src/NotesLoaderDWI.cpp index d2ae10b6be..7298e88f98 100644 --- a/stepmania/src/NotesLoaderDWI.cpp +++ b/stepmania/src/NotesLoaderDWI.cpp @@ -60,7 +60,7 @@ void DWILoader::DWIcharToNote( char c, GameController i, int ¬e1Out, int ¬ case 'L': note1Out = DANCE_NOTE_PAD1_UPRIGHT; note2Out = DANCE_NOTE_PAD1_RIGHT; break; case 'M': note1Out = DANCE_NOTE_PAD1_UPLEFT; note2Out = DANCE_NOTE_PAD1_UPRIGHT; break; default: - LOG->UserLog( RageLog::LogType_SongFile, m_sLoadingFile, "has an invalid DWI note character '%c'.", c ); + LOG->UserLog( "Song file", m_sLoadingFile, "has an invalid DWI note character '%c'.", c ); note1Out = DANCE_NOTE_NONE; note2Out = DANCE_NOTE_NONE; break; } @@ -232,7 +232,7 @@ bool DWILoader::LoadFromDWITokens( { if( c == '!' ) { - LOG->UserLog( RageLog::LogType_SongFile, m_sLoadingFile, "has an unexpected character: '!'." ); + LOG->UserLog( "Song file", m_sLoadingFile, "has an unexpected character: '!'." ); continue; } @@ -314,7 +314,7 @@ bool DWILoader::LoadFromDWITokens( if( !bFound ) { /* The hold was never closed. */ - LOG->UserLog( RageLog::LogType_SongFile, m_sLoadingFile, "failed to close a hold note in \"%s\" on track %i", + LOG->UserLog( "Song file", m_sLoadingFile, "failed to close a hold note in \"%s\" on track %i", sDescription.c_str(), t ); newNoteData.SetTapNote( t, iHeadRow, TAP_EMPTY ); @@ -364,7 +364,7 @@ bool DWILoader::LoadFromDWIFile( const RString &sPath, Song &out ) MsdFile msd; if( !msd.ReadFile( sPath ) ) { - LOG->UserLog( RageLog::LogType_SongFile, sPath, "couldn't be opened: %s", msd.GetError().c_str() ); + LOG->UserLog( "Song file", sPath, "couldn't be opened: %s", msd.GetError().c_str() ); return false; } @@ -376,7 +376,7 @@ bool DWILoader::LoadFromDWIFile( const RString &sPath, Song &out ) if( iNumParams < 1 ) { - LOG->UserLog( RageLog::LogType_SongFile, sPath, "has tag \"%s\" with no parameters.", sValueName.c_str() ); + LOG->UserLog( "Song file", sPath, "has tag \"%s\" with no parameters.", sValueName.c_str() ); continue; } @@ -410,7 +410,7 @@ bool DWILoader::LoadFromDWIFile( const RString &sPath, Song &out ) if( fBPM > 0.0f ) out.AddBPMSegment( BPMSegment(0, fBPM) ); else - LOG->UserLog( RageLog::LogType_SongFile, sPath, "has an invalid BPM change at beat %f, BPM %f.", + LOG->UserLog( "Song file", sPath, "has an invalid BPM change at beat %f, BPM %f.", NoteRowToBeat(0), fBPM ); } else if( 0==stricmp(sValueName,"DISPLAYBPM") ) @@ -458,7 +458,7 @@ bool DWILoader::LoadFromDWIFile( const RString &sPath, Song &out ) split( arrayFreezeExpressions[f], "=", arrayFreezeValues ); if( arrayFreezeValues.size() != 2 ) { - LOG->UserLog( RageLog::LogType_SongFile, sPath, "has an invalid FREEZE: '%s'.", arrayFreezeExpressions[f].c_str() ); + LOG->UserLog( "Song file", sPath, "has an invalid FREEZE: '%s'.", arrayFreezeExpressions[f].c_str() ); continue; } int iFreezeRow = BeatToNoteRow( StringToFloat(arrayFreezeValues[0]) / 4.0f ); @@ -480,7 +480,7 @@ bool DWILoader::LoadFromDWIFile( const RString &sPath, Song &out ) split( arrayBPMChangeExpressions[b], "=", arrayBPMChangeValues ); if( arrayBPMChangeValues.size() != 2 ) { - LOG->UserLog( RageLog::LogType_SongFile, m_sLoadingFile, "has an invalid CHANGEBPM: '%s'.", arrayBPMChangeExpressions[b].c_str() ); + LOG->UserLog( "Song file", m_sLoadingFile, "has an invalid CHANGEBPM: '%s'.", arrayBPMChangeExpressions[b].c_str() ); continue; } @@ -493,7 +493,7 @@ bool DWILoader::LoadFromDWIFile( const RString &sPath, Song &out ) } else { - LOG->UserLog( RageLog::LogType_SongFile, m_sLoadingFile, "has an invalid BPM change at beat %f, BPM %f.", + LOG->UserLog( "Song file", m_sLoadingFile, "has an invalid BPM change at beat %f, BPM %f.", NoteRowToBeat(iStartIndex), fBPM ); } } @@ -564,7 +564,7 @@ bool DWILoader::LoadFromDir( const RString &sPath, Song &out ) if( aFileNames.size() > 1 ) { - LOG->UserLog( RageLog::LogType_Song, sPath, "has more than one DWI file. There should be only one!" ); + LOG->UserLog( "Song", sPath, "has more than one DWI file. There should be only one!" ); return false; } diff --git a/stepmania/src/NotesLoaderKSF.cpp b/stepmania/src/NotesLoaderKSF.cpp index 19817b02aa..98bdec540e 100644 --- a/stepmania/src/NotesLoaderKSF.cpp +++ b/stepmania/src/NotesLoaderKSF.cpp @@ -69,7 +69,7 @@ bool KSFLoader::LoadFromKSFFile( const RString &sPath, Steps &out, const Song &s MsdFile msd; if( !msd.ReadFile( sPath ) ) { - LOG->UserLog( RageLog::LogType_SongFile, sPath, "couldn't be opened: %s", msd.GetError().c_str() ); + LOG->UserLog( "Song file", sPath, "couldn't be opened: %s", msd.GetError().c_str() ); return false; } @@ -87,7 +87,7 @@ bool KSFLoader::LoadFromKSFFile( const RString &sPath, Steps &out, const Song &s m_iTickCount = atoi( sParams[1] ); if( m_iTickCount <= 0 ) { - LOG->UserLog( RageLog::LogType_SongFile, sPath, "has an invalid tick count: %d.", m_iTickCount ); + LOG->UserLog( "Song file", sPath, "has an invalid tick count: %d.", m_iTickCount ); return false; } } @@ -106,7 +106,7 @@ bool KSFLoader::LoadFromKSFFile( const RString &sPath, Steps &out, const Song &s if( m_iTickCount == -1 ) { m_iTickCount = 2; - LOG->UserLog( RageLog::LogType_SongFile, sPath, "doesn't have a TICKCOUNT. Defaulting to %i.", m_iTickCount ); + LOG->UserLog( "Song file", sPath, "doesn't have a TICKCOUNT. Defaulting to %i.", m_iTickCount ); } NoteData notedata; // read it into here @@ -200,7 +200,7 @@ bool KSFLoader::LoadFromKSFFile( const RString &sPath, Steps &out, const Song &s { if( m_bKIUCompliant ) { - LOG->UserLog( RageLog::LogType_SongFile, sPath, "has illegal syntax \"%s\" which can't be in KIU complient files.", + LOG->UserLog( "Song file", sPath, "has illegal syntax \"%s\" which can't be in KIU complient files.", sRowString.c_str() ); return false; } @@ -218,7 +218,7 @@ bool KSFLoader::LoadFromKSFFile( const RString &sPath, Steps &out, const Song &s } else { - LOG->UserLog( RageLog::LogType_SongFile, sPath, "has a RowString with an improper length \"%s\"; corrupt notes ignored.", + LOG->UserLog( "Song file", sPath, "has a RowString with an improper length \"%s\"; corrupt notes ignored.", sRowString.c_str() ); return false; } @@ -264,7 +264,7 @@ bool KSFLoader::LoadFromKSFFile( const RString &sPath, Steps &out, const Song &s case '0': tap = TAP_EMPTY; break; case '1': tap = TAP_ORIGINAL_TAP; break; default: - LOG->UserLog( RageLog::LogType_SongFile, sPath, "has an invalid row \"%s\"; corrupt notes ignored.", + LOG->UserLog( "Song file", sPath, "has an invalid row \"%s\"; corrupt notes ignored.", sRowString.c_str() ); return false; } @@ -338,7 +338,7 @@ bool KSFLoader::LoadGlobalData( const RString &sPath, Song &out ) MsdFile msd; if( !msd.ReadFile( sPath ) ) { - LOG->UserLog( RageLog::LogType_SongFile, sPath, "couldn't be opened: %s", msd.GetError().c_str() ); + LOG->UserLog( "Song file", sPath, "couldn't be opened: %s", msd.GetError().c_str() ); return false; } @@ -419,7 +419,7 @@ bool KSFLoader::LoadGlobalData( const RString &sPath, Song &out ) } else { - LOG->UserLog( RageLog::LogType_SongFile, sPath, "has an unexpected value named \"%s\".", + LOG->UserLog( "Song file", sPath, "has an unexpected value named \"%s\".", sValueName.c_str() ); } } @@ -503,7 +503,7 @@ bool KSFLoader::LoadGlobalData( const RString &sPath, Song &out ) else { /* Quit while we're ahead if any bad syntax is spotted. */ - LOG->UserLog( RageLog::LogType_SongFile, sPath, "has an invalid RowString \"%s\".", + LOG->UserLog( "Song file", sPath, "has an invalid RowString \"%s\".", NoteRowString.c_str() ); return false; } diff --git a/stepmania/src/NotesLoaderSM.cpp b/stepmania/src/NotesLoaderSM.cpp index 5603f3039f..dedbec6529 100644 --- a/stepmania/src/NotesLoaderSM.cpp +++ b/stepmania/src/NotesLoaderSM.cpp @@ -73,7 +73,7 @@ bool SMLoader::LoadTimingFromFile( const RString &fn, TimingData &out ) MsdFile msd; if( !msd.ReadFile( fn ) ) { - LOG->UserLog( RageLog::LogType_SongFile, fn, "couldn't be loaded: %s", msd.GetError().c_str() ); + LOG->UserLog( "Song file", fn, "couldn't be loaded: %s", msd.GetError().c_str() ); return false; } @@ -110,7 +110,7 @@ void SMLoader::LoadTimingFromSMFile( const MsdFile &msd, TimingData &out ) if( arrayFreezeValues.size() != 2 ) { // XXX: Hard to tell which file caused this. - LOG->UserLog( RageLog::LogType_SongFile, "(UNKNOWN)", "has an invalid #%s value \"%s\" (must have exactly one '='), ignored.", + LOG->UserLog( "Song file", "(UNKNOWN)", "has an invalid #%s value \"%s\" (must have exactly one '='), ignored.", sValueName.c_str(), arrayFreezeExpressions[f].c_str() ); continue; } @@ -138,7 +138,7 @@ void SMLoader::LoadTimingFromSMFile( const MsdFile &msd, TimingData &out ) // XXX: Hard to tell which file caused this. if( arrayBPMChangeValues.size() != 2 ) { - LOG->UserLog( RageLog::LogType_SongFile, "(UNKNOWN)", "has an invalid #%s value \"%s\" (must have exactly one '='), ignored.", + LOG->UserLog( "Song file", "(UNKNOWN)", "has an invalid #%s value \"%s\" (must have exactly one '='), ignored.", sValueName.c_str(), arrayBPMChangeExpressions[b].c_str() ); continue; } @@ -149,7 +149,7 @@ void SMLoader::LoadTimingFromSMFile( const MsdFile &msd, TimingData &out ) if( fNewBPM > 0.0f ) out.AddBPMSegment( BPMSegment(BeatToNoteRow(fBeat), fNewBPM) ); else - LOG->UserLog( RageLog::LogType_SongFile, "(UNKNOWN)", "has an invalid BPM change at beat %f, BPM %f.", fBeat, fNewBPM ); + LOG->UserLog( "Song file", "(UNKNOWN)", "has an invalid BPM change at beat %f, BPM %f.", fBeat, fNewBPM ); } } } @@ -228,7 +228,7 @@ bool SMLoader::LoadFromSMFile( const RString &sPath, Song &out ) MsdFile msd; if( !msd.ReadFile( sPath ) ) { - LOG->UserLog( RageLog::LogType_SongFile, sPath, "couldn't be opened: %s", msd.GetError().c_str() ); + LOG->UserLog( "Song file", sPath, "couldn't be opened: %s", msd.GetError().c_str() ); return false; } @@ -357,7 +357,7 @@ bool SMLoader::LoadFromSMFile( const RString &sPath, Song &out ) else if(!stricmp(sParams[1],"ROULETTE")) out.m_SelectionDisplay = out.SHOW_ROULETTE; else - LOG->UserLog( RageLog::LogType_SongFile, sPath, "has an unknown #SELECTABLE value, \"%s\"; ignored.", sParams[1].c_str() ); + LOG->UserLog( "Song file", sPath, "has an unknown #SELECTABLE value, \"%s\"; ignored.", sParams[1].c_str() ); } else if( sValueName.Left(strlen("BGCHANGES"))=="BGCHANGES" || sValueName=="ANIMATIONS" ) @@ -369,7 +369,7 @@ bool SMLoader::LoadFromSMFile( const RString &sPath, Song &out ) bool bValid = iLayer>=0 && iLayerUserLog( RageLog::LogType_SongFile, sPath, "has a #BGCHANGES tag \"%s\" that is out of range.", sValueName.c_str() ); + LOG->UserLog( "Song file", sPath, "has a #BGCHANGES tag \"%s\" that is out of range.", sValueName.c_str() ); } else { @@ -407,7 +407,7 @@ bool SMLoader::LoadFromSMFile( const RString &sPath, Song &out ) { if( iNumParams < 7 ) { - LOG->UserLog( RageLog::LogType_SongFile, sPath, "has %d fields in a #NOTES tag, but should have at least 7.", iNumParams ); + LOG->UserLog( "Song file", sPath, "has %d fields in a #NOTES tag, but should have at least 7.", iNumParams ); continue; } @@ -426,7 +426,7 @@ bool SMLoader::LoadFromSMFile( const RString &sPath, Song &out ) else if( sValueName=="OFFSET" || sValueName=="BPMS" || sValueName=="STOPS" || sValueName=="FREEZES" ) ; else - LOG->UserLog( RageLog::LogType_SongFile, sPath, "has an unexpected value named \"%s\".", sValueName.c_str() ); + LOG->UserLog( "Song file", sPath, "has an unexpected value named \"%s\".", sValueName.c_str() ); } return true; @@ -440,7 +440,7 @@ bool SMLoader::LoadFromDir( const RString &sPath, Song &out ) if( aFileNames.size() > 1 ) { - LOG->UserLog( RageLog::LogType_Song, sPath, "has more than one SM file. There should be only one!" ); + LOG->UserLog( "Song", sPath, "has more than one SM file. There should be only one!" ); return false; } @@ -458,14 +458,14 @@ bool SMLoader::LoadEditFromFile( RString sEditFilePath, ProfileSlot slot, bool b int iBytes = FILEMAN->GetFileSizeInBytes( sEditFilePath ); if( iBytes > MAX_EDIT_STEPS_SIZE_BYTES ) { - LOG->UserLog( RageLog::LogType_EditFile, sEditFilePath, "is unreasonably large. It won't be loaded." ); + LOG->UserLog( "Edit file", sEditFilePath, "is unreasonably large. It won't be loaded." ); return false; } MsdFile msd; if( !msd.ReadFile( sEditFilePath ) ) { - LOG->UserLog( RageLog::LogType_EditFile, sEditFilePath, "couldn't be opened: %s", msd.GetError().c_str() ); + LOG->UserLog( "Edit file", sEditFilePath, "couldn't be opened: %s", msd.GetError().c_str() ); return false; } @@ -495,7 +495,7 @@ bool SMLoader::LoadEditFromMsd( const MsdFile &msd, const RString &sEditFilePath { if( pSong ) { - LOG->UserLog( RageLog::LogType_EditFile, sEditFilePath, "has more than one #SONG tag." ); + LOG->UserLog( "Edit file", sEditFilePath, "has more than one #SONG tag." ); return false; } @@ -505,13 +505,13 @@ bool SMLoader::LoadEditFromMsd( const MsdFile &msd, const RString &sEditFilePath pSong = SONGMAN->FindSong( sSongFullTitle ); if( pSong == NULL ) { - LOG->UserLog( RageLog::LogType_EditFile, sEditFilePath, "requires a song \"%s\" that isn't present.", sSongFullTitle.c_str() ); + LOG->UserLog( "Edit file", sEditFilePath, "requires a song \"%s\" that isn't present.", sSongFullTitle.c_str() ); return false; } if( pSong->GetNumStepsLoadedFromProfile(slot) >= MAX_EDITS_PER_SONG_PER_PROFILE ) { - LOG->UserLog( RageLog::LogType_SongFile, sSongFullTitle, "already has the maximum number of edits allowed for ProfileSlotP%d.", slot+1 ); + LOG->UserLog( "Song file", sSongFullTitle, "already has the maximum number of edits allowed for ProfileSlotP%d.", slot+1 ); return false; } } @@ -520,13 +520,13 @@ bool SMLoader::LoadEditFromMsd( const MsdFile &msd, const RString &sEditFilePath { if( pSong == NULL ) { - LOG->UserLog( RageLog::LogType_EditFile, sEditFilePath, "doesn't have a #SONG tag preceeding the first #NOTES tag." ); + LOG->UserLog( "Edit file", sEditFilePath, "doesn't have a #SONG tag preceeding the first #NOTES tag." ); return false; } if( iNumParams < 7 ) { - LOG->UserLog( RageLog::LogType_EditFile, sEditFilePath, "has %d fields in a #NOTES tag, but should have at least 7.", iNumParams ); + LOG->UserLog( "Edit file", sEditFilePath, "has %d fields in a #NOTES tag, but should have at least 7.", iNumParams ); continue; } @@ -544,7 +544,7 @@ bool SMLoader::LoadEditFromMsd( const MsdFile &msd, const RString &sEditFilePath if( pSong->IsEditAlreadyLoaded(pNewNotes) ) { - LOG->UserLog( RageLog::LogType_EditFile, sEditFilePath, "is a duplicate of another edit that was already loaded." ); + LOG->UserLog( "Edit file", sEditFilePath, "is a duplicate of another edit that was already loaded." ); SAFE_DELETE( pNewNotes ); return false; } @@ -554,7 +554,7 @@ bool SMLoader::LoadEditFromMsd( const MsdFile &msd, const RString &sEditFilePath } else { - LOG->UserLog( RageLog::LogType_EditFile, sEditFilePath, "has an unexpected value \"%s\".", sValueName.c_str() ); + LOG->UserLog( "Edit file", sEditFilePath, "has an unexpected value \"%s\".", sValueName.c_str() ); } } diff --git a/stepmania/src/NotesWriterDWI.cpp b/stepmania/src/NotesWriterDWI.cpp index 57e710cf98..a4267e0385 100644 --- a/stepmania/src/NotesWriterDWI.cpp +++ b/stepmania/src/NotesWriterDWI.cpp @@ -349,7 +349,7 @@ bool NotesWriterDWI::Write( RString sPath, const Song &out ) RageFile f; if( !f.Open( sPath, RageFile::WRITE ) ) { - LOG->UserLog( RageLog::LogType_SongFile, sPath, "couldn't be opened for writing: %s", f.GetError().c_str() ); + LOG->UserLog( "Song file", sPath, "couldn't be opened for writing: %s", f.GetError().c_str() ); return false; } diff --git a/stepmania/src/NotesWriterSM.cpp b/stepmania/src/NotesWriterSM.cpp index 7834c6a3bd..11c011d46c 100644 --- a/stepmania/src/NotesWriterSM.cpp +++ b/stepmania/src/NotesWriterSM.cpp @@ -209,7 +209,7 @@ bool NotesWriterSM::Write( RString sPath, const Song &out, bool bSavingCache ) RageFile f; if( !f.Open( sPath, flags ) ) { - LOG->UserLog( RageLog::LogType_SongFile, sPath, "couldn't be opened for writing: %s", f.GetError().c_str() ); + LOG->UserLog( "Song file", sPath, "couldn't be opened for writing: %s", f.GetError().c_str() ); return false; } diff --git a/stepmania/src/RageSoundReader_FileReader.cpp b/stepmania/src/RageSoundReader_FileReader.cpp index a9baf66f12..fbacc7cb19 100644 --- a/stepmania/src/RageSoundReader_FileReader.cpp +++ b/stepmania/src/RageSoundReader_FileReader.cpp @@ -119,7 +119,7 @@ SoundReader *SoundReader_FileReader::OpenFile( RString filename, RString &error SoundReader_FileReader *NewSample = TryOpenFile( filename, error, *it, bKeepTrying ); if( NewSample ) { - LOG->UserLog( RageLog::LogType_SoundFile, filename, "is really %s.", it->c_str() ); + LOG->UserLog( "Sound file", filename, "is really %s.", it->c_str() ); return NewSample; } } diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index 6a551d53b5..a6f7261ef0 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -236,7 +236,7 @@ bool Song::LoadFromSongDir( RString sDir ) } else { - LOG->UserLog( RageLog::LogType_Song, sDir, "has no SM, DWI, BMS, or KSF files." ); + LOG->UserLog( "Song", sDir, "has no SM, DWI, BMS, or KSF files." ); vector vs; GetDirListing( sDir + "*.mp3", vs, false, false ); @@ -245,7 +245,7 @@ bool Song::LoadFromSongDir( RString sDir ) if( !bHasMusic ) { - LOG->UserLog( RageLog::LogType_Song, sDir, "has no music file either. Ignoring this song directory." ); + LOG->UserLog( "Song", sDir, "has no music file either. Ignoring this song directory." ); return false; } @@ -277,7 +277,7 @@ bool Song::LoadFromSongDir( RString sDir ) if( !m_bHasMusic ) { - LOG->UserLog( RageLog::LogType_Song, sDir, "has no music; ignored." ); + LOG->UserLog( "Song", sDir, "has no music; ignored." ); return false; // don't load this song } @@ -349,7 +349,7 @@ void Song::TidyUpData() * (which have no music file, per se) but it's something of a hack. */ if( Sample == NULL && m_sMusicFile != "" ) { - LOG->UserLog( RageLog::LogType_SoundFile, GetMusicPath(), "couldn't be opened: %s", error.c_str() ); + LOG->UserLog( "Sound file", GetMusicPath(), "couldn't be opened: %s", error.c_str() ); /* Don't use this file. */ m_sMusicFile = ""; @@ -366,19 +366,19 @@ void Song::TidyUpData() } else if( m_fMusicLengthSeconds == 0 ) { - LOG->UserLog( RageLog::LogType_SoundFile, GetMusicPath(), "is empty." ); + LOG->UserLog( "Sound file", GetMusicPath(), "is empty." ); } } } else // ! HasMusic() { m_fMusicLengthSeconds = 100; // guess - LOG->UserLog( RageLog::LogType_Song, GetSongDir(), "has no music file; guessing at %f seconds", m_fMusicLengthSeconds ); + LOG->UserLog( "Song", GetSongDir(), "has no music file; guessing at %f seconds", m_fMusicLengthSeconds ); } if( m_fMusicLengthSeconds < 0 ) { - LOG->UserLog( RageLog::LogType_SoundFile, GetMusicPath(), "has a negative length %f.", m_fMusicLengthSeconds ); + LOG->UserLog( "Sound file", GetMusicPath(), "has a negative length %f.", m_fMusicLengthSeconds ); m_fMusicLengthSeconds = 0; } @@ -403,7 +403,7 @@ void Song::TidyUpData() if( m_Timing.m_BPMSegments.empty() ) { - LOG->UserLog( RageLog::LogType_SongFile, m_sSongDir + m_sSongFileName, "hs no BPM segments, default provided." ); + LOG->UserLog( "Song file", m_sSongDir + m_sSongFileName, "hs no BPM segments, default provided." ); m_Timing.AddBPMSegment( BPMSegment(0, 60) ); } @@ -526,7 +526,7 @@ void Song::TidyUpData() RageSurface *img = RageSurfaceUtils::LoadFile( sPath, error, true ); if( !img ) { - LOG->UserLog( RageLog::LogType_GraphicFile, sPath, "couldn't be loaded: %s", error.c_str() ); + LOG->UserLog( "Graphic file", sPath, "couldn't be loaded: %s", error.c_str() ); continue; } @@ -738,7 +738,7 @@ void Song::Save() if( !FileCopy( sOldPath, sNewPath ) ) { - LOG->UserLog( RageLog::LogType_SongFile, sOldPath, "couldn't be backed up." ); + LOG->UserLog( "Song file", sOldPath, "couldn't be backed up." ); /* Don't remove. */ } else