enum name cleanup

This commit is contained in:
Chris Danford
2005-12-01 03:20:25 +00:00
parent 1829ba9eee
commit 36c7d8e0ed
26 changed files with 164 additions and 139 deletions
+1 -1
View File
@@ -214,7 +214,7 @@ void Course::Init()
m_sSubTitleTranslit = ""; m_sSubTitleTranslit = "";
m_sBannerPath = ""; m_sBannerPath = "";
m_sCDTitlePath = ""; m_sCDTitlePath = "";
m_LoadedFromProfile = PROFILE_SLOT_INVALID; m_LoadedFromProfile = ProfileSlot_INVALID;
m_iTrailCacheSeed = 0; m_iTrailCacheSeed = 0;
} }
+2 -2
View File
@@ -204,8 +204,8 @@ public:
bool GetTrailUnsorted( StepsType st, CourseDifficulty cd, Trail &trail ) const; bool GetTrailUnsorted( StepsType st, CourseDifficulty cd, Trail &trail ) const;
bool GetTrailSorted( StepsType st, CourseDifficulty cd, Trail &trail ) const; bool GetTrailSorted( StepsType st, CourseDifficulty cd, Trail &trail ) const;
bool IsAnEdit() const { return m_LoadedFromProfile != PROFILE_SLOT_INVALID; } bool IsAnEdit() const { return m_LoadedFromProfile != ProfileSlot_INVALID; }
ProfileSlot m_LoadedFromProfile; // PROFILE_SLOT_INVALID if wasn't loaded from a profile ProfileSlot m_LoadedFromProfile; // ProfileSlot_INVALID if wasn't loaded from a profile
typedef pair<StepsType,Difficulty> CacheEntry; typedef pair<StepsType,Difficulty> CacheEntry;
struct CacheData struct CacheData
+19 -6
View File
@@ -33,8 +33,8 @@ static const CString EditMenuActionNames[] = {
"Create", "Create",
"Practice", "Practice",
}; };
XToString( EditMenuAction, NUM_EDIT_MENU_ACTIONS ); XToString( EditMenuAction, NUM_EditMenuAction );
XToThemedString( EditMenuAction, NUM_EDIT_MENU_ACTIONS ); XToThemedString( EditMenuAction, NUM_EditMenuAction );
StringToX( EditMenuAction ); StringToX( EditMenuAction );
static CString ARROWS_X_NAME( size_t i ) { return ssprintf("Arrows%dX",int(i+1)); } static CString ARROWS_X_NAME( size_t i ) { return ssprintf("Arrows%dX",int(i+1)); }
@@ -366,12 +366,25 @@ void EditMenu::OnRowValueChanged( EditMenuRow row )
FOREACH_Difficulty( dc ) FOREACH_Difficulty( dc )
{ {
if( dc == DIFFICULTY_EDIT ) if( dc == DIFFICULTY_EDIT )
{
switch( EDIT_MODE.GetValue() )
{
case EDIT_MODE_FULL:
case EDIT_MODE_PRACTICE:
{ {
vector<Steps*> v; vector<Steps*> v;
GetSelectedSong()->GetSteps( v, GetSelectedStepsType(), DIFFICULTY_EDIT ); GetSelectedSong()->GetSteps( v, GetSelectedStepsType(), DIFFICULTY_EDIT );
StepsUtil::SortStepsByDescription( v ); StepsUtil::SortStepsByDescription( v );
FOREACH_CONST( Steps*, v, p ) FOREACH_CONST( Steps*, v, p )
m_vpSteps.push_back( StepsAndDifficulty(*p,dc) ); m_vpSteps.push_back( StepsAndDifficulty(*p,dc) );
}
break;
case EDIT_MODE_HOME:
// have only "New Edit"
break;
default:
ASSERT(0);
}
switch( EDIT_MODE.GetValue() ) switch( EDIT_MODE.GetValue() )
{ {
@@ -508,12 +521,12 @@ void EditMenu::OnRowValueChanged( EditMenuRow row )
switch( EDIT_MODE.GetValue() ) switch( EDIT_MODE.GetValue() )
{ {
case EDIT_MODE_PRACTICE: case EDIT_MODE_PRACTICE:
m_Actions.push_back( EDIT_MENU_ACTION_PRACTICE ); m_Actions.push_back( EditMenuAction_Practice );
break; break;
case EDIT_MODE_HOME: case EDIT_MODE_HOME:
case EDIT_MODE_FULL: case EDIT_MODE_FULL:
m_Actions.push_back( EDIT_MENU_ACTION_EDIT ); m_Actions.push_back( EditMenuAction_Edit );
m_Actions.push_back( EDIT_MENU_ACTION_DELETE ); m_Actions.push_back( EditMenuAction_Delete );
break; break;
default: default:
ASSERT(0); ASSERT(0);
@@ -521,7 +534,7 @@ void EditMenu::OnRowValueChanged( EditMenuRow row )
} }
else else
{ {
m_Actions.push_back( EDIT_MENU_ACTION_CREATE ); m_Actions.push_back( EditMenuAction_Create );
} }
m_iSelection[ROW_ACTION] = 0; m_iSelection[ROW_ACTION] = 0;
} }
+6 -6
View File
@@ -31,13 +31,13 @@ const CString& EditMenuRowToThemedString( EditMenuRow r );
enum EditMenuAction enum EditMenuAction
{ {
EDIT_MENU_ACTION_EDIT, EditMenuAction_Edit,
EDIT_MENU_ACTION_DELETE, EditMenuAction_Delete,
EDIT_MENU_ACTION_CREATE, EditMenuAction_Create,
EDIT_MENU_ACTION_PRACTICE, EditMenuAction_Practice,
NUM_EDIT_MENU_ACTIONS NUM_EditMenuAction
}; };
#define FOREACH_EditMenuAction( ema ) FOREACH_ENUM( EditMenuAction, NUM_EDIT_MENU_ACTIONS, ema ) #define FOREACH_EditMenuAction( ema ) FOREACH_ENUM( EditMenuAction, NUM_EditMenuAction, ema )
const CString& EditMenuActionToString( EditMenuAction ema ); const CString& EditMenuActionToString( EditMenuAction ema );
const CString& EditMenuActionToThemedString( EditMenuAction ema ); const CString& EditMenuActionToThemedString( EditMenuAction ema );
+1 -1
View File
@@ -268,7 +268,7 @@ static const CString MemoryCardStateNames[] = {
"removed", "removed",
"none", "none",
}; };
XToString( MemoryCardState, NUM_MEMORY_CARD_STATES ); XToString( MemoryCardState, NUM_MemoryCardState );
static const CString PerDifficultyAwardNames[] = { static const CString PerDifficultyAwardNames[] = {
+14 -14
View File
@@ -195,25 +195,25 @@ enum ScoreEvent
// //
enum ProfileSlot enum ProfileSlot
{ {
PROFILE_SLOT_PLAYER_1, ProfileSlot_Player1,
PROFILE_SLOT_PLAYER_2, ProfileSlot_Player2,
PROFILE_SLOT_MACHINE, ProfileSlot_Machine,
NUM_PROFILE_SLOTS, NUM_ProfileSlot,
PROFILE_SLOT_INVALID ProfileSlot_INVALID
}; };
#define FOREACH_ProfileSlot( slot ) FOREACH_ENUM( ProfileSlot, NUM_PROFILE_SLOTS, slot ) #define FOREACH_ProfileSlot( slot ) FOREACH_ENUM( ProfileSlot, NUM_ProfileSlot, slot )
enum MemoryCardState enum MemoryCardState
{ {
MEMORY_CARD_STATE_READY, MemoryCardState_Ready,
MEMORY_CARD_STATE_CHECKING, MemoryCardState_Checking,
MEMORY_CARD_STATE_TOO_LATE, MemoryCardState_TooLate,
MEMORY_CARD_STATE_ERROR, MemoryCardState_Error,
MEMORY_CARD_STATE_REMOVED, MemoryCardState_Removed,
MEMORY_CARD_STATE_NO_CARD, MemoryCardState_NoCard,
NUM_MEMORY_CARD_STATES, NUM_MemoryCardState,
MEMORY_CARD_STATE_INVALID, MemoryCardState_INVALID,
}; };
const CString& MemoryCardStateToString( MemoryCardState mcs ); const CString& MemoryCardStateToString( MemoryCardState mcs );
+3 -3
View File
@@ -11,14 +11,14 @@ REGISTER_ACTOR_CLASS( MemoryCardDisplay )
MemoryCardDisplay::MemoryCardDisplay() MemoryCardDisplay::MemoryCardDisplay()
{ {
m_PlayerNumber = PLAYER_INVALID; m_PlayerNumber = PLAYER_INVALID;
m_LastSeenState = MEMORY_CARD_STATE_INVALID; m_LastSeenState = MemoryCardState_INVALID;
} }
void MemoryCardDisplay::Load( PlayerNumber pn ) void MemoryCardDisplay::Load( PlayerNumber pn )
{ {
m_PlayerNumber = pn; m_PlayerNumber = pn;
for( int i=0; i<NUM_MEMORY_CARD_STATES; i++ ) for( int i=0; i<NUM_MemoryCardState; i++ )
{ {
MemoryCardState mcs = (MemoryCardState)i; MemoryCardState mcs = (MemoryCardState)i;
CString sState = MemoryCardStateToString(mcs); CString sState = MemoryCardStateToString(mcs);
@@ -43,7 +43,7 @@ void MemoryCardDisplay::Update( float fDelta )
MemoryCardState newMcs = MEMCARDMAN->GetCardState(m_PlayerNumber); MemoryCardState newMcs = MEMCARDMAN->GetCardState(m_PlayerNumber);
if( m_LastSeenState != newMcs ) if( m_LastSeenState != newMcs )
{ {
if( m_LastSeenState != MEMORY_CARD_STATE_INVALID ) if( m_LastSeenState != MemoryCardState_INVALID )
m_spr[m_LastSeenState].SetHidden( true ); m_spr[m_LastSeenState].SetHidden( true );
m_LastSeenState = newMcs; m_LastSeenState = newMcs;
m_spr[m_LastSeenState].SetHidden( false ); m_spr[m_LastSeenState].SetHidden( false );
+1 -1
View File
@@ -19,7 +19,7 @@ public:
protected: protected:
PlayerNumber m_PlayerNumber; PlayerNumber m_PlayerNumber;
MemoryCardState m_LastSeenState; MemoryCardState m_LastSeenState;
Sprite m_spr[NUM_MEMORY_CARD_STATES]; Sprite m_spr[NUM_MemoryCardState];
}; };
#endif #endif
+19 -19
View File
@@ -295,7 +295,7 @@ MemoryCardManager::MemoryCardManager()
FOREACH_PlayerNumber( p ) FOREACH_PlayerNumber( p )
{ {
m_bMounted[p] = false; m_bMounted[p] = false;
m_State[p] = MEMORY_CARD_STATE_NO_CARD; m_State[p] = MemoryCardState_NoCard;
} }
/* These can play at any time. Preload them, so we don't cause a skip in gameplay. */ /* These can play at any time. Preload them, so we don't cause a skip in gameplay. */
@@ -420,7 +420,7 @@ void MemoryCardManager::CheckStateChanges()
{ {
UsbStorageDevice &new_device = m_Device[p]; UsbStorageDevice &new_device = m_Device[p];
MemoryCardState state = MEMORY_CARD_STATE_INVALID; MemoryCardState state = MemoryCardState_INVALID;
CString sError; CString sError;
if( m_bCardsLocked ) if( m_bCardsLocked )
@@ -430,21 +430,21 @@ void MemoryCardManager::CheckStateChanges()
/* We didn't have a card when we finalized, so we won't accept anything. /* We didn't have a card when we finalized, so we won't accept anything.
* If anything is inserted (even if it's still checking), say TOO LATE. */ * If anything is inserted (even if it's still checking), say TOO LATE. */
if( new_device.m_State == UsbStorageDevice::STATE_NONE ) if( new_device.m_State == UsbStorageDevice::STATE_NONE )
state = MEMORY_CARD_STATE_NO_CARD; state = MemoryCardState_NoCard;
else else
state = MEMORY_CARD_STATE_TOO_LATE; state = MemoryCardState_TooLate;
} }
else else
{ {
/* We had a card inserted when we finalized. */ /* We had a card inserted when we finalized. */
if( new_device.m_State == UsbStorageDevice::STATE_NONE ) if( new_device.m_State == UsbStorageDevice::STATE_NONE )
state = MEMORY_CARD_STATE_REMOVED; state = MemoryCardState_Removed;
if( new_device.m_State == UsbStorageDevice::STATE_READY ) if( new_device.m_State == UsbStorageDevice::STATE_READY )
{ {
if( m_FinalDevice[p].sSerial != new_device.sSerial ) if( m_FinalDevice[p].sSerial != new_device.sSerial )
{ {
/* A different card is inserted than we had when we finalized. */ /* A different card is inserted than we had when we finalized. */
state = MEMORY_CARD_STATE_ERROR; state = MemoryCardState_Error;
sError = "Changed"; sError = "Changed";
} }
} }
@@ -453,25 +453,25 @@ void MemoryCardManager::CheckStateChanges()
} }
} }
if( state == MEMORY_CARD_STATE_INVALID ) if( state == MemoryCardState_INVALID )
{ {
switch( new_device.m_State ) switch( new_device.m_State )
{ {
case UsbStorageDevice::STATE_NONE: case UsbStorageDevice::STATE_NONE:
state = MEMORY_CARD_STATE_NO_CARD; state = MemoryCardState_NoCard;
break; break;
case UsbStorageDevice::STATE_CHECKING: case UsbStorageDevice::STATE_CHECKING:
state = MEMORY_CARD_STATE_CHECKING; state = MemoryCardState_Checking;
break; break;
case UsbStorageDevice::STATE_ERROR: case UsbStorageDevice::STATE_ERROR:
state = MEMORY_CARD_STATE_ERROR; state = MemoryCardState_Error;
sError = new_device.m_sError; sError = new_device.m_sError;
break; break;
case UsbStorageDevice::STATE_READY: case UsbStorageDevice::STATE_READY:
state = MEMORY_CARD_STATE_READY; state = MemoryCardState_Ready;
break; break;
} }
} }
@@ -482,21 +482,21 @@ void MemoryCardManager::CheckStateChanges()
// play sound // play sound
switch( state ) switch( state )
{ {
case MEMORY_CARD_STATE_NO_CARD: case MemoryCardState_NoCard:
case MEMORY_CARD_STATE_REMOVED: case MemoryCardState_Removed:
if( LastState == MEMORY_CARD_STATE_READY ) if( LastState == MemoryCardState_Ready )
{ {
m_soundDisconnect.Play(); m_soundDisconnect.Play();
MESSAGEMAN->Broadcast( (Message)(Message_CardRemovedP1+p) ); MESSAGEMAN->Broadcast( (Message)(Message_CardRemovedP1+p) );
} }
break; break;
case MEMORY_CARD_STATE_READY: case MemoryCardState_Ready:
m_soundReady.Play(); m_soundReady.Play();
break; break;
case MEMORY_CARD_STATE_TOO_LATE: case MemoryCardState_TooLate:
m_soundTooLate.Play(); m_soundTooLate.Play();
break; break;
case MEMORY_CARD_STATE_ERROR: case MemoryCardState_Error:
m_soundError.Play(); m_soundError.Play();
break; break;
} }
@@ -579,7 +579,7 @@ void MemoryCardManager::UnlockCards()
bool MemoryCardManager::MountCard( PlayerNumber pn, int iTimeout ) bool MemoryCardManager::MountCard( PlayerNumber pn, int iTimeout )
{ {
LOG->Trace( "MemoryCardManager::MountCard(%i)", pn ); LOG->Trace( "MemoryCardManager::MountCard(%i)", pn );
if( GetCardState(pn) != MEMORY_CARD_STATE_READY ) if( GetCardState(pn) != MemoryCardState_Ready )
return false; return false;
ASSERT( !m_Device[pn].IsBlank() ); ASSERT( !m_Device[pn].IsBlank() );
@@ -724,7 +724,7 @@ bool IsAnyPlayerUsingMemoryCard()
{ {
FOREACH_HumanPlayer( pn ) FOREACH_HumanPlayer( pn )
{ {
if( MEMCARDMAN->GetCardState(pn) == MEMORY_CARD_STATE_READY ) if( MEMCARDMAN->GetCardState(pn) == MemoryCardState_Ready )
return true; return true;
} }
return false; return false;
+1 -1
View File
@@ -63,7 +63,7 @@ protected:
UsbStorageDevice m_FinalDevice[NUM_PLAYERS]; // device in the memory card slot when we finalized, blank if none UsbStorageDevice m_FinalDevice[NUM_PLAYERS]; // device in the memory card slot when we finalized, blank if none
MemoryCardState m_State[NUM_PLAYERS]; MemoryCardState m_State[NUM_PLAYERS];
CString m_sError[NUM_PLAYERS]; // if MEMORY_CARD_STATE_ERROR CString m_sError[NUM_PLAYERS]; // if MemoryCardState_Error
RageSound m_soundReady; RageSound m_soundReady;
RageSound m_soundError; RageSound m_soundError;
+1 -1
View File
@@ -290,7 +290,7 @@ void MusicWheelItem::RefreshGrades()
if( PROFILEMAN->IsPersistentProfile(p) ) if( PROFILEMAN->IsPersistentProfile(p) )
PROFILEMAN->GetHighScoreForDifficulty( data->m_pSong, GAMESTATE->GetCurrentStyle(), (ProfileSlot)p, dc, hs ); PROFILEMAN->GetHighScoreForDifficulty( data->m_pSong, GAMESTATE->GetCurrentStyle(), (ProfileSlot)p, dc, hs );
else else
PROFILEMAN->GetHighScoreForDifficulty( data->m_pSong, GAMESTATE->GetCurrentStyle(), PROFILE_SLOT_MACHINE, dc, hs ); PROFILEMAN->GetHighScoreForDifficulty( data->m_pSong, GAMESTATE->GetCurrentStyle(), ProfileSlot_Machine, dc, hs );
m_pGradeDisplay[p]->SetGrade( p, hs.GetGrade() ); m_pGradeDisplay[p]->SetGrade( p, hs.GetGrade() );
} }
+15 -15
View File
@@ -203,7 +203,7 @@ bool ProfileManager::LoadProfileFromMemoryCard( PlayerNumber pn )
UnloadProfile( pn ); UnloadProfile( pn );
// mount slot // mount slot
if( MEMCARDMAN->GetCardState(pn) != MEMORY_CARD_STATE_READY ) if( MEMCARDMAN->GetCardState(pn) != MemoryCardState_Ready )
return false; return false;
vector<CString> asDirsToTry; vector<CString> asDirsToTry;
@@ -521,8 +521,8 @@ void ProfileManager::LoadMachineProfile()
// If the machine name has changed, make sure we use the new name // If the machine name has changed, make sure we use the new name
m_pMachineProfile->m_sDisplayName = PREFSMAN->m_sMachineName; m_pMachineProfile->m_sDisplayName = PREFSMAN->m_sMachineName;
SONGMAN->FreeAllLoadedFromProfile( PROFILE_SLOT_MACHINE ); SONGMAN->FreeAllLoadedFromProfile( ProfileSlot_Machine );
SONGMAN->LoadAllFromProfileDir( MACHINE_PROFILE_DIR, PROFILE_SLOT_MACHINE ); SONGMAN->LoadAllFromProfileDir( MACHINE_PROFILE_DIR, ProfileSlot_Machine );
} }
bool ProfileManager::ProfileWasLoadedFromMemoryCard( PlayerNumber pn ) const bool ProfileManager::ProfileWasLoadedFromMemoryCard( PlayerNumber pn ) const
@@ -544,10 +544,10 @@ CString ProfileManager::GetProfileDir( ProfileSlot slot ) const
{ {
switch( slot ) switch( slot )
{ {
case PROFILE_SLOT_PLAYER_1: case ProfileSlot_Player1:
case PROFILE_SLOT_PLAYER_2: case ProfileSlot_Player2:
return m_sProfileDir[slot]; return m_sProfileDir[slot];
case PROFILE_SLOT_MACHINE: case ProfileSlot_Machine:
return MACHINE_PROFILE_DIR; return MACHINE_PROFILE_DIR;
default: default:
ASSERT(0); ASSERT(0);
@@ -558,10 +558,10 @@ CString ProfileManager::GetProfileDirImportedFrom( ProfileSlot slot ) const
{ {
switch( slot ) switch( slot )
{ {
case PROFILE_SLOT_PLAYER_1: case ProfileSlot_Player1:
case PROFILE_SLOT_PLAYER_2: case ProfileSlot_Player2:
return m_sProfileDirImportedFrom[slot]; return m_sProfileDirImportedFrom[slot];
case PROFILE_SLOT_MACHINE: case ProfileSlot_Machine:
return NULL; return NULL;
default: default:
ASSERT(0); ASSERT(0);
@@ -572,10 +572,10 @@ const Profile* ProfileManager::GetProfile( ProfileSlot slot ) const
{ {
switch( slot ) switch( slot )
{ {
case PROFILE_SLOT_PLAYER_1: case ProfileSlot_Player1:
case PROFILE_SLOT_PLAYER_2: case ProfileSlot_Player2:
return GetProfile( (PlayerNumber)slot ); return GetProfile( (PlayerNumber)slot );
case PROFILE_SLOT_MACHINE: case ProfileSlot_Machine:
return m_pMachineProfile; return m_pMachineProfile;
default: default:
ASSERT(0); ASSERT(0);
@@ -749,10 +749,10 @@ bool ProfileManager::IsPersistentProfile( ProfileSlot slot ) const
{ {
switch( slot ) switch( slot )
{ {
case PROFILE_SLOT_PLAYER_1: case ProfileSlot_Player1:
case PROFILE_SLOT_PLAYER_2: case ProfileSlot_Player2:
return GAMESTATE->IsHumanPlayer((PlayerNumber)slot) && !m_sProfileDir[slot].empty(); return GAMESTATE->IsHumanPlayer((PlayerNumber)slot) && !m_sProfileDir[slot].empty();
case PROFILE_SLOT_MACHINE: case ProfileSlot_Machine:
return true; return true;
default: default:
ASSERT(0); ASSERT(0);
+1 -1
View File
@@ -91,7 +91,7 @@ public:
// Song stats // Song stats
// //
int GetSongNumTimesPlayed( const Song* pSong, ProfileSlot card ) const; int GetSongNumTimesPlayed( const Song* pSong, ProfileSlot card ) const;
bool IsSongNew( const Song* pSong ) const { return GetSongNumTimesPlayed(pSong,PROFILE_SLOT_MACHINE)==0; } bool IsSongNew( const Song* pSong ) const { return GetSongNumTimesPlayed(pSong,ProfileSlot_Machine)==0; }
void AddStepsScore( const Song* pSong, const Steps* pSteps , PlayerNumber pn, const HighScore &hs, int &iPersonalIndexOut, int &iMachineIndexOut ); void AddStepsScore( const Song* pSong, const Steps* pSteps , PlayerNumber pn, const HighScore &hs, int &iPersonalIndexOut, int &iMachineIndexOut );
void IncrementStepsPlayCount( const Song* pSong, const Steps* pSteps, PlayerNumber pn ); void IncrementStepsPlayCount( const Song* pSong, const Steps* pSteps, PlayerNumber pn );
void GetHighScoreForDifficulty( const Song *s, const Style *st, ProfileSlot slot, Difficulty dc, HighScore &hsOut ) const; void GetHighScoreForDifficulty( const Song *s, const Style *st, ProfileSlot slot, Difficulty dc, HighScore &hsOut ) const;
+9 -9
View File
@@ -212,14 +212,14 @@ void ScreenEditMenu::MenuStart( PlayerNumber pn )
// //
switch( action ) switch( action )
{ {
case EDIT_MENU_ACTION_EDIT: case EditMenuAction_Edit:
case EDIT_MENU_ACTION_PRACTICE: case EditMenuAction_Practice:
break; break;
case EDIT_MENU_ACTION_DELETE: case EditMenuAction_Delete:
ASSERT( pSteps ); ASSERT( pSteps );
ScreenPrompt::Prompt( SM_None, "These steps will be lost permanently.\n\nContinue with delete?", PROMPT_YES_NO, ANSWER_NO ); ScreenPrompt::Prompt( SM_None, "These steps will be lost permanently.\n\nContinue with delete?", PROMPT_YES_NO, ANSWER_NO );
break; break;
case EDIT_MENU_ACTION_CREATE: case EditMenuAction_Create:
ASSERT( !pSteps ); ASSERT( !pSteps );
{ {
// Yuck. Doing the memory allocation doesn't seem right since // Yuck. Doing the memory allocation doesn't seem right since
@@ -259,13 +259,13 @@ void ScreenEditMenu::MenuStart( PlayerNumber pn )
// //
switch( action ) switch( action )
{ {
case EDIT_MENU_ACTION_EDIT: case EditMenuAction_Edit:
case EDIT_MENU_ACTION_CREATE: case EditMenuAction_Create:
case EDIT_MENU_ACTION_PRACTICE: case EditMenuAction_Practice:
{ {
// Prepare prepare for ScreenEdit // Prepare prepare for ScreenEdit
ASSERT( pSteps ); ASSERT( pSteps );
bool bPromptToNameSteps = (action == EDIT_MENU_ACTION_CREATE && dc == DIFFICULTY_EDIT); bool bPromptToNameSteps = (action == EditMenuAction_Create && dc == DIFFICULTY_EDIT);
if( bPromptToNameSteps ) if( bPromptToNameSteps )
{ {
ScreenTextEntry::TextEntry( ScreenTextEntry::TextEntry(
@@ -285,7 +285,7 @@ void ScreenEditMenu::MenuStart( PlayerNumber pn )
} }
} }
break; break;
case EDIT_MENU_ACTION_DELETE: case EditMenuAction_Delete:
break; break;
default: default:
ASSERT(0); ASSERT(0);
+2 -2
View File
@@ -219,8 +219,8 @@ void ScreenEnding::Init()
m_sprRemoveMemoryCard[p].Load( THEME->GetPathG("ScreenEnding",ssprintf("remove card P%d",p+1)) ); m_sprRemoveMemoryCard[p].Load( THEME->GetPathG("ScreenEnding",ssprintf("remove card P%d",p+1)) );
switch( MEMCARDMAN->GetCardState(p) ) switch( MEMCARDMAN->GetCardState(p) )
{ {
case MEMORY_CARD_STATE_REMOVED: case MemoryCardState_Removed:
case MEMORY_CARD_STATE_NO_CARD: case MemoryCardState_NoCard:
m_sprRemoveMemoryCard[p].SetHidden( true ); m_sprRemoveMemoryCard[p].SetHidden( true );
break; break;
} }
+2 -2
View File
@@ -263,7 +263,7 @@ void ScreenOptionsManageCourses::HandleScreenMessage( const ScreenMessage SM )
// create // create
Course *pCourse = new Course; Course *pCourse = new Course;
pCourse->m_sMainTitle = ScreenTextEntry::s_sLastAnswer; pCourse->m_sMainTitle = ScreenTextEntry::s_sLastAnswer;
pCourse->SetLoadedFromProfile( PROFILE_SLOT_MACHINE ); pCourse->SetLoadedFromProfile( ProfileSlot_Machine );
CourseEntry ce; CourseEntry ce;
CourseUtil::MakeDefaultEditCourseEntry( ce ); CourseUtil::MakeDefaultEditCourseEntry( ce );
pCourse->m_vEntries.push_back( ce ); pCourse->m_vEntries.push_back( ce );
@@ -349,7 +349,7 @@ void ScreenOptionsManageCourses::ProcessMenuStart( const InputEventPlus &input )
if( iCurRow == 0 ) // "create new" if( iCurRow == 0 ) // "create new"
{ {
if( SONGMAN->GetNumEditCourses(PROFILE_SLOT_MACHINE) >= MAX_EDIT_COURSES_PER_PROFILE ) if( SONGMAN->GetNumEditCourses(ProfileSlot_Machine) >= MAX_EDIT_COURSES_PER_PROFILE )
{ {
CString s = ssprintf( CString s = ssprintf(
"You have %d course edits, the maximum number allowed.\n\n" "You have %d course edits, the maximum number allowed.\n\n"
+16 -4
View File
@@ -43,7 +43,7 @@ static bool ValidateEditStepsName( const CString &sAnswer, CString &sErrorOut )
// Steps name must be unique // Steps name must be unique
vector<Steps*> v; vector<Steps*> v;
SONGMAN->GetStepsLoadedFromProfile( v, PROFILE_SLOT_MACHINE ); SONGMAN->GetStepsLoadedFromProfile( v, ProfileSlot_Machine );
FOREACH_CONST( Steps*, v, s ) FOREACH_CONST( Steps*, v, s )
{ {
if( GAMESTATE->m_pCurSteps[PLAYER_1].Get() == *s ) if( GAMESTATE->m_pCurSteps[PLAYER_1].Get() == *s )
@@ -90,7 +90,7 @@ void ScreenOptionsManageEditSteps::BeginScreen()
iIndex++; iIndex++;
} }
SONGMAN->GetStepsLoadedFromProfile( m_vpSteps, PROFILE_SLOT_MACHINE ); SONGMAN->GetStepsLoadedFromProfile( m_vpSteps, ProfileSlot_Machine );
FOREACH_CONST( Steps*, m_vpSteps, s ) FOREACH_CONST( Steps*, m_vpSteps, s )
{ {
@@ -138,11 +138,22 @@ void ScreenOptionsManageEditSteps::HandleScreenMessage( const ScreenMessage SM )
else if( SM == SM_GoToNextScreen ) else if( SM == SM_GoToNextScreen )
{ {
int iCurRow = m_iCurrentRow[PLAYER_1]; int iCurRow = m_iCurrentRow[PLAYER_1];
if( iCurRow == (int)m_pRows.size() - 1 )
if( iCurRow == 0 ) // "create new"
{
SCREENMAN->SetNewScreen( "ScreenEditMenuNew" );
return; // don't call base
}
else if( iCurRow == (int)m_pRows.size()-1 ) // "done"
{ {
this->HandleScreenMessage( SM_GoToPrevScreen ); this->HandleScreenMessage( SM_GoToPrevScreen );
return; // don't call base return; // don't call base
} }
else // a Steps
{
SCREENMAN->SetNewScreen( "ScreenEdit" );
return; // don't call base
}
} }
else if( SM == SM_BackFromRename ) else if( SM == SM_BackFromRename )
{ {
@@ -219,7 +230,7 @@ void ScreenOptionsManageEditSteps::ProcessMenuStart( const InputEventPlus &input
if( iCurRow == 0 ) // "create new" if( iCurRow == 0 ) // "create new"
{ {
vector<Steps*> v; vector<Steps*> v;
SONGMAN->GetStepsLoadedFromProfile( v, PROFILE_SLOT_MACHINE ); SONGMAN->GetStepsLoadedFromProfile( v, ProfileSlot_Machine );
if( v.size() >= MAX_EDIT_STEPS_PER_PROFILE ) if( v.size() >= MAX_EDIT_STEPS_PER_PROFILE )
{ {
CString s = ssprintf( CString s = ssprintf(
@@ -229,6 +240,7 @@ void ScreenOptionsManageEditSteps::ProcessMenuStart( const InputEventPlus &input
ScreenPrompt::Prompt( SM_None, s ); ScreenPrompt::Prompt( SM_None, s );
return; return;
} }
this->BeginFadingOut();
} }
else if( iCurRow == (int)m_pRows.size()-1 ) // "done" else if( iCurRow == (int)m_pRows.size()-1 ) // "done"
{ {
+2 -2
View File
@@ -1530,7 +1530,7 @@ void ScreenSelectMusic::AfterMusicChange()
g_sCDTitlePath = pSong->GetCDTitlePath(); g_sCDTitlePath = pSong->GetCDTitlePath();
g_bWantFallbackCdTitle = true; g_bWantFallbackCdTitle = true;
const vector<Song*> best = SONGMAN->GetBestSongs( PROFILE_SLOT_MACHINE ); const vector<Song*> best = SONGMAN->GetBestSongs( ProfileSlot_Machine );
const int index = FindIndex( best.begin(), best.end(), pSong ); const int index = FindIndex( best.begin(), best.end(), pSong );
if( index != -1 ) if( index != -1 )
m_MachineRank.SetText( FormatNumberAndSuffix( index+1 ) ); m_MachineRank.SetText( FormatNumberAndSuffix( index+1 ) );
@@ -1663,7 +1663,7 @@ void ScreenSelectMusic::AfterMusicChange()
} }
CourseType ct = PlayModeToCourseType( GAMESTATE->m_PlayMode ); CourseType ct = PlayModeToCourseType( GAMESTATE->m_PlayMode );
const vector<Course*> best = SONGMAN->GetBestCourses( ct, PROFILE_SLOT_MACHINE ); const vector<Course*> best = SONGMAN->GetBestCourses( ct, ProfileSlot_Machine );
const int index = FindCourseIndexOfSameMode( best.begin(), best.end(), pCourse ); const int index = FindCourseIndexOfSameMode( best.begin(), best.end(), pCourse );
if( index != -1 ) if( index != -1 )
m_MachineRank.SetText( FormatNumberAndSuffix( index+1 ) ); m_MachineRank.SetText( FormatNumberAndSuffix( index+1 ) );
+11 -11
View File
@@ -38,8 +38,8 @@ static CString ClearMachineEdits()
int iNumSuccessful = 0; int iNumSuccessful = 0;
vector<CString> vsEditFiles; vector<CString> vsEditFiles;
GetDirListing( PROFILEMAN->GetProfileDir(PROFILE_SLOT_MACHINE)+EDIT_STEPS_SUBDIR+"*.edit", vsEditFiles, false, true ); GetDirListing( PROFILEMAN->GetProfileDir(ProfileSlot_Machine)+EDIT_STEPS_SUBDIR+"*.edit", vsEditFiles, false, true );
GetDirListing( PROFILEMAN->GetProfileDir(PROFILE_SLOT_MACHINE)+EDIT_COURSES_SUBDIR+"*.crs", vsEditFiles, false, true ); GetDirListing( PROFILEMAN->GetProfileDir(ProfileSlot_Machine)+EDIT_COURSES_SUBDIR+"*.crs", vsEditFiles, false, true );
FOREACH_CONST( CString, vsEditFiles, i ) FOREACH_CONST( CString, vsEditFiles, i )
{ {
iNumAttempted++; iNumAttempted++;
@@ -63,7 +63,7 @@ static CString ClearMemoryCardEdits()
bool bTriedToLoad = false; bool bTriedToLoad = false;
FOREACH_PlayerNumber( pn ) FOREACH_PlayerNumber( pn )
{ {
if( MEMCARDMAN->GetCardState(pn) != MEMORY_CARD_STATE_READY ) if( MEMCARDMAN->GetCardState(pn) != MemoryCardState_Ready )
continue; // skip continue; // skip
if( !MEMCARDMAN->IsMounted(pn) ) if( !MEMCARDMAN->IsMounted(pn) )
@@ -181,7 +181,7 @@ static CString TransferStatsMachineToMemoryCard()
bool bTriedToSave = false; bool bTriedToSave = false;
FOREACH_PlayerNumber( pn ) FOREACH_PlayerNumber( pn )
{ {
if( MEMCARDMAN->GetCardState(pn) != MEMORY_CARD_STATE_READY ) if( MEMCARDMAN->GetCardState(pn) != MemoryCardState_Ready )
continue; // skip continue; // skip
if( !MEMCARDMAN->IsMounted(pn) ) if( !MEMCARDMAN->IsMounted(pn) )
@@ -216,7 +216,7 @@ static CString TransferStatsMemoryCardToMachine()
bool bTriedToLoad = false; bool bTriedToLoad = false;
FOREACH_PlayerNumber( pn ) FOREACH_PlayerNumber( pn )
{ {
if( MEMCARDMAN->GetCardState(pn) != MEMORY_CARD_STATE_READY ) if( MEMCARDMAN->GetCardState(pn) != MemoryCardState_Ready )
continue; // skip continue; // skip
if( !MEMCARDMAN->IsMounted(pn) ) if( !MEMCARDMAN->IsMounted(pn) )
@@ -264,7 +264,7 @@ static CString CopyEditsMachineToMemoryCard()
bool bTriedToCopy = false; bool bTriedToCopy = false;
FOREACH_PlayerNumber( pn ) FOREACH_PlayerNumber( pn )
{ {
if( MEMCARDMAN->GetCardState(pn) != MEMORY_CARD_STATE_READY ) if( MEMCARDMAN->GetCardState(pn) != MemoryCardState_Ready )
continue; // skip continue; // skip
if( !MEMCARDMAN->IsMounted(pn) ) if( !MEMCARDMAN->IsMounted(pn) )
@@ -277,7 +277,7 @@ static CString CopyEditsMachineToMemoryCard()
int iNumOverwritten = 0; int iNumOverwritten = 0;
{ {
CString sFromDir = PROFILEMAN->GetProfileDir(PROFILE_SLOT_MACHINE) + EDIT_STEPS_SUBDIR; CString sFromDir = PROFILEMAN->GetProfileDir(ProfileSlot_Machine) + EDIT_STEPS_SUBDIR;
CString sToDir = MEM_CARD_MOUNT_POINT[pn] + (CString)PREFSMAN->m_sMemoryCardProfileSubdir + "/" + EDIT_STEPS_SUBDIR; CString sToDir = MEM_CARD_MOUNT_POINT[pn] + (CString)PREFSMAN->m_sMemoryCardProfileSubdir + "/" + EDIT_STEPS_SUBDIR;
vector<CString> vsFiles; vector<CString> vsFiles;
@@ -294,7 +294,7 @@ static CString CopyEditsMachineToMemoryCard()
} }
{ {
CString sFromDir = PROFILEMAN->GetProfileDir(PROFILE_SLOT_MACHINE) + EDIT_COURSES_SUBDIR; CString sFromDir = PROFILEMAN->GetProfileDir(ProfileSlot_Machine) + EDIT_COURSES_SUBDIR;
CString sToDir = MEM_CARD_MOUNT_POINT[pn] + (CString)PREFSMAN->m_sMemoryCardProfileSubdir + "/" + EDIT_COURSES_SUBDIR; CString sToDir = MEM_CARD_MOUNT_POINT[pn] + (CString)PREFSMAN->m_sMemoryCardProfileSubdir + "/" + EDIT_COURSES_SUBDIR;
vector<CString> vsFiles; vector<CString> vsFiles;
@@ -329,7 +329,7 @@ static CString CopyEditsMemoryCardToMachine()
bool bTriedToCopy = false; bool bTriedToCopy = false;
FOREACH_PlayerNumber( pn ) FOREACH_PlayerNumber( pn )
{ {
if( MEMCARDMAN->GetCardState(pn) != MEMORY_CARD_STATE_READY ) if( MEMCARDMAN->GetCardState(pn) != MemoryCardState_Ready )
continue; // skip continue; // skip
if( !MEMCARDMAN->IsMounted(pn) ) if( !MEMCARDMAN->IsMounted(pn) )
@@ -343,7 +343,7 @@ static CString CopyEditsMemoryCardToMachine()
{ {
CString sFromDir = MEM_CARD_MOUNT_POINT[pn] + (CString)PREFSMAN->m_sMemoryCardProfileSubdir + "/" + EDIT_STEPS_SUBDIR; CString sFromDir = MEM_CARD_MOUNT_POINT[pn] + (CString)PREFSMAN->m_sMemoryCardProfileSubdir + "/" + EDIT_STEPS_SUBDIR;
CString sToDir = PROFILEMAN->GetProfileDir(PROFILE_SLOT_MACHINE) + EDIT_STEPS_SUBDIR; CString sToDir = PROFILEMAN->GetProfileDir(ProfileSlot_Machine) + EDIT_STEPS_SUBDIR;
vector<CString> vsFiles; vector<CString> vsFiles;
GetDirListing( sFromDir+"*.edit", vsFiles, false, false ); GetDirListing( sFromDir+"*.edit", vsFiles, false, false );
@@ -360,7 +360,7 @@ static CString CopyEditsMemoryCardToMachine()
{ {
CString sFromDir = MEM_CARD_MOUNT_POINT[pn] + (CString)PREFSMAN->m_sMemoryCardProfileSubdir + "/" + EDIT_COURSES_SUBDIR; CString sFromDir = MEM_CARD_MOUNT_POINT[pn] + (CString)PREFSMAN->m_sMemoryCardProfileSubdir + "/" + EDIT_COURSES_SUBDIR;
CString sToDir = PROFILEMAN->GetProfileDir(PROFILE_SLOT_MACHINE) + EDIT_COURSES_SUBDIR; CString sToDir = PROFILEMAN->GetProfileDir(ProfileSlot_Machine) + EDIT_COURSES_SUBDIR;
vector<CString> vsFiles; vector<CString> vsFiles;
GetDirListing( sFromDir+"*.crs", vsFiles, false, false ); GetDirListing( sFromDir+"*.crs", vsFiles, false, false );
+6 -6
View File
@@ -107,7 +107,7 @@ CString ScreenSystemLayer::GetCreditsMessage( PlayerNumber pn ) const
const Profile* pProfile = PROFILEMAN->GetProfile( pn ); const Profile* pProfile = PROFILEMAN->GetProfile( pn );
switch( mcs ) switch( mcs )
{ {
case MEMORY_CARD_STATE_NO_CARD: case MemoryCardState_NoCard:
// this is a local machine profile // this is a local machine profile
if( PROFILEMAN->LastLoadWasFromLastGood(pn) ) if( PROFILEMAN->LastLoadWasFromLastGood(pn) )
return pProfile->GetDisplayNameOrHighScoreName() + CREDITS_LOADED_FROM_LAST_GOOD_APPEND.GetValue(); return pProfile->GetDisplayNameOrHighScoreName() + CREDITS_LOADED_FROM_LAST_GOOD_APPEND.GetValue();
@@ -121,11 +121,11 @@ CString ScreenSystemLayer::GetCreditsMessage( PlayerNumber pn ) const
else else
return CString(); return CString();
case MEMORY_CARD_STATE_ERROR: return THEME->GetMetric( m_sName, "CreditsCard" + MEMCARDMAN->GetCardError(pn) ); case MemoryCardState_Error: return THEME->GetMetric( m_sName, "CreditsCard" + MEMCARDMAN->GetCardError(pn) );
case MEMORY_CARD_STATE_TOO_LATE: return CREDITS_CARD_TOO_LATE.GetValue(); case MemoryCardState_TooLate: return CREDITS_CARD_TOO_LATE.GetValue();
case MEMORY_CARD_STATE_CHECKING: return CREDITS_CARD_CHECKING.GetValue(); case MemoryCardState_Checking: return CREDITS_CARD_CHECKING.GetValue();
case MEMORY_CARD_STATE_REMOVED: return CREDITS_CARD_REMOVED.GetValue(); case MemoryCardState_Removed: return CREDITS_CARD_REMOVED.GetValue();
case MEMORY_CARD_STATE_READY: case MemoryCardState_Ready:
{ {
// If the profile failed to load and there was no usable backup... // If the profile failed to load and there was no usable backup...
if( PROFILEMAN->LastLoadWasTamperedOrCorrupt(pn) && !PROFILEMAN->LastLoadWasFromLastGood(pn) ) if( PROFILEMAN->LastLoadWasTamperedOrCorrupt(pn) && !PROFILEMAN->LastLoadWasFromLastGood(pn) )
+2 -2
View File
@@ -53,7 +53,7 @@ Song::Song()
m_ForegroundChanges = AutoPtrCopyOnWrite<VBackgroundChange>(new VBackgroundChange); m_ForegroundChanges = AutoPtrCopyOnWrite<VBackgroundChange>(new VBackgroundChange);
m_LoadedFromProfile = PROFILE_SLOT_INVALID; m_LoadedFromProfile = ProfileSlot_INVALID;
m_fMusicSampleStartSeconds = -1; m_fMusicSampleStartSeconds = -1;
m_fMusicSampleLengthSeconds = DEFAULT_MUSIC_SAMPLE_LENGTH; m_fMusicSampleLengthSeconds = DEFAULT_MUSIC_SAMPLE_LENGTH;
m_fMusicLengthSeconds = 0; m_fMusicLengthSeconds = 0;
@@ -1414,7 +1414,7 @@ void Song::FreeAllLoadedFromProfile( ProfileSlot slot )
Steps* pSteps = m_vpSteps[s]; Steps* pSteps = m_vpSteps[s];
if( !pSteps->WasLoadedFromProfile() ) if( !pSteps->WasLoadedFromProfile() )
continue; continue;
if( slot == PROFILE_SLOT_INVALID || pSteps->GetLoadedFromProfileSlot() == slot ) if( slot == ProfileSlot_INVALID || pSteps->GetLoadedFromProfileSlot() == slot )
apToRemove.push_back( pSteps ); apToRemove.push_back( pSteps );
} }
+5 -5
View File
@@ -303,7 +303,7 @@ void SongManager::FreeSongs()
m_sSongGroupBannerPaths.clear(); m_sSongGroupBannerPaths.clear();
for( int i = 0; i < NUM_PROFILE_SLOTS; ++i ) for( int i = 0; i < NUM_ProfileSlot; ++i )
m_pBestSongs[i].clear(); m_pBestSongs[i].clear();
m_pShuffledSongs.clear(); m_pShuffledSongs.clear();
} }
@@ -644,7 +644,7 @@ void SongManager::FreeCourses()
delete m_pCourses[i]; delete m_pCourses[i];
m_pCourses.clear(); m_pCourses.clear();
for( int i = 0; i < NUM_PROFILE_SLOTS; ++i ) for( int i = 0; i < NUM_ProfileSlot; ++i )
FOREACH_CourseType( ct ) FOREACH_CourseType( ct )
m_pBestCourses[i][ct].clear(); m_pBestCourses[i][ct].clear();
m_pShuffledCourses.clear(); m_pShuffledCourses.clear();
@@ -1371,10 +1371,10 @@ void SongManager::FreeAllLoadedFromProfile( ProfileSlot slot )
FOREACH( Course*, m_pCourses, c ) FOREACH( Course*, m_pCourses, c )
{ {
Course *pCourse = *c; Course *pCourse = *c;
if( pCourse->GetLoadedFromProfileSlot() == PROFILE_SLOT_INVALID ) if( pCourse->GetLoadedFromProfileSlot() == ProfileSlot_INVALID )
continue; continue;
if( slot == PROFILE_SLOT_INVALID || pCourse->GetLoadedFromProfileSlot() == slot ) if( slot == ProfileSlot_INVALID || pCourse->GetLoadedFromProfileSlot() == slot )
apToDelete.push_back( *c ); apToDelete.push_back( *c );
} }
@@ -1395,7 +1395,7 @@ int SongManager::GetNumStepsLoadedFromProfile()
FOREACH( Steps*, vpAllSteps, ss ) FOREACH( Steps*, vpAllSteps, ss )
{ {
if( (*ss)->GetLoadedFromProfileSlot() != PROFILE_SLOT_INVALID ) if( (*ss)->GetLoadedFromProfileSlot() != ProfileSlot_INVALID )
iCount++; iCount++;
} }
} }
+6 -6
View File
@@ -41,7 +41,7 @@ public:
void LoadAllFromProfileDir( const CString &sProfileDir, ProfileSlot slot ); void LoadAllFromProfileDir( const CString &sProfileDir, ProfileSlot slot );
int GetNumStepsLoadedFromProfile(); int GetNumStepsLoadedFromProfile();
void FreeAllLoadedFromProfile( ProfileSlot slot = PROFILE_SLOT_INVALID ); void FreeAllLoadedFromProfile( ProfileSlot slot = ProfileSlot_INVALID );
void LoadGroupSymLinks( CString sDir, CString sGroupFolder ); void LoadGroupSymLinks( CString sDir, CString sGroupFolder );
@@ -74,9 +74,9 @@ public:
// Lookup // Lookup
const vector<Song*> &GetAllSongs() const { return m_pSongs; } const vector<Song*> &GetAllSongs() const { return m_pSongs; }
void GetBestSongs( vector<Song*> &AddTo, CString sGroupName, int iMaxStages = INT_MAX, ProfileSlot slot=PROFILE_SLOT_MACHINE ) const; void GetBestSongs( vector<Song*> &AddTo, CString sGroupName, int iMaxStages = INT_MAX, ProfileSlot slot=ProfileSlot_Machine ) const;
const vector<Song*> &GetBestSongs( ProfileSlot slot=PROFILE_SLOT_MACHINE ) const { return m_pBestSongs[slot]; } const vector<Song*> &GetBestSongs( ProfileSlot slot=ProfileSlot_Machine ) const { return m_pBestSongs[slot]; }
const vector<Course*> &GetBestCourses( CourseType ct, ProfileSlot slot=PROFILE_SLOT_MACHINE ) const { return m_pBestCourses[slot][ct]; } const vector<Course*> &GetBestCourses( CourseType ct, ProfileSlot slot=ProfileSlot_Machine ) const { return m_pBestCourses[slot][ct]; }
void GetSongs( vector<Song*> &AddTo, CString sGroupName, int iMaxStages = INT_MAX ) const; void GetSongs( vector<Song*> &AddTo, CString sGroupName, int iMaxStages = INT_MAX ) const;
void GetSongs( vector<Song*> &AddTo, int iMaxStages ) const { GetSongs(AddTo,GROUP_ALL,iMaxStages); } void GetSongs( vector<Song*> &AddTo, int iMaxStages ) const { GetSongs(AddTo,GROUP_ALL,iMaxStages); }
void GetSongs( vector<Song*> &AddTo ) const { GetSongs(AddTo,GROUP_ALL,INT_MAX); } void GetSongs( vector<Song*> &AddTo ) const { GetSongs(AddTo,GROUP_ALL,INT_MAX); }
@@ -127,13 +127,13 @@ protected:
Song *FindSong( CString sGroup, CString sSong ); Song *FindSong( CString sGroup, CString sSong );
vector<Song*> m_pSongs; // all songs that can be played vector<Song*> m_pSongs; // all songs that can be played
vector<Song*> m_pBestSongs[NUM_PROFILE_SLOTS]; vector<Song*> m_pBestSongs[NUM_ProfileSlot];
vector<Song*> m_pShuffledSongs; // used by GetRandomSong vector<Song*> m_pShuffledSongs; // used by GetRandomSong
CStringArray m_sSongGroupNames; CStringArray m_sSongGroupNames;
CStringArray m_sSongGroupBannerPaths; // each song group may have a banner associated with it CStringArray m_sSongGroupBannerPaths; // each song group may have a banner associated with it
vector<Course*> m_pCourses; vector<Course*> m_pCourses;
vector<Course*> m_pBestCourses[NUM_PROFILE_SLOTS][NUM_CourseType]; vector<Course*> m_pBestCourses[NUM_ProfileSlot][NUM_CourseType];
vector<Course*> m_pShuffledCourses; // used by GetRandomCourse vector<Course*> m_pShuffledCourses; // used by GetRandomCourse
struct CourseGroupInfo struct CourseGroupInfo
{ {
+1 -1
View File
@@ -29,7 +29,7 @@ Steps::Steps()
{ {
m_bSavedToDisk = false; m_bSavedToDisk = false;
m_StepsType = STEPS_TYPE_INVALID; m_StepsType = STEPS_TYPE_INVALID;
m_LoadedFromProfile = PROFILE_SLOT_INVALID; m_LoadedFromProfile = ProfileSlot_INVALID;
m_uHash = 0; m_uHash = 0;
m_Difficulty = DIFFICULTY_INVALID; m_Difficulty = DIFFICULTY_INVALID;
m_iMeter = 0; m_iMeter = 0;
+3 -3
View File
@@ -32,8 +32,8 @@ public:
// Use a special value of difficulty // Use a special value of difficulty
bool IsAnEdit() const { return m_Difficulty == DIFFICULTY_EDIT; } bool IsAnEdit() const { return m_Difficulty == DIFFICULTY_EDIT; }
bool IsAPlayerEdit() const { return m_Difficulty == DIFFICULTY_EDIT && GetLoadedFromProfileSlot() < PROFILE_SLOT_MACHINE; } bool IsAPlayerEdit() const { return m_Difficulty == DIFFICULTY_EDIT && GetLoadedFromProfileSlot() < ProfileSlot_Machine; }
bool WasLoadedFromProfile() const { return m_LoadedFromProfile != PROFILE_SLOT_INVALID; } bool WasLoadedFromProfile() const { return m_LoadedFromProfile != ProfileSlot_INVALID; }
ProfileSlot GetLoadedFromProfileSlot() const { return m_LoadedFromProfile; } ProfileSlot GetLoadedFromProfileSlot() const { return m_LoadedFromProfile; }
unsigned GetHash() const { return Real()->m_uHash; } unsigned GetHash() const { return Real()->m_uHash; }
CString GetDescription() const { return Real()->m_sDescription; } CString GetDescription() const { return Real()->m_sDescription; }
@@ -86,7 +86,7 @@ protected:
bool m_bSavedToDisk; // true if this was loaded from disk or has been saved to disk. bool m_bSavedToDisk; // true if this was loaded from disk or has been saved to disk.
/* These values are pulled from the autogen source first, if there is one. */ /* These values are pulled from the autogen source first, if there is one. */
ProfileSlot m_LoadedFromProfile; // PROFILE_SLOT_INVALID if wasn't loaded from a profile ProfileSlot m_LoadedFromProfile; // ProfileSlot_INVALID if wasn't loaded from a profile
unsigned m_uHash; // only used if m_Difficulty == DIFFICULTY_EDIT unsigned m_uHash; // only used if m_Difficulty == DIFFICULTY_EDIT
CString m_sDescription; // Step author, edit name, or something meaningful CString m_sDescription; // Step author, edit name, or something meaningful
Difficulty m_Difficulty; // difficulty classification Difficulty m_Difficulty; // difficulty classification
+4 -4
View File
@@ -19,7 +19,7 @@ struct lua_State;
struct BackgroundChange; struct BackgroundChange;
const int MAX_EDITS_PER_SONG_PER_PROFILE = 5; const int MAX_EDITS_PER_SONG_PER_PROFILE = 5;
const int MAX_EDITS_PER_SONG = 5*NUM_PROFILE_SLOTS; const int MAX_EDITS_PER_SONG = 5*NUM_ProfileSlot;
extern const int FILE_CACHE_VERSION; extern const int FILE_CACHE_VERSION;
@@ -88,7 +88,7 @@ public:
CString m_sGroupName; CString m_sGroupName;
ProfileSlot m_LoadedFromProfile; // PROFILE_SLOT_INVALID if wasn't loaded from a profile ProfileSlot m_LoadedFromProfile; // ProfileSlot_INVALID if wasn't loaded from a profile
bool m_bIsSymLink; bool m_bIsSymLink;
CString m_sMainTitle, m_sSubTitle, m_sArtist; CString m_sMainTitle, m_sSubTitle, m_sArtist;
@@ -222,8 +222,8 @@ public:
void AddSteps( Steps* pSteps ); // we are responsible for deleting the memory pointed to by pSteps! void AddSteps( Steps* pSteps ); // we are responsible for deleting the memory pointed to by pSteps!
void DeleteSteps( const Steps* pSteps ); void DeleteSteps( const Steps* pSteps );
void FreeAllLoadedFromProfile( ProfileSlot slot = PROFILE_SLOT_INVALID ); void FreeAllLoadedFromProfile( ProfileSlot slot = ProfileSlot_INVALID );
bool WasLoadedFromProfile() const { return m_LoadedFromProfile != PROFILE_SLOT_INVALID; } bool WasLoadedFromProfile() const { return m_LoadedFromProfile != ProfileSlot_INVALID; }
void GetStepsLoadedFromProfile( ProfileSlot slot, vector<Steps*> &vpStepsOut ) const; void GetStepsLoadedFromProfile( ProfileSlot slot, vector<Steps*> &vpStepsOut ) const;
int GetNumStepsLoadedFromProfile( ProfileSlot slot ) const; int GetNumStepsLoadedFromProfile( ProfileSlot slot ) const;
bool IsEditAlreadyLoaded( Steps* pSteps ) const; bool IsEditAlreadyLoaded( Steps* pSteps ) const;