From 11870a6072bad611554c495a88e6f7da88d8e0f3 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 10 Dec 2003 09:26:05 +0000 Subject: [PATCH] continue phasing out BASE_PATH and SLASH --- stepmania/src/AnnouncerManager.cpp | 10 +++--- stepmania/src/BannerCache.cpp | 2 +- stepmania/src/Bookkeeper.cpp | 2 +- stepmania/src/Character.cpp | 28 ++++++++-------- stepmania/src/Course.cpp | 4 +-- stepmania/src/DancingCharacters.cpp | 16 ++++----- stepmania/src/GameConstantsAndTypes.h | 6 ++-- stepmania/src/GameState.cpp | 4 +-- stepmania/src/InputMapper.cpp | 2 +- stepmania/src/NoteSkinManager.cpp | 4 +-- stepmania/src/NotesLoaderKSF.cpp | 2 +- stepmania/src/PrefsManager.cpp | 4 +-- stepmania/src/ProfileManager.cpp | 18 +++++----- stepmania/src/RandomSample.cpp | 8 ++--- stepmania/src/ScreenHowToPlay.cpp | 2 +- stepmania/src/ScreenSandbox.cpp | 2 +- stepmania/src/Song.cpp | 14 ++++---- stepmania/src/SongManager.cpp | 4 +-- stepmania/src/StepMania.cpp | 2 +- stepmania/src/ThemeManager.cpp | 2 +- stepmania/src/UnlockSystem.cpp | 48 +++++++++++++-------------- 21 files changed, 91 insertions(+), 93 deletions(-) diff --git a/stepmania/src/AnnouncerManager.cpp b/stepmania/src/AnnouncerManager.cpp index 664c2c50f0..ac92a06aa6 100644 --- a/stepmania/src/AnnouncerManager.cpp +++ b/stepmania/src/AnnouncerManager.cpp @@ -57,7 +57,7 @@ bool AnnouncerManager::DoesAnnouncerExist( CString sAnnouncerName ) CString AnnouncerManager::GetAnnouncerDirFromName( CString sAnnouncerName ) { - return ANNOUNCERS_DIR + sAnnouncerName + SLASH; + return ANNOUNCERS_DIR + sAnnouncerName + "/"; } void AnnouncerManager::SwitchAnnouncer( CString sNewAnnouncerName ) @@ -103,8 +103,8 @@ CString AnnouncerManager::GetPathTo( CString sAnnouncerName, CString sFolderName const CString AnnouncerPath = GetAnnouncerDirFromName(sAnnouncerName); - if( !DirectoryIsEmpty(AnnouncerPath+sFolderName+SLASH) ) - return AnnouncerPath+sFolderName+SLASH; + if( !DirectoryIsEmpty(AnnouncerPath+sFolderName+"/") ) + return AnnouncerPath+sFolderName+"/"; /* Search for the announcer folder in the list of aliases. */ int i; @@ -113,8 +113,8 @@ CString AnnouncerManager::GetPathTo( CString sAnnouncerName, CString sFolderName if(sFolderName.CompareNoCase(aliases[i][0])) continue; /* no match */ - if( !DirectoryIsEmpty(AnnouncerPath+aliases[i][1]+SLASH) ) - return AnnouncerPath+aliases[i][1]+SLASH; + if( !DirectoryIsEmpty(AnnouncerPath+aliases[i][1]+"/") ) + return AnnouncerPath+aliases[i][1]+"/"; } /* No announcer directory matched. In debug, create the directory by diff --git a/stepmania/src/BannerCache.cpp b/stepmania/src/BannerCache.cpp index 5c9c1316c8..5e0ebafca4 100644 --- a/stepmania/src/BannerCache.cpp +++ b/stepmania/src/BannerCache.cpp @@ -53,7 +53,7 @@ CString BannerCache::GetBannerCachePath( CString BannerPath ) { /* Use GetHashForString, not ForFile, since we don't want to spend time * checking the file size and date. */ - return ssprintf( CACHE_DIR "Banners" SLASH "%u", GetHashForString(BannerPath) ); + return ssprintf( CACHE_DIR "Banners/%u", GetHashForString(BannerPath) ); } void BannerCache::LoadBanner( CString BannerPath ) diff --git a/stepmania/src/Bookkeeper.cpp b/stepmania/src/Bookkeeper.cpp index 2bbbf4992f..e2082372d3 100644 --- a/stepmania/src/Bookkeeper.cpp +++ b/stepmania/src/Bookkeeper.cpp @@ -24,7 +24,7 @@ Bookkeeper* BOOKKEEPER = NULL; // global and accessable from anywhere in our program -static const CString COINS_DAT = BASE_PATH "Data" SLASH "Coins.dat"; +static const CString COINS_DAT = "Data/Coins.dat"; const int COINS_DAT_VERSION = 1; diff --git a/stepmania/src/Character.cpp b/stepmania/src/Character.cpp index 7e8bcd0619..915c45096c 100644 --- a/stepmania/src/Character.cpp +++ b/stepmania/src/Character.cpp @@ -19,13 +19,13 @@ bool Character::Load( CString sCharDir ) { // Save character directory - if( sCharDir.Right(1)!=SLASH ) - sCharDir += SLASH; + if( sCharDir.Right(1) != "/" ) + sCharDir += "/"; m_sCharDir = sCharDir; // Save character name vector as; - split( sCharDir, SLASH, as ); + split( sCharDir, "/", as ); m_sName = as.back(); // Save attacks @@ -61,9 +61,9 @@ CString Character::GetModelPath() const return ""; } -CString Character::GetRestAnimationPath() const { return DerefRedir(GetRandomFileInDir(m_sCharDir + "Rest" SLASH)); } -CString Character::GetWarmUpAnimationPath() const { return DerefRedir(GetRandomFileInDir(m_sCharDir + "WarmUp" SLASH)); } -CString Character::GetDanceAnimationPath() const { return DerefRedir(GetRandomFileInDir(m_sCharDir + "Dance" SLASH)); } +CString Character::GetRestAnimationPath() const { return DerefRedir(GetRandomFileInDir(m_sCharDir + "Rest/")); } +CString Character::GetWarmUpAnimationPath() const { return DerefRedir(GetRandomFileInDir(m_sCharDir + "WarmUp/")); } +CString Character::GetDanceAnimationPath() const { return DerefRedir(GetRandomFileInDir(m_sCharDir + "Dance/")); } CString Character::GetTakingABreakPath() const { CStringArray as; @@ -144,21 +144,21 @@ CString Character::GetHeadPath() const bool Character::Has2DElems() { - if( DoesFileExist(m_sCharDir + SLASH + "2DFail" + SLASH + "BGAnimation.ini") ) // check 2D Idle BGAnim exists + if( DoesFileExist(m_sCharDir + "2DFail/BGAnimation.ini") ) // check 2D Idle BGAnim exists return true; - if( DoesFileExist(m_sCharDir + SLASH + "2DFever" + SLASH + "BGAnimation.ini") ) // check 2D Idle BGAnim exists + if( DoesFileExist(m_sCharDir + "2DFever/BGAnimation.ini") ) // check 2D Idle BGAnim exists return true; - if( DoesFileExist(m_sCharDir + SLASH + "2DGood" + SLASH + "BGAnimation.ini") ) // check 2D Idle BGAnim exists + if( DoesFileExist(m_sCharDir + "2DGood/BGAnimation.ini") ) // check 2D Idle BGAnim exists return true; - if( DoesFileExist(m_sCharDir + SLASH + "2DMiss" + SLASH + "BGAnimation.ini") ) // check 2D Idle BGAnim exists + if( DoesFileExist(m_sCharDir + "2DMiss/BGAnimation.ini") ) // check 2D Idle BGAnim exists return true; - if( DoesFileExist(m_sCharDir + SLASH + "2DWin" + SLASH + "BGAnimation.ini") ) // check 2D Idle BGAnim exists + if( DoesFileExist(m_sCharDir + "2DWin/BGAnimation.ini") ) // check 2D Idle BGAnim exists return true; - if( DoesFileExist(m_sCharDir + SLASH + "2DWinFever" + SLASH + "BGAnimation.ini") ) // check 2D Idle BGAnim exists + if( DoesFileExist(m_sCharDir + "2DWinFever/BGAnimation.ini") ) // check 2D Idle BGAnim exists return true; - if( DoesFileExist(m_sCharDir + SLASH + "2DGreat" + SLASH + "BGAnimation.ini") ) // check 2D Idle BGAnim exists + if( DoesFileExist(m_sCharDir + "2DGreat/BGAnimation.ini") ) // check 2D Idle BGAnim exists return true; - if( DoesFileExist(m_sCharDir + SLASH + "2DIdle" + SLASH + "BGAnimation.ini") ) // check 2D Idle BGAnim exists + if( DoesFileExist(m_sCharDir + "2DIdle/BGAnimation.ini") ) // check 2D Idle BGAnim exists return true; return false; } diff --git a/stepmania/src/Course.cpp b/stepmania/src/Course.cpp index 48d6bb9581..cb844d2035 100644 --- a/stepmania/src/Course.cpp +++ b/stepmania/src/Course.cpp @@ -70,7 +70,7 @@ float Course::GetMeter( int Difficult ) const return float(m_iMeter + (IsDifficult(Difficult)? DifficultMeterRamp:0)); /*LOG->Trace( "Course file '%s' contains a song '%s%s%s' that is not present", - m_sPath.c_str(), sGroup.c_str(), sGroup.size()? SLASH:"", sSong.c_str());*/ + m_sPath.c_str(), sGroup.c_str(), sGroup.size()? "/":"", sSong.c_str());*/ vector ci; GetCourseInfo( GAMESTATE->GetCurrentStyleDef()->m_StepsType, ci, Difficult ); @@ -351,7 +351,7 @@ void Course::Save() { // strip off everything but the group name and song dir CStringArray as; - split( entry.pSong->GetSongDir(), SLASH, as ); + split( entry.pSong->GetSongDir(), "/", as ); ASSERT( !as.empty() ); CString sGroup = as[ as.size()-2 ]; CString sSong = as[ as.size()-1 ]; diff --git a/stepmania/src/DancingCharacters.cpp b/stepmania/src/DancingCharacters.cpp index 9ecbe9d16e..cbea18f12d 100644 --- a/stepmania/src/DancingCharacters.cpp +++ b/stepmania/src/DancingCharacters.cpp @@ -63,7 +63,7 @@ DancingCharacters::DancingCharacters() CString sCharacterDirectory = pChar->m_sCharDir; CString sCurrentAnim; sCurrentAnim = sCharacterDirectory + "2DIdle"; - if( DoesFileExist(sCurrentAnim + SLASH + "BGAnimation.ini") ) // check 2D Idle BGAnim exists + if( DoesFileExist(sCurrentAnim + "/BGAnimation.ini") ) // check 2D Idle BGAnim exists { m_bHasIdleAnim[p] = m_bHas2DElements[p] = true; m_bgIdle[p].LoadFromAniDir( sCurrentAnim ); @@ -71,7 +71,7 @@ DancingCharacters::DancingCharacters() } sCurrentAnim = sCharacterDirectory + "2DMiss"; - if( DoesFileExist(sCurrentAnim + SLASH + "BGAnimation.ini") ) // check 2D Idle BGAnim exists + if( DoesFileExist(sCurrentAnim + "/BGAnimation.ini") ) // check 2D Idle BGAnim exists { m_bHasMissAnim[p] = m_bHas2DElements[p] = true; m_bgMiss[p].LoadFromAniDir( sCurrentAnim ); @@ -79,7 +79,7 @@ DancingCharacters::DancingCharacters() } sCurrentAnim = sCharacterDirectory + "2DGood"; - if( DoesFileExist(sCurrentAnim + SLASH + "BGAnimation.ini") ) // check 2D Idle BGAnim exists + if( DoesFileExist(sCurrentAnim + "/BGAnimation.ini") ) // check 2D Idle BGAnim exists { m_bHasGoodAnim[p] = m_bHas2DElements[p] = true; m_bgGood[p].LoadFromAniDir( sCurrentAnim ); @@ -87,7 +87,7 @@ DancingCharacters::DancingCharacters() } sCurrentAnim = sCharacterDirectory + "2DGreat"; - if( DoesFileExist(sCurrentAnim + SLASH + "BGAnimation.ini") ) // check 2D Idle BGAnim exists + if( DoesFileExist(sCurrentAnim + "/BGAnimation.ini") ) // check 2D Idle BGAnim exists { m_bHasGreatAnim[p] = m_bHas2DElements[p] = true; m_bgGreat[p].LoadFromAniDir( sCurrentAnim ); @@ -95,7 +95,7 @@ DancingCharacters::DancingCharacters() } sCurrentAnim = sCharacterDirectory + "2DFever"; - if( DoesFileExist(sCurrentAnim + SLASH + "BGAnimation.ini") ) // check 2D Idle BGAnim exists + if( DoesFileExist(sCurrentAnim + "/BGAnimation.ini") ) // check 2D Idle BGAnim exists { m_bHasFeverAnim[p] = m_bHas2DElements[p] = true; m_bgFever[p].LoadFromAniDir( sCurrentAnim ); @@ -103,7 +103,7 @@ DancingCharacters::DancingCharacters() } sCurrentAnim = sCharacterDirectory + "2DFail"; - if( DoesFileExist(sCurrentAnim + SLASH + "BGAnimation.ini") ) // check 2D Idle BGAnim exists + if( DoesFileExist(sCurrentAnim + "/BGAnimation.ini") ) // check 2D Idle BGAnim exists { m_bHasFailAnim[p] = m_bHas2DElements[p] = true; m_bgFail[p].LoadFromAniDir( sCurrentAnim ); @@ -111,7 +111,7 @@ DancingCharacters::DancingCharacters() } sCurrentAnim = sCharacterDirectory + "2DWin"; - if( DoesFileExist(sCurrentAnim + SLASH + "BGAnimation.ini") ) // check 2D Idle BGAnim exists + if( DoesFileExist(sCurrentAnim + "/BGAnimation.ini") ) // check 2D Idle BGAnim exists { m_bHasWinAnim[p] = m_bHas2DElements[p] = true; m_bgWin[p].LoadFromAniDir( sCurrentAnim ); @@ -119,7 +119,7 @@ DancingCharacters::DancingCharacters() } sCurrentAnim = sCharacterDirectory + "2DWinFever"; - if( DoesFileExist(sCurrentAnim + SLASH + "BGAnimation.ini") ) // check 2D Idle BGAnim exists + if( DoesFileExist(sCurrentAnim + "/BGAnimation.ini") ) // check 2D Idle BGAnim exists { m_bHasWinFeverAnim[p] = m_bHas2DElements[p] = true; m_bgWinFever[p].LoadFromAniDir( sCurrentAnim ); diff --git a/stepmania/src/GameConstantsAndTypes.h b/stepmania/src/GameConstantsAndTypes.h index a49828e784..f1587b2423 100644 --- a/stepmania/src/GameConstantsAndTypes.h +++ b/stepmania/src/GameConstantsAndTypes.h @@ -261,9 +261,9 @@ const int NUM_ATTACKS_PER_LEVEL = 3; const int ITEM_NONE = -1; -#define BG_ANIMS_DIR CString(BASE_PATH "BGAnimations" SLASH) -#define VISUALIZATIONS_DIR CString(BASE_PATH "Visualizations" SLASH) -#define RANDOMMOVIES_DIR CString(BASE_PATH "RandomMovies" SLASH) +#define BG_ANIMS_DIR CString("BGAnimations/") +#define VISUALIZATIONS_DIR CString("Visualizations/") +#define RANDOMMOVIES_DIR CString("RandomMovies/") diff --git a/stepmania/src/GameState.cpp b/stepmania/src/GameState.cpp index 65e22dc1d3..430a5bdde7 100644 --- a/stepmania/src/GameState.cpp +++ b/stepmania/src/GameState.cpp @@ -40,8 +40,8 @@ GameState* GAMESTATE = NULL; // global and accessable from anywhere in our program -#define CHARACTERS_DIR BASE_PATH "Characters" SLASH -#define NAMES_BLACKLIST_FILE BASE_PATH "Data" SLASH "NamesBlacklist.dat" +#define CHARACTERS_DIR "Characters/" +#define NAMES_BLACKLIST_FILE "Data/NamesBlacklist.dat" GameState::GameState() { diff --git a/stepmania/src/InputMapper.cpp b/stepmania/src/InputMapper.cpp index 50ccbe03f7..9f4336da24 100644 --- a/stepmania/src/InputMapper.cpp +++ b/stepmania/src/InputMapper.cpp @@ -25,7 +25,7 @@ InputMapper* INPUTMAPPER = NULL; // global and accessable from anywhere in our program -#define KEYMAPS_PATH BASE_PATH "Data" SLASH "Keymaps.ini" +#define KEYMAPS_PATH "Data/Keymaps.ini" InputMapper::InputMapper() { diff --git a/stepmania/src/NoteSkinManager.cpp b/stepmania/src/NoteSkinManager.cpp index 8838e21def..4a103e01e8 100644 --- a/stepmania/src/NoteSkinManager.cpp +++ b/stepmania/src/NoteSkinManager.cpp @@ -27,9 +27,9 @@ NoteSkinManager* NOTESKIN = NULL; // global object accessable from anywhere in the program -const CString NOTESKINS_DIR = BASE_PATH "NoteSkins" SLASH; +const CString NOTESKINS_DIR = "NoteSkins/"; const CString GAME_BASE_NOTESKIN_NAME = "default"; -const CString GLOBAL_BASE_NOTESKIN_DIR = NOTESKINS_DIR + "common" SLASH "default" SLASH; +const CString GLOBAL_BASE_NOTESKIN_DIR = NOTESKINS_DIR + "common/default/"; NoteSkinManager::NoteSkinManager() { diff --git a/stepmania/src/NotesLoaderKSF.cpp b/stepmania/src/NotesLoaderKSF.cpp index ddd64e5fea..12771cba41 100644 --- a/stepmania/src/NotesLoaderKSF.cpp +++ b/stepmania/src/NotesLoaderKSF.cpp @@ -319,7 +319,7 @@ bool KSFLoader::LoadGlobalData( const CString &sPath, Song &out ) /* Try to fill in missing bits of information from the pathname. */ { CStringArray asBits; - split( sPath, SLASH, asBits, true); + split( sPath, "/", asBits, true); ASSERT(asBits.size() > 1); LoadTags(asBits[asBits.size()-2], out); diff --git a/stepmania/src/PrefsManager.cpp b/stepmania/src/PrefsManager.cpp index 93589db985..00c9280cce 100644 --- a/stepmania/src/PrefsManager.cpp +++ b/stepmania/src/PrefsManager.cpp @@ -20,8 +20,8 @@ #include "RageSoundReader_Resample.h" /* for ResampleQuality */ #include "RageFile.h" -#define STEPMANIA_INI_PATH BASE_PATH "Data" SLASH "StepMania.ini" -#define STATIC_INI_PATH BASE_PATH "Data" SLASH "Static.ini" +#define STEPMANIA_INI_PATH "Data/StepMania.ini" +#define STATIC_INI_PATH "Data/Static.ini" PrefsManager* PREFSMAN = NULL; // global and accessable from anywhere in our program diff --git a/stepmania/src/ProfileManager.cpp b/stepmania/src/ProfileManager.cpp index 30991c995f..e5ca3de412 100644 --- a/stepmania/src/ProfileManager.cpp +++ b/stepmania/src/ProfileManager.cpp @@ -58,8 +58,8 @@ const int COURSE_SCORES_VERSION = 7; static const char *MemCardDirs[NUM_PLAYERS] = { /* @ is important; see RageFileManager LoadedDriver::GetPath */ - "@mc1" SLASH, - "@mc2" SLASH, + "@mc1/", + "@mc2/", }; ProfileManager::ProfileManager() @@ -94,7 +94,7 @@ void ProfileManager::GetLocalProfileNames( vector &asNamesOut ) CString sProfileID = vsProfileIDs[i]; Profile pro; - pro.LoadFromIni( USER_PROFILES_DIR + sProfileID + SLASH + PROFILE_FILE ); + pro.LoadFromIni( USER_PROFILES_DIR + sProfileID + "/" + PROFILE_FILE ); asNamesOut.push_back( pro.m_sName ); } } @@ -103,7 +103,7 @@ void ProfileManager::GetLocalProfileNames( vector &asNamesOut ) bool ProfileManager::LoadProfile( PlayerNumber pn, CString sProfileDir, bool bIsMemCard ) { ASSERT( !sProfileDir.empty() ); - ASSERT( sProfileDir.Right(1) == SLASH ); + ASSERT( sProfileDir.Right(1) == "/" ); m_sProfileDir[pn] = sProfileDir; m_bUsingMemoryCard[pn] = bIsMemCard; @@ -155,7 +155,7 @@ bool ProfileManager::LoadDefaultProfileFromMachine( PlayerNumber pn ) return false; } - CString sDir = USER_PROFILES_DIR + sProfileID + SLASH; + CString sDir = USER_PROFILES_DIR + sProfileID + "/"; return LoadProfile( pn, sDir, false ); } @@ -237,7 +237,7 @@ bool Profile::LoadFromIni( CString sIniPath ) Init(); CStringArray asBits; - split( Dirname(sIniPath), SLASH, asBits, true ); + split( Dirname(sIniPath), "/", asBits, true ); CString sLastDir = asBits.back(); // this is a number name, e.g. "0000001" // Fill in a default value in case ini doesn't have it. @@ -317,7 +317,7 @@ bool ProfileManager::CreateLocalProfile( CString sName ) } if( i == MAX_TRIES ) return false; - sProfileDir += SLASH; + sProfileDir += "/"; Profile pro; pro.m_sName = sName; @@ -336,7 +336,7 @@ bool ProfileManager::RenameLocalProfile( CString sProfileID, CString sNewName ) ASSERT( !sProfileID.empty() ); CString sProfileDir = USER_PROFILES_DIR + sProfileID; - CString sProfileFile = sProfileDir + SLASH PROFILE_FILE; + CString sProfileFile = sProfileDir + "/" + PROFILE_FILE; Profile pro; bool bResult; @@ -356,7 +356,7 @@ bool ProfileManager::DeleteLocalProfile( CString sProfileID ) // delete all files in profile dir CString sProfileDir = USER_PROFILES_DIR + sProfileID; CStringArray asFilesToDelete; - GetDirListing( sProfileDir + SLASH "*", asFilesToDelete, false, true ); + GetDirListing( sProfileDir + "/*", asFilesToDelete, false, true ); for( unsigned i=0; i= 4 ); /* Songs/Slow/Taps/ */ m_sGroupName = sDirectoryParts[sDirectoryParts.size()-3]; // second from last item ASSERT( m_sGroupName != "" ); @@ -660,7 +660,7 @@ void Song::TidyUpData() /* Use the song directory name. */ CString SongDir = this->GetSongDir(); vector parts; - split(SongDir, SLASH, parts); + split(SongDir, "/", parts); ASSERT(parts.size() > 0); NotesLoader::GetMainAndSubTitlesFromFullTitle( parts[parts.size()-1], m_sMainTitle, m_sSubTitle ); @@ -1651,7 +1651,7 @@ 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(SLASH[0]) == -1) + if( m_sMusicFile.Find('/') == -1) return m_sSongDir+m_sMusicFile; /* Otherwise, it's relative to the top of the SM directory (the CWD), so @@ -1675,7 +1675,7 @@ CString Song::GetLyricsPath() const CString Song::GetCDTitlePath() const { - if( m_sCDTitleFile.Find(SLASH[0]) != -1 ) + if( m_sCDTitleFile.Find('/') != -1 ) return m_sSongDir+m_sCDTitleFile; return m_sCDTitleFile; } diff --git a/stepmania/src/SongManager.cpp b/stepmania/src/SongManager.cpp index 9355a05788..9b536a34da 100644 --- a/stepmania/src/SongManager.cpp +++ b/stepmania/src/SongManager.cpp @@ -34,8 +34,8 @@ SongManager* SONGMAN = NULL; // global and accessable from anywhere in our program -#define SONGS_DIR BASE_PATH "Songs" SLASH -#define COURSES_DIR BASE_PATH "Courses" SLASH +#define SONGS_DIR "Songs/" +#define COURSES_DIR "Courses/" #define NUM_GROUP_COLORS THEME->GetMetricI("SongManager","NumGroupColors") diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index 62109b2061..a8faa478cb 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -773,7 +773,7 @@ static void MountTreeOfZips( const CString &dir ) } } -#define UNLOCKS_PATH BASE_PATH "Data/Unlocks.dat" +#define UNLOCKS_PATH "Data/Unlocks.dat" #ifdef _XBOX char *xboxargv[] = { "d:\\default.xbe" }; diff --git a/stepmania/src/ThemeManager.cpp b/stepmania/src/ThemeManager.cpp index 830342a7ae..5068f0cdac 100644 --- a/stepmania/src/ThemeManager.cpp +++ b/stepmania/src/ThemeManager.cpp @@ -35,7 +35,7 @@ const CString BASE_THEME_NAME = "default"; const CString FALLBACK_THEME_NAME = "fallback"; const CString LANGUAGES_SUBDIR = "Languages" SLASH; const CString BASE_LANGUAGE = "english"; -const CString THEMES_DIR = BASE_PATH "Themes" SLASH; +const CString THEMES_DIR = "Themes/"; const CString METRICS_FILE = "metrics.ini"; const CString ELEMENT_CATEGORY_STRING[NUM_ELEMENT_CATEGORIES] = { diff --git a/stepmania/src/UnlockSystem.cpp b/stepmania/src/UnlockSystem.cpp index c762e33844..89bf5c21d5 100644 --- a/stepmania/src/UnlockSystem.cpp +++ b/stepmania/src/UnlockSystem.cpp @@ -22,12 +22,10 @@ #include "IniFile.h" #include "MsdFile.h" -using namespace std; - -#include "stdio.h" - UnlockSystem* UNLOCKSYS = NULL; // global and accessable from anywhere in our program +#define MEMCARD_PATH "Data/MemCard.ini" + UnlockSystem::UnlockSystem() { UNLOCKSYS = this; @@ -41,9 +39,9 @@ UnlockSystem::UnlockSystem() StagesCleared = 0; RouletteSeeds = "1"; - ReadValues("Data" SLASH "MemCard.ini"); // in case its ever accessed, + ReadValues( MEMCARD_PATH ); // in case its ever accessed, // we want the values to be available - WriteValues("Data" SLASH "MemCard.ini"); // create if it does not exist + WriteValues( MEMCARD_PATH ); // create if it does not exist } void UnlockSystem::RouletteUnlock( const Song *song ) @@ -60,7 +58,7 @@ void UnlockSystem::RouletteUnlock( const Song *song ) ASSERT( p->m_iRouletteSeed < (int) RouletteSeeds.size() ); RouletteSeeds[p->m_iRouletteSeed] = '1'; - WriteValues("Data" SLASH "MemCard.ini"); + WriteValues( MEMCARD_PATH ); } bool UnlockSystem::CourseIsLocked( const Course *course ) @@ -420,88 +418,88 @@ bool UnlockSystem::WriteValues( CString filename) float UnlockSystem::UnlockAddAP(float credit) { - ReadValues("Data" SLASH "MemCard.ini"); + ReadValues( MEMCARD_PATH ); ArcadePoints += credit; - WriteValues("Data" SLASH "MemCard.ini"); + WriteValues( MEMCARD_PATH ); return ArcadePoints; } float UnlockSystem::UnlockAddAP(Grade credit) { - ReadValues("Data" SLASH "MemCard.ini"); + ReadValues( MEMCARD_PATH ); if (credit != GRADE_E && credit != GRADE_D) ArcadePoints += 1; if (credit == GRADE_AAA) ArcadePoints += 9; - WriteValues("Data" SLASH "MemCard.ini"); + WriteValues( MEMCARD_PATH ); return ArcadePoints; } float UnlockSystem::UnlockAddDP(float credit) { - ReadValues("Data" SLASH "MemCard.ini"); + ReadValues( MEMCARD_PATH ); // we don't want to ever take away dance points if (credit > 0) DancePoints += credit; - WriteValues("Data" SLASH "MemCard.ini"); + WriteValues( MEMCARD_PATH ); return DancePoints; } float UnlockSystem::UnlockAddSP(float credit) { - ReadValues("Data" SLASH "MemCard.ini"); + ReadValues( MEMCARD_PATH ); SongPoints += credit; - WriteValues("Data" SLASH "MemCard.ini"); + WriteValues( MEMCARD_PATH ); return SongPoints; } float UnlockSystem::UnlockAddSP(Grade credit) { - ReadValues("Data" SLASH "MemCard.ini"); + ReadValues( MEMCARD_PATH ); const float SongPointsVals[NUM_GRADES] = { -1 /* unused */, 0, 1, 2, 3, 4, 5, 10, 20 }; SongPoints += SongPointsVals[credit]; - WriteValues("Data" SLASH "MemCard.ini"); + WriteValues( MEMCARD_PATH ); return SongPoints; } float UnlockSystem::UnlockClearExtraStage() { - ReadValues("Data" SLASH "MemCard.ini"); + ReadValues( MEMCARD_PATH ); ExtraClearPoints++; - WriteValues("Data" SLASH "MemCard.ini"); + WriteValues( MEMCARD_PATH ); return ExtraClearPoints; } float UnlockSystem::UnlockFailExtraStage() { - ReadValues("Data" SLASH "MemCard.ini"); + ReadValues( MEMCARD_PATH ); ExtraFailPoints++; - WriteValues("Data" SLASH "MemCard.ini"); + WriteValues( MEMCARD_PATH ); return ExtraFailPoints; } float UnlockSystem::UnlockClearStage() { - ReadValues("Data" SLASH "MemCard.ini"); + ReadValues( MEMCARD_PATH ); StagesCleared++; - WriteValues("Data" SLASH "MemCard.ini"); + WriteValues( MEMCARD_PATH ); return StagesCleared; } float UnlockSystem::UnlockToasty() { - ReadValues("Data" SLASH "MemCard.ini"); + ReadValues( MEMCARD_PATH ); ToastyPoints++; - WriteValues("Data" SLASH "MemCard.ini"); + WriteValues( MEMCARD_PATH ); return ToastyPoints; }