From ff3896190726208e686e0a527421d10088de6277 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 14 Feb 2003 08:15:15 +0000 Subject: [PATCH] use slashes as a directory separator instead of backslashes --- stepmania/src/AnnouncerManager.cpp | 2 +- stepmania/src/BGAnimation.cpp | 4 ++-- stepmania/src/BGAnimationLayer.cpp | 2 +- stepmania/src/Background.cpp | 6 +++--- stepmania/src/Course.cpp | 16 ++++++++-------- stepmania/src/GameManager.cpp | 2 +- stepmania/src/NoteSkinManager.cpp | 2 +- stepmania/src/RandomSample.cpp | 12 +++++++----- stepmania/src/Song.cpp | 12 ++++++------ stepmania/src/SongManager.cpp | 20 ++++++++++---------- stepmania/src/ThemeManager.cpp | 6 +++--- 11 files changed, 43 insertions(+), 41 deletions(-) diff --git a/stepmania/src/AnnouncerManager.cpp b/stepmania/src/AnnouncerManager.cpp index 2e98ed3328..1a5faed6d0 100644 --- a/stepmania/src/AnnouncerManager.cpp +++ b/stepmania/src/AnnouncerManager.cpp @@ -18,7 +18,7 @@ AnnouncerManager* ANNOUNCER = NULL; // global object accessable from anywhere in const CString EMPTY_ANNOUNCER_NAME = "Empty"; -const CString ANNOUNCERS_DIR = "Announcers\\"; +const CString ANNOUNCERS_DIR = "Announcers/"; AnnouncerManager::AnnouncerManager() diff --git a/stepmania/src/BGAnimation.cpp b/stepmania/src/BGAnimation.cpp index c03a19e79f..1db8e53bef 100644 --- a/stepmania/src/BGAnimation.cpp +++ b/stepmania/src/BGAnimation.cpp @@ -50,8 +50,8 @@ void BGAnimation::LoadFromAniDir( CString sAniDir, CString sSongBGPath ) { Unload(); - if( sAniDir.Right(1) != "\\" ) - sAniDir += "\\"; + if( sAniDir.Right(1) != "/" ) + sAniDir += "/"; // loading a directory of layers CStringArray asImagePaths; diff --git a/stepmania/src/BGAnimationLayer.cpp b/stepmania/src/BGAnimationLayer.cpp index 1f24cfcee6..a9d7509ba4 100644 --- a/stepmania/src/BGAnimationLayer.cpp +++ b/stepmania/src/BGAnimationLayer.cpp @@ -320,7 +320,7 @@ found_effect: CString sDir, sFName, sExt; splitrelpath( sPath, sDir, sFName, sExt ); - CString sIniPath = sDir+"\\"+sFName+".ini"; + CString sIniPath = sDir+"/"+sFName+".ini"; IniFile ini; ini.SetPath( sIniPath ); if( ini.ReadFile() ) diff --git a/stepmania/src/Background.cpp b/stepmania/src/Background.cpp index 9ffc69c155..d126d4a641 100644 --- a/stepmania/src/Background.cpp +++ b/stepmania/src/Background.cpp @@ -21,9 +21,9 @@ #include "PrefsManager.h" -const CString BG_ANIMS_DIR = "BGAnimations\\"; -const CString VISUALIZATIONS_DIR = "Visualizations\\"; -const CString RANDOMMOVIES_DIR = "RandomMovies\\"; +const CString BG_ANIMS_DIR = "BGAnimations/"; +const CString VISUALIZATIONS_DIR = "Visualizations/"; +const CString RANDOMMOVIES_DIR = "RandomMovies/"; const float FADE_SECONDS = 1.0f; diff --git a/stepmania/src/Course.cpp b/stepmania/src/Course.cpp index f86d8dbafd..9b34b44667 100644 --- a/stepmania/src/Course.cpp +++ b/stepmania/src/Course.cpp @@ -123,10 +123,10 @@ void Course::LoadFromCRSFile( CString sPath ) splitrelpath( sPath, sDir, sFName, sExt ); CStringArray arrayPossibleBanners; - GetDirListing( "Courses\\" + sFName + ".png", arrayPossibleBanners, false, true ); - GetDirListing( "Courses\\" + sFName + ".jpg", arrayPossibleBanners, false, true ); - GetDirListing( "Courses\\" + sFName + ".bmp", arrayPossibleBanners, false, true ); - GetDirListing( "Courses\\" + sFName + ".gif", arrayPossibleBanners, false, true ); + GetDirListing( "Courses/" + sFName + ".png", arrayPossibleBanners, false, true ); + GetDirListing( "Courses/" + sFName + ".jpg", arrayPossibleBanners, false, true ); + GetDirListing( "Courses/" + sFName + ".bmp", arrayPossibleBanners, false, true ); + GetDirListing( "Courses/" + sFName + ".gif", arrayPossibleBanners, false, true ); if( !arrayPossibleBanners.empty() ) m_sBannerPath = arrayPossibleBanners[0]; @@ -191,10 +191,10 @@ void Course::CreateEndlessCourseFromGroupAndDifficulty( CString sGroupName, Diff m_iLives = -1; CStringArray asPossibleBannerPaths; - GetDirListing( "Songs\\" + sGroupName + "\\banner.png", asPossibleBannerPaths, false, true ); - GetDirListing( "Songs\\" + sGroupName + "\\banner.jpg", asPossibleBannerPaths, false, true ); - GetDirListing( "Songs\\" + sGroupName + "\\banner.gif", asPossibleBannerPaths, false, true ); - GetDirListing( "Songs\\" + sGroupName + "\\banner.bmp", asPossibleBannerPaths, false, true ); + GetDirListing( "Songs/" + sGroupName + "/banner.png", asPossibleBannerPaths, false, true ); + GetDirListing( "Songs/" + sGroupName + "/banner.jpg", asPossibleBannerPaths, false, true ); + GetDirListing( "Songs/" + sGroupName + "/banner.gif", asPossibleBannerPaths, false, true ); + GetDirListing( "Songs/" + sGroupName + "/banner.bmp", asPossibleBannerPaths, false, true ); if( !asPossibleBannerPaths.empty() ) m_sBannerPath = asPossibleBannerPaths[0]; diff --git a/stepmania/src/GameManager.cpp b/stepmania/src/GameManager.cpp index 80f7e81b1f..547519ddde 100644 --- a/stepmania/src/GameManager.cpp +++ b/stepmania/src/GameManager.cpp @@ -25,7 +25,7 @@ GameManager* GAMEMAN = NULL; // global and accessable from anywhere in our program -const CString NOTESKIN_DIR = "NoteSkins\\"; +const CString NOTESKIN_DIR = "NoteSkins/"; const int DANCE_COL_SPACING = 64; diff --git a/stepmania/src/NoteSkinManager.cpp b/stepmania/src/NoteSkinManager.cpp index 0699e33c7a..0150fd6b52 100644 --- a/stepmania/src/NoteSkinManager.cpp +++ b/stepmania/src/NoteSkinManager.cpp @@ -44,7 +44,7 @@ void NoteSkinManager::GetNoteSkinNames( Game game, CStringArray &AddTo ) const { GameDef* pGameDef = GAMEMAN->GetGameDefForGame( game ); - CString sBaseSkinFolder = NOTESKINS_DIR + pGameDef->m_szName + "\\"; + CString sBaseSkinFolder = NOTESKINS_DIR + pGameDef->m_szName + "/"; GetDirListing( sBaseSkinFolder + "*", AddTo, true ); // strip out "CVS" diff --git a/stepmania/src/RandomSample.cpp b/stepmania/src/RandomSample.cpp index 19b57edc06..f042035ffe 100644 --- a/stepmania/src/RandomSample.cpp +++ b/stepmania/src/RandomSample.cpp @@ -34,18 +34,20 @@ bool RandomSample::LoadSoundDir( CString sDir ) if( sDir == "" ) return true; + sDir.Replace("\\", "/"); + #if 0 /* (don't want to do this just yet) */ /* If this is actually a directory, add a backslash to the filename, * so we'll look for eg. themes\Default\sounds\sDir\*.mp3. Otherwise, * don't, so we'll look for all of the files starting with sDir, * eg. themes\Default\sounds\sDir*.mp3. */ - if(IsADirectory(sDir) && sDir[sDir.GetLength()-1] != '\\' ) - sDir += "\\"; + if(IsADirectory(sDir) && sDir[sDir.GetLength()-1] != '/' ) + sDir += "/"; #else - // make sure there's a backslash at the end of this path - if( sDir[sDir.GetLength()-1] != '\\' ) - sDir += "\\"; + // make sure there's a slash at the end of this path + if( sDir[sDir.GetLength()-1] != '/' ) + sDir += "/"; #endif CStringArray arraySoundFiles; diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index c051e6af3f..9d38035af5 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -234,7 +234,7 @@ float Song::GetElapsedTimeFromBeat( float fBeat ) const CString Song::GetCacheFilePath() const { - return ssprintf( "Cache\\%u", GetHashForString(m_sSongDir) ); + return ssprintf( "Cache/%u", GetHashForString(m_sSongDir) ); } /* Get a path to the SM containing data for this song. It might @@ -303,7 +303,7 @@ bool Song::LoadFromSongDir( CString sDir ) // LOG->Trace( "Song::LoadFromSongDir(%s)", sDir.GetString() ); sDir.Replace("\\", "/"); - // make sure there is a trailing '\\' at the end of sDir + // make sure there is a trailing slash at the end of sDir if( sDir.Right(1) != "/" ) sDir += "/"; @@ -1044,13 +1044,13 @@ CString Song::GetMusicPath() const { /* If there's no path in the music file, the file is in the same directory * as the song. (This is the preferred configuration.) */ - if( m_sMusicFile.Find('\\') == -1) + if( m_sMusicFile.Find('/') == -1) return m_sSongDir+m_sMusicFile; /* The file has a path. If it was loaded from the m_DWIPath, it's relative * to that. */ if( PREFSMAN->m_DWIPath!="" && m_sSongDir.Left(PREFSMAN->m_DWIPath.GetLength()) == PREFSMAN->m_DWIPath ) - return PREFSMAN->m_DWIPath+"\\"+m_sMusicFile; + return PREFSMAN->m_DWIPath+"/"+m_sMusicFile; /* Otherwise, it's relative to the top of the SM directory (the CWD), so * return it directly. */ @@ -1064,11 +1064,11 @@ CString Song::GetBannerPath() const CString Song::GetCDTitlePath() const { - if( m_sCDTitleFile.Find('\\') == -1) + if( m_sCDTitleFile.Find('/') == -1) return m_sSongDir+m_sCDTitleFile; if( PREFSMAN->m_DWIPath!="" && m_sSongDir.Left(PREFSMAN->m_DWIPath.GetLength()) == PREFSMAN->m_DWIPath ) - return PREFSMAN->m_DWIPath+"\\"+m_sCDTitleFile; + return PREFSMAN->m_DWIPath+"/"+m_sCDTitleFile; return m_sCDTitleFile; } diff --git a/stepmania/src/SongManager.cpp b/stepmania/src/SongManager.cpp index 388fc09a04..2bafe02147 100644 --- a/stepmania/src/SongManager.cpp +++ b/stepmania/src/SongManager.cpp @@ -74,7 +74,7 @@ void SongManager::InitSongArrayFromDisk( LoadingWindow *ld ) LoadStepManiaSongDir( PREFSMAN->m_asAdditionalSongFolders[i], ld ); if( PREFSMAN->m_DWIPath != "" ) - LoadStepManiaSongDir( PREFSMAN->m_DWIPath + "\\Songs", ld ); + LoadStepManiaSongDir( PREFSMAN->m_DWIPath + "/Songs", ld ); LOG->Trace( "Found %d Songs.", m_pSongs.size() ); } @@ -83,14 +83,14 @@ void SongManager::SanityCheckGroupDir( CString sDir ) const { // Check to see if they put a song directly inside the group folder. CStringArray arrayFiles; - GetDirListing( sDir + "\\*.mp3", arrayFiles ); - GetDirListing( sDir + "\\*.ogg", arrayFiles ); - GetDirListing( sDir + "\\*.wav", arrayFiles ); + GetDirListing( sDir + "/*.mp3", arrayFiles ); + GetDirListing( sDir + "/*.ogg", arrayFiles ); + GetDirListing( sDir + "/*.wav", arrayFiles ); if( !arrayFiles.empty() ) RageException::Throw( "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" + "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() ); @@ -526,7 +526,7 @@ void SongManager::GetEndlessCourses( vector &AddTo ) bool SongManager::GetExtraStageInfoFromCourse( bool bExtra2, CString sPreferredGroup, Song*& pSongOut, Notes*& pNotesOut, PlayerOptions& po_out, SongOptions& so_out ) { - CString sCoursePath = "Songs\\" + sPreferredGroup + "\\" + (bExtra2 ? "extra2" : "extra1") + ".crs"; + CString sCoursePath = "Songs/" + sPreferredGroup + "/" + (bExtra2 ? "extra2" : "extra1") + ".crs"; if( !DoesFileExist(sCoursePath) ) { bool bFound = false; @@ -534,7 +534,7 @@ bool SongManager::GetExtraStageInfoFromCourse( bool bExtra2, CString sPreferredG /* try alternative song folders */ for( unsigned i=0; im_asAdditionalSongFolders.size(); i++ ) { - sCoursePath = PREFSMAN->m_asAdditionalSongFolders[i] + "\\" + sPreferredGroup + "\\" + (bExtra2 ? "extra2" : "extra1") + ".crs"; + sCoursePath = PREFSMAN->m_asAdditionalSongFolders[i] + "/" + sPreferredGroup + "/" + (bExtra2 ? "extra2" : "extra1") + ".crs"; if( DoesFileExist(sCoursePath) ) { bFound = true; @@ -544,7 +544,7 @@ bool SongManager::GetExtraStageInfoFromCourse( bool bExtra2, CString sPreferredG if( !bFound && PREFSMAN->m_DWIPath != "" ) { - sCoursePath = PREFSMAN->m_DWIPath + "\\Songs\\" + sPreferredGroup + "\\" + (bExtra2 ? "extra2" : "extra1") + ".crs"; + sCoursePath = PREFSMAN->m_DWIPath + "/Songs/" + sPreferredGroup + "/" + (bExtra2 ? "extra2" : "extra1") + ".crs"; if( DoesFileExist(sCoursePath) ) bFound = true; } @@ -672,8 +672,8 @@ Song* SongManager::GetRandomSong() Song* SongManager::GetSongFromDir( CString sDir ) { - if( sDir[sDir.GetLength()-1] != '\\' ) - sDir += '\\'; + if( sDir[sDir.GetLength()-1] != '/' ) + sDir += '/'; for( unsigned int i=0; iGetSongDir()) == 0 ) diff --git a/stepmania/src/ThemeManager.cpp b/stepmania/src/ThemeManager.cpp index 1c55d66aff..1e28f4d0c3 100644 --- a/stepmania/src/ThemeManager.cpp +++ b/stepmania/src/ThemeManager.cpp @@ -28,7 +28,7 @@ ThemeManager* THEME = NULL; // global object accessable from anywhere in the pro const CString BASE_THEME_NAME = "default"; -const CString THEMES_DIR = "Themes\\"; +const CString THEMES_DIR = "Themes/"; ThemeManager::ThemeManager() { @@ -50,7 +50,7 @@ ThemeManager::~ThemeManager() void ThemeManager::GetAllThemeNames( CStringArray& AddTo ) { - GetDirListing( THEMES_DIR+"\\*", AddTo, true ); + GetDirListing( THEMES_DIR+"/*", AddTo, true ); // strip out the folder called "CVS" for( CStringArray::iterator i=AddTo.begin(); i != AddTo.end(); ++i ) @@ -113,7 +113,7 @@ void ThemeManager::SwitchTheme( CString sThemeName ) CString ThemeManager::GetThemeDirFromName( const CString &sThemeName ) { - return THEMES_DIR + sThemeName + "\\"; + return THEMES_DIR + sThemeName + "/"; } CString ThemeManager::GetPathTo( CString sThemeName, CString sAssetCategory, CString sFileName )