From b9a189711e56980bf22128729fbc6d64a5b4c832 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 26 Sep 2006 20:41:53 +0000 Subject: [PATCH] cleanups --- stepmania/src/ScreenEdit.cpp | 4 ++-- stepmania/src/ScreenEdit.h | 4 ++-- stepmania/src/ScreenRanking.cpp | 2 +- stepmania/src/ScreenRanking.h | 5 +++-- stepmania/src/ScreenSetTime.cpp | 12 ++++++------ stepmania/src/ScreenSetTime.h | 7 ++++--- 6 files changed, 18 insertions(+), 16 deletions(-) diff --git a/stepmania/src/ScreenEdit.cpp b/stepmania/src/ScreenEdit.cpp index 0547b74340..d0cbbff3a0 100644 --- a/stepmania/src/ScreenEdit.cpp +++ b/stepmania/src/ScreenEdit.cpp @@ -83,7 +83,7 @@ static const char *EditStateNames[] = { "RecordPaused", "Playing" }; -XToString( EditState, NUM_EDIT_STATES ); +XToString( EditState, NUM_EditState ); #if defined(XBOX) void ScreenEdit::InitEditMappings() @@ -708,7 +708,7 @@ void ScreenEdit::Init() m_NoteFieldRecord.Load( &m_NoteDataRecord, -(int)SCREEN_HEIGHT/2, (int)SCREEN_HEIGHT/2 ); this->AddChild( &m_NoteFieldRecord ); - m_EditState = STATE_INVALID; + m_EditState = EditState_Invalid; TransitionEditState( STATE_EDITING ); m_bRemoveNoteButtonDown = false; diff --git a/stepmania/src/ScreenEdit.h b/stepmania/src/ScreenEdit.h index 2682ca0b63..cad0cb49ea 100644 --- a/stepmania/src/ScreenEdit.h +++ b/stepmania/src/ScreenEdit.h @@ -26,8 +26,8 @@ enum EditState STATE_RECORDING, STATE_RECORDING_PAUSED, STATE_PLAYING, - NUM_EDIT_STATES, - STATE_INVALID + NUM_EditState, + EditState_Invalid }; enum EditButton diff --git a/stepmania/src/ScreenRanking.cpp b/stepmania/src/ScreenRanking.cpp index c73096e2ac..2318185678 100644 --- a/stepmania/src/ScreenRanking.cpp +++ b/stepmania/src/ScreenRanking.cpp @@ -25,7 +25,7 @@ static const char *PageTypeNames[] = { "SurvivalCourses", "AllCourses", }; -XToString( PageType, NUM_PAGE_TYPES ); +XToString( PageType, NUM_PageType ); StringToX( PageType ); #define TYPE THEME->GetMetric(m_sName,"Type") diff --git a/stepmania/src/ScreenRanking.h b/stepmania/src/ScreenRanking.h index e62191580a..2c3ebd84b3 100644 --- a/stepmania/src/ScreenRanking.h +++ b/stepmania/src/ScreenRanking.h @@ -28,9 +28,10 @@ enum PageType PageType_OniCourses, PageType_SurvivalCourses, PageType_AllCourses, - NUM_PAGE_TYPES + NUM_PageType, + PageType_Invalid }; -#define FOREACH_PageType( pt ) FOREACH_ENUM( PageType, NUM_PAGE_TYPES, pt ) +#define FOREACH_PageType( pt ) FOREACH_ENUM( PageType, NUM_PageType, pt ) const RString& PageTypeToString( PageType pt ); PageType StringToPageType( const RString& s ); diff --git a/stepmania/src/ScreenSetTime.cpp b/stepmania/src/ScreenSetTime.cpp index 2b6893ea8d..5e9912f79e 100644 --- a/stepmania/src/ScreenSetTime.cpp +++ b/stepmania/src/ScreenSetTime.cpp @@ -19,15 +19,15 @@ static const char *SetTimeSelectionNames[] = { "Minute", "Second", }; -XToString( SetTimeSelection, NUM_SET_TIME_SELECTIONS ); -#define FOREACH_SetTimeSelection( s ) FOREACH_ENUM( SetTimeSelection, NUM_SET_TIME_SELECTIONS, s ) +XToString( SetTimeSelection, NUM_SetTimeSelection ); +#define FOREACH_SetTimeSelection( s ) FOREACH_ENUM( SetTimeSelection, NUM_SetTimeSelection, s ) -const float g_X[NUM_SET_TIME_SELECTIONS] = +const float g_X[NUM_SetTimeSelection] = { 320, 320, 320, 320, 320, 320 }; -const float g_Y[NUM_SET_TIME_SELECTIONS] = +const float g_Y[NUM_SetTimeSelection] = { 140, 180, 220, 260, 300, 340 }; @@ -148,7 +148,7 @@ void ScreenSetTime::ChangeSelection( int iDirection ) SetTimeSelection OldSelection = m_Selection; enum_add( m_Selection, iDirection ); - CLAMP( (int&)m_Selection, 0, NUM_SET_TIME_SELECTIONS-1 ); + CLAMP( (int&)m_Selection, 0, NUM_SetTimeSelection-1 ); if( iDirection != 0 && m_Selection == OldSelection ) return; // can't move any more @@ -189,7 +189,7 @@ void ScreenSetTime::MenuStart( const InputEventPlus &input ) if( bHoldingLeftAndRight ) ChangeSelection( -1 ); - else if( m_Selection == NUM_SET_TIME_SELECTIONS -1 ) // last row + else if( m_Selection == NUM_SetTimeSelection -1 ) // last row { /* Save the new time. */ time_t iNow = time(NULL); diff --git a/stepmania/src/ScreenSetTime.h b/stepmania/src/ScreenSetTime.h index f35ae3afdc..acefdfdd74 100644 --- a/stepmania/src/ScreenSetTime.h +++ b/stepmania/src/ScreenSetTime.h @@ -12,7 +12,8 @@ enum SetTimeSelection hour, minute, second, - NUM_SET_TIME_SELECTIONS + NUM_SetTimeSelection, + SetTimeSelection_Invalid }; class ScreenSetTime : public ScreenWithMenuElements @@ -37,8 +38,8 @@ private: void ChangeSelection( int iDirection ); void ChangeValue( int iDirection ); - BitmapText m_textTitle[NUM_SET_TIME_SELECTIONS]; - BitmapText m_textValue[NUM_SET_TIME_SELECTIONS]; + BitmapText m_textTitle[NUM_SetTimeSelection]; + BitmapText m_textValue[NUM_SetTimeSelection]; BitmapText m_textDayOfWeek; };