continue phasing out BASE_PATH and SLASH
This commit is contained in:
@@ -57,8 +57,8 @@ void AddLayersFromAniDir( CString sAniDir, vector<BGAnimationLayer*> &layersAddT
|
||||
if( sAniDir.empty() )
|
||||
return;
|
||||
|
||||
if( sAniDir.Right(1) != SLASH )
|
||||
sAniDir += SLASH;
|
||||
if( sAniDir.Right(1) != "/" )
|
||||
sAniDir += "/";
|
||||
|
||||
RAGE_ASSERT_M( IsADirectory(sAniDir), sAniDir + " isn't a directory" );
|
||||
|
||||
@@ -79,9 +79,6 @@ void AddLayersFromAniDir( CString sAniDir, vector<BGAnimationLayer*> &layersAddT
|
||||
if( ini.GetValue(sLayer, "Import", sImportDir) )
|
||||
{
|
||||
// import a whole BGAnimation
|
||||
#ifdef _XBOX
|
||||
sImportDir.Replace( "/", SLASH );
|
||||
#endif
|
||||
sImportDir = sAniDir + sImportDir;
|
||||
CollapsePath( sImportDir );
|
||||
AddLayersFromAniDir( sImportDir, layersAddTo, Generic );
|
||||
@@ -104,8 +101,8 @@ void BGAnimation::LoadFromAniDir( CString sAniDir )
|
||||
if( sAniDir.empty() )
|
||||
return;
|
||||
|
||||
if( sAniDir.Right(1) != SLASH )
|
||||
sAniDir += SLASH;
|
||||
if( sAniDir.Right(1) != "/" )
|
||||
sAniDir += "/";
|
||||
|
||||
RAGE_ASSERT_M( IsADirectory(sAniDir), sAniDir + " isn't a directory" );
|
||||
|
||||
|
||||
@@ -434,8 +434,8 @@ void BGAnimationLayer::LoadFromAniLayerFile( CString sPath )
|
||||
void BGAnimationLayer::LoadFromIni( CString sAniDir, CString sLayer )
|
||||
{
|
||||
Init();
|
||||
if( sAniDir.Right(1) != SLASH )
|
||||
sAniDir += SLASH;
|
||||
if( sAniDir.Right(1) != "/" )
|
||||
sAniDir += "/";
|
||||
|
||||
ASSERT( IsADirectory(sAniDir) );
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ static const char *anims[NUM_ANIMATIONS] =
|
||||
|
||||
static CString GetAnimPath( Animation a )
|
||||
{
|
||||
return ssprintf("Characters%s%s", SLASH, anims[a]);
|
||||
return CString("Characters/") + anims[a];
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -303,7 +303,7 @@ void GameState::ReloadCharacters()
|
||||
}
|
||||
|
||||
if( !FoundDefault )
|
||||
RageException::Throw( "'Characters" SLASH "default' is missing." );
|
||||
RageException::Throw( "'Characters/default' is missing." );
|
||||
|
||||
// If FoundDefault, then we're not empty. -Chris
|
||||
// if( m_pCharacters.empty() )
|
||||
|
||||
@@ -48,7 +48,7 @@ void NoteSkinManager::RefreshNoteSkinData( Game game )
|
||||
|
||||
GameDef* pGameDef = GAMEMAN->GetGameDefForGame( game );
|
||||
|
||||
CString sBaseSkinFolder = NOTESKINS_DIR + pGameDef->m_szName + SLASH;
|
||||
CString sBaseSkinFolder = NOTESKINS_DIR + pGameDef->m_szName + "/";
|
||||
CStringArray asNoteSkinNames;
|
||||
GetDirListing( sBaseSkinFolder + "*", asNoteSkinNames, true );
|
||||
|
||||
@@ -156,7 +156,7 @@ CString NoteSkinManager::GetNoteSkinDir( CString sSkinName )
|
||||
{
|
||||
CString sGame = GAMESTATE->GetCurrentGameDef()->m_szName;
|
||||
|
||||
return NOTESKINS_DIR + sGame + SLASH + sSkinName + SLASH;
|
||||
return NOTESKINS_DIR + sGame + "/" + sSkinName + "/";
|
||||
}
|
||||
|
||||
CString NoteSkinManager::GetMetric( CString sNoteSkinName, CString sButtonName, CString sValue )
|
||||
|
||||
@@ -26,15 +26,14 @@ void FixSlashesInPlace( CString &sPath )
|
||||
|
||||
CString FixSlashes( CString sPath )
|
||||
{
|
||||
sPath.Replace( "/", SLASH );
|
||||
sPath.Replace( "\\", SLASH );
|
||||
FixSlashesInPlace( sPath );
|
||||
return sPath;
|
||||
}
|
||||
|
||||
void CollapsePath( CString &sPath )
|
||||
{
|
||||
CStringArray as;
|
||||
split( sPath, SLASH, as );
|
||||
split( sPath, "/", as );
|
||||
|
||||
for( unsigned i=0; i<as.size(); i++ )
|
||||
{
|
||||
@@ -45,7 +44,7 @@ void CollapsePath( CString &sPath )
|
||||
i -= 2;
|
||||
}
|
||||
}
|
||||
sPath = join( SLASH, as );
|
||||
sPath = join( "/", as );
|
||||
}
|
||||
|
||||
RageFile::RageFile()
|
||||
|
||||
@@ -68,7 +68,7 @@ int RageFileObj::GetFileSize()
|
||||
int RageFileDriver::GetPathValue( const CString &path )
|
||||
{
|
||||
vector<CString> parts;
|
||||
split( path, SLASH, parts, true );
|
||||
split( path, "/", parts, true );
|
||||
|
||||
CString PartialPath;
|
||||
|
||||
@@ -76,7 +76,7 @@ int RageFileDriver::GetPathValue( const CString &path )
|
||||
{
|
||||
PartialPath += parts[i];
|
||||
if( i+1 < parts.size() )
|
||||
PartialPath += SLASH;
|
||||
PartialPath += "/";
|
||||
|
||||
const RageFileManager::FileType Type = GetFileType( PartialPath );
|
||||
switch( Type )
|
||||
|
||||
@@ -215,8 +215,8 @@ void RageSoundManager::PlayOnceFromDir( CString sDir )
|
||||
return;
|
||||
|
||||
// make sure there's a slash at the end of this path
|
||||
if( sDir.Right(1) != SLASH )
|
||||
sDir += SLASH;
|
||||
if( sDir.Right(1) != "/" )
|
||||
sDir += "/";
|
||||
|
||||
CStringArray arraySoundFiles;
|
||||
GetDirListing( sDir + "*.mp3", arraySoundFiles );
|
||||
|
||||
@@ -53,8 +53,8 @@ void SongCacheIndex::ReadCacheIndex()
|
||||
|
||||
LOG->Trace( "Cache format is out of date. Deleting all cache files." );
|
||||
EmptyDir( CACHE_DIR );
|
||||
EmptyDir( CACHE_DIR "Banners" SLASH );
|
||||
EmptyDir( CACHE_DIR "Songs" SLASH );
|
||||
EmptyDir( CACHE_DIR "Banners/" );
|
||||
EmptyDir( CACHE_DIR "Songs/" );
|
||||
|
||||
CacheIndex.Reset();
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ void SongManager::AddGroup( CString sDir, CString sGroupDirName )
|
||||
|
||||
CString sBannerPath;
|
||||
if( !arrayGroupBanners.empty() )
|
||||
sBannerPath = sDir+sGroupDirName+SLASH+arrayGroupBanners[0] ;
|
||||
sBannerPath = sDir+sGroupDirName+"/"+arrayGroupBanners[0] ;
|
||||
else
|
||||
{
|
||||
// Look for a group banner in the parent folder
|
||||
@@ -167,8 +167,8 @@ void SongManager::AddGroup( CString sDir, CString sGroupDirName )
|
||||
void SongManager::LoadStepManiaSongDir( CString sDir, LoadingWindow *ld )
|
||||
{
|
||||
/* Make sure sDir has a trailing slash. */
|
||||
TrimRight( sDir, "/\\" );
|
||||
sDir += SLASH;
|
||||
if( sDir.Right(1) != "/" )
|
||||
sDir += "/";
|
||||
|
||||
// Find all group directories in "Songs" folder
|
||||
CStringArray arrayGroupDirs;
|
||||
@@ -186,7 +186,7 @@ void SongManager::LoadStepManiaSongDir( CString sDir, LoadingWindow *ld )
|
||||
|
||||
// Find all Song folders in this group directory
|
||||
CStringArray arraySongDirs;
|
||||
GetDirListing( sDir+sGroupDirName + SLASH "*", arraySongDirs, true, true );
|
||||
GetDirListing( sDir+sGroupDirName + "/*", arraySongDirs, true, true );
|
||||
SortCStringArray( arraySongDirs );
|
||||
|
||||
unsigned j;
|
||||
@@ -235,12 +235,12 @@ void SongManager::LoadGroupSymLinks(CString sDir, CString sGroupFolder)
|
||||
{
|
||||
// Find all symlink files in this folder
|
||||
CStringArray arraySymLinks;
|
||||
GetDirListing( sDir+sGroupFolder+SLASH+"*.include", arraySymLinks, false );
|
||||
GetDirListing( sDir+sGroupFolder+"/*.include", arraySymLinks, false );
|
||||
SortCStringArray( arraySymLinks );
|
||||
for( unsigned s=0; s< arraySymLinks.size(); s++ ) // for each symlink in this dir, add it in as a song.
|
||||
{
|
||||
MsdFile msdF;
|
||||
msdF.ReadFile( sDir+sGroupFolder+SLASH+arraySymLinks[s].c_str() );
|
||||
msdF.ReadFile( sDir+sGroupFolder+"/"+arraySymLinks[s].c_str() );
|
||||
CString sSymDestination = msdF.GetParam(0,1); // Should only be 1 vale¶m...period.
|
||||
|
||||
Song* pNewSong = new Song;
|
||||
@@ -511,7 +511,7 @@ void SongManager::InitCoursesFromDisk( LoadingWindow *ld )
|
||||
|
||||
// Find all CRS files in this group directory
|
||||
CStringArray arrayCoursePaths;
|
||||
GetDirListing( COURSES_DIR + sGroupDirName + SLASH + "*.crs", arrayCoursePaths, false, true );
|
||||
GetDirListing( COURSES_DIR + sGroupDirName + "/*.crs", arrayCoursePaths, false, true );
|
||||
SortCStringArray( arrayCoursePaths );
|
||||
|
||||
for( unsigned j=0; j<arrayCoursePaths.size(); j++ )
|
||||
@@ -615,7 +615,7 @@ void SongManager::GetEndlessCourses( vector<Course*> &AddTo, bool bIncludeAutoge
|
||||
bool SongManager::GetExtraStageInfoFromCourse( bool bExtra2, CString sPreferredGroup,
|
||||
Song*& pSongOut, Steps*& pNotesOut, PlayerOptions& po_out, SongOptions& so_out )
|
||||
{
|
||||
const CString sCourseSuffix = sPreferredGroup + SLASH + (bExtra2 ? "extra2" : "extra1") + ".crs";
|
||||
const CString sCourseSuffix = sPreferredGroup + "/" + (bExtra2 ? "extra2" : "extra1") + ".crs";
|
||||
CString sCoursePath = SONGS_DIR + sCourseSuffix;
|
||||
|
||||
/* Couldn't find course in DWI path or alternative song folders */
|
||||
@@ -750,8 +750,8 @@ Song* SongManager::GetRandomSong()
|
||||
|
||||
Song* SongManager::GetSongFromDir( CString sDir )
|
||||
{
|
||||
if( sDir.Right(1) != SLASH )
|
||||
sDir += SLASH;
|
||||
if( sDir.Right(1) != "/" )
|
||||
sDir += "/";
|
||||
|
||||
for( unsigned int i=0; i<m_pSongs.size(); i++ )
|
||||
if( sDir.CompareNoCase(m_pSongs[i]->GetSongDir()) == 0 )
|
||||
|
||||
@@ -1108,7 +1108,7 @@ bool HandleGlobalInputs( DeviceInput DeviceI, InputEventType type, GameInput Gam
|
||||
/* XXX slow? */
|
||||
for( int i=0; i<10000; i++ )
|
||||
{
|
||||
sPath = ssprintf("Screenshots" SLASH "screen%04d.bmp",i);
|
||||
sPath = ssprintf("Screenshots/screen%04d.bmp",i);
|
||||
if( !DoesFileExist(sPath) )
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ ThemeManager* THEME = NULL; // global object accessable from anywhere in the pro
|
||||
|
||||
const CString BASE_THEME_NAME = "default";
|
||||
const CString FALLBACK_THEME_NAME = "fallback";
|
||||
const CString LANGUAGES_SUBDIR = "Languages" SLASH;
|
||||
const CString LANGUAGES_SUBDIR = "Languages/";
|
||||
const CString BASE_LANGUAGE = "english";
|
||||
const CString THEMES_DIR = "Themes/";
|
||||
const CString METRICS_FILE = "metrics.ini";
|
||||
@@ -174,7 +174,7 @@ void ThemeManager::SwitchThemeAndLanguage( CString sThemeName, CString sLanguage
|
||||
|
||||
CString ThemeManager::GetThemeDirFromName( const CString &sThemeName )
|
||||
{
|
||||
return THEMES_DIR + sThemeName + SLASH;
|
||||
return THEMES_DIR + sThemeName + "/";
|
||||
}
|
||||
|
||||
CString ThemeManager::GetPathTo( CString sThemeName, ElementCategory category, CString sFileName )
|
||||
@@ -193,17 +193,17 @@ try_element_again:
|
||||
|
||||
if( bLookingForSpecificFile )
|
||||
{
|
||||
GetDirListing( sThemeDir + sCategory+SLASH+sFileName, asElementPaths, bDirsOnly, true );
|
||||
GetDirListing( sThemeDir + sCategory+"/"+sFileName, asElementPaths, bDirsOnly, true );
|
||||
}
|
||||
else // look for all files starting with sFileName that have types we can use
|
||||
{
|
||||
/* First, look for redirs. */
|
||||
GetDirListing( sThemeDir + sCategory + SLASH + sFileName + ".redir",
|
||||
GetDirListing( sThemeDir + sCategory + "/" + sFileName + ".redir",
|
||||
asElementPaths, false, true );
|
||||
|
||||
const CString wildcard = (category == BGAnimations? "":"*");
|
||||
CStringArray asPaths;
|
||||
GetDirListing( sThemeDir + sCategory + SLASH + sFileName + wildcard,
|
||||
GetDirListing( sThemeDir + sCategory + "/" + sFileName + wildcard,
|
||||
asPaths, bDirsOnly, true );
|
||||
|
||||
for( unsigned p = 0; p < asPaths.size(); ++p )
|
||||
@@ -347,7 +347,7 @@ try_element_again:
|
||||
|
||||
CString sCategory = ELEMENT_CATEGORY_STRING[category];
|
||||
|
||||
CString sMessage = "The theme element '" + sCategory + SLASH + sFileName +"' is missing.";
|
||||
CString sMessage = "The theme element '" + sCategory + "/" + sFileName +"' is missing.";
|
||||
switch( HOOKS->MessageBoxAbortRetryIgnore(sMessage, "MissingThemeElement") )
|
||||
{
|
||||
case ArchHooks::retry:
|
||||
@@ -356,7 +356,7 @@ try_element_again:
|
||||
goto try_element_again;
|
||||
case ArchHooks::ignore:
|
||||
LOG->Warn(
|
||||
"Theme element '%s" SLASH "%s' could not be found in '%s' or '%s'.",
|
||||
"Theme element '%s/%s' could not be found in '%s' or '%s'.",
|
||||
sCategory.c_str(),
|
||||
sFileName.c_str(),
|
||||
GetThemeDirFromName(m_sCurThemeName).c_str(),
|
||||
@@ -369,7 +369,7 @@ try_element_again:
|
||||
Cache[sFileName] = GetPathTo( category, "_missing" );
|
||||
return Cache[sFileName];
|
||||
case ArchHooks::abort:
|
||||
RageException::Throw( "Theme element '%s" SLASH "%s' could not be found in '%s' or '%s'.",
|
||||
RageException::Throw( "Theme element '%s/%s' could not be found in '%s' or '%s'.",
|
||||
sCategory.c_str(),
|
||||
sFileName.c_str(),
|
||||
GetThemeDirFromName(m_sCurThemeName).c_str(),
|
||||
|
||||
@@ -25,8 +25,8 @@ Transition::Transition()
|
||||
|
||||
void Transition::Load( CString sBGAniDir )
|
||||
{
|
||||
if( !sBGAniDir.empty() && sBGAniDir.Right(1) != SLASH )
|
||||
sBGAniDir += SLASH;
|
||||
if( !sBGAniDir.empty() && sBGAniDir.Right(1) != "/" )
|
||||
sBGAniDir += "/";
|
||||
|
||||
m_BGAnimation.LoadFromAniDir( sBGAniDir );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user