From e531249704e17e6a9f25905f80c468f7f9798c75 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 26 Sep 2006 20:49:10 +0000 Subject: [PATCH] naming cleanups --- stepmania/src/CodeDetector.cpp | 4 ++-- stepmania/src/CodeDetector.h | 4 ++-- stepmania/src/GameConstantsAndTypes.cpp | 2 +- stepmania/src/GameConstantsAndTypes.h | 6 +++--- stepmania/src/OptionRowHandler.cpp | 8 ++++---- stepmania/src/OptionRowHandler.h | 8 ++++---- stepmania/src/PlayerStageStats.cpp | 2 +- stepmania/src/Profile.cpp | 2 +- stepmania/src/Profile.h | 2 +- stepmania/src/ScreenRanking.cpp | 2 +- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/stepmania/src/CodeDetector.cpp b/stepmania/src/CodeDetector.cpp index 6fe74434cc..762c82f3b5 100644 --- a/stepmania/src/CodeDetector.cpp +++ b/stepmania/src/CodeDetector.cpp @@ -53,9 +53,9 @@ const char *CodeNames[] = { "CancelAllPlayerOptions", "BackInEventMode", }; -XToString( Code, NUM_CODES ); +XToString( Code, NUM_Code ); -static CodeItem g_CodeItems[NUM_CODES]; +static CodeItem g_CodeItems[NUM_Code]; bool CodeItem::EnteredCode( GameController controller ) const diff --git a/stepmania/src/CodeDetector.h b/stepmania/src/CodeDetector.h index ffbe27a01a..61a5ac679a 100644 --- a/stepmania/src/CodeDetector.h +++ b/stepmania/src/CodeDetector.h @@ -45,9 +45,9 @@ enum Code { CODE_SAVE_SCREENSHOT2, CODE_CANCEL_ALL_PLAYER_OPTIONS, CODE_BACK_IN_EVENT_MODE, - NUM_CODES // leave this at the end + NUM_Code // leave this at the end }; -#define FOREACH_Code( c ) FOREACH_ENUM( Code, NUM_CODES, c ) +#define FOREACH_Code( c ) FOREACH_ENUM( Code, NUM_Code, c ) struct CodeItem { diff --git a/stepmania/src/GameConstantsAndTypes.cpp b/stepmania/src/GameConstantsAndTypes.cpp index 12f0347d1e..ee9820d7df 100644 --- a/stepmania/src/GameConstantsAndTypes.cpp +++ b/stepmania/src/GameConstantsAndTypes.cpp @@ -77,7 +77,7 @@ static const char *RankingCategoryNames[] = { "c", "d", }; -XToString( RankingCategory, NUM_RANKING_CATEGORIES ); +XToString( RankingCategory, NUM_RankingCategory ); StringToX( RankingCategory ); diff --git a/stepmania/src/GameConstantsAndTypes.h b/stepmania/src/GameConstantsAndTypes.h index a82e451a1b..a4e7614f5c 100644 --- a/stepmania/src/GameConstantsAndTypes.h +++ b/stepmania/src/GameConstantsAndTypes.h @@ -236,10 +236,10 @@ enum RankingCategory RANKING_B, // 4-6 meter per song avg. RANKING_C, // 7-9 meter per song avg. RANKING_D, // 10+ meter per song avg. // doesn't count extra stage! - NUM_RANKING_CATEGORIES, - RANKING_INVALID + NUM_RankingCategory, + RankingCategory_Invalid }; -#define FOREACH_RankingCategory( rc ) FOREACH_ENUM( RankingCategory, NUM_RANKING_CATEGORIES, rc ) +#define FOREACH_RankingCategory( rc ) FOREACH_ENUM( RankingCategory, NUM_RankingCategory, rc ) const RString& RankingCategoryToString( RankingCategory rc ); RankingCategory StringToRankingCategory( const RString& rc ); diff --git a/stepmania/src/OptionRowHandler.cpp b/stepmania/src/OptionRowHandler.cpp index a41149dd56..a71c95a719 100644 --- a/stepmania/src/OptionRowHandler.cpp +++ b/stepmania/src/OptionRowHandler.cpp @@ -33,14 +33,14 @@ static const char *SelectTypeNames[] = { "SelectMultiple", "SelectNone", }; -XToString( SelectType, NUM_SELECT_TYPES ); +XToString( SelectType, NUM_SelectType ); StringToX( SelectType ); static const char *LayoutTypeNames[] = { "ShowAllInRow", "ShowOneInRow", }; -XToString( LayoutType, NUM_LAYOUT_TYPES ); +XToString( LayoutType, NUM_LayoutType ); StringToX( LayoutType ); RString OptionRowHandler::OptionTitle() const @@ -820,7 +820,7 @@ public: if( pStr == NULL ) RageException::Throw( "\"%s\" \"LayoutType\" entry is not a string.", sLuaFunction.c_str() ); m_Def.m_layoutType = StringToLayoutType( pStr ); - ASSERT( m_Def.m_layoutType != LAYOUT_INVALID ); + ASSERT( m_Def.m_layoutType != LayoutType_Invalid ); lua_pop( L, 1 ); @@ -830,7 +830,7 @@ public: if( pStr == NULL ) RageException::Throw( "\"%s\" \"SelectType\" entry is not a string.", sLuaFunction.c_str() ); m_Def.m_selectType = StringToSelectType( pStr ); - ASSERT( m_Def.m_selectType != SELECT_INVALID ); + ASSERT( m_Def.m_selectType != SelectType_Invalid ); lua_pop( L, 1 ); diff --git a/stepmania/src/OptionRowHandler.h b/stepmania/src/OptionRowHandler.h index 959a32c0cb..9f08830a36 100644 --- a/stepmania/src/OptionRowHandler.h +++ b/stepmania/src/OptionRowHandler.h @@ -16,8 +16,8 @@ enum SelectType SELECT_ONE, SELECT_MULTIPLE, SELECT_NONE, - NUM_SELECT_TYPES, - SELECT_INVALID + NUM_SelectType, + SelectType_Invalid }; const RString& SelectTypeToString( SelectType pm ); SelectType StringToSelectType( const RString& s ); @@ -26,8 +26,8 @@ enum LayoutType { LAYOUT_SHOW_ALL_IN_ROW, LAYOUT_SHOW_ONE_IN_ROW, - NUM_LAYOUT_TYPES, - LAYOUT_INVALID + NUM_LayoutType, + LayoutType_Invalid }; const RString& LayoutTypeToString( LayoutType pm ); LayoutType StringToLayoutType( const RString& s ); diff --git a/stepmania/src/PlayerStageStats.cpp b/stepmania/src/PlayerStageStats.cpp index 488920b8dc..64642d4516 100644 --- a/stepmania/src/PlayerStageStats.cpp +++ b/stepmania/src/PlayerStageStats.cpp @@ -47,7 +47,7 @@ void PlayerStageStats::Init() m_pcaToShow = PEAK_COMBO_AWARD_INVALID; m_iPersonalHighScoreIndex = -1; m_iMachineHighScoreIndex = -1; - m_rc = RANKING_INVALID; + m_rc = RankingCategory_Invalid; m_HighScore = HighScore(); } diff --git a/stepmania/src/Profile.cpp b/stepmania/src/Profile.cpp index 4bb1aee379..755b3c8d6b 100644 --- a/stepmania/src/Profile.cpp +++ b/stepmania/src/Profile.cpp @@ -1536,7 +1536,7 @@ void Profile::LoadCategoryScoresFromNode( const XNode* pCategoryScores ) if( !pRadarCategory->GetAttrValue( "Type", str ) ) WARN_AND_CONTINUE; RankingCategory rc = StringToRankingCategory( str ); - if( rc == RANKING_INVALID ) + if( rc == RankingCategory_Invalid ) WARN_AND_CONTINUE_M( str ); const XNode *pHighScoreListNode = pRadarCategory->GetChild("HighScoreList"); diff --git a/stepmania/src/Profile.h b/stepmania/src/Profile.h index c10fb528e2..5fb5be9e40 100644 --- a/stepmania/src/Profile.h +++ b/stepmania/src/Profile.h @@ -199,7 +199,7 @@ public: // // Category high scores // - HighScoreList m_CategoryHighScores[NUM_StepsType][NUM_RANKING_CATEGORIES]; + HighScoreList m_CategoryHighScores[NUM_StepsType][NUM_RankingCategory]; void AddCategoryHighScore( StepsType st, RankingCategory rc, HighScore hs, int &iIndexOut ); HighScoreList& GetCategoryHighScoreList( StepsType st, RankingCategory rc ); diff --git a/stepmania/src/ScreenRanking.cpp b/stepmania/src/ScreenRanking.cpp index 2318185678..0c920a4e2f 100644 --- a/stepmania/src/ScreenRanking.cpp +++ b/stepmania/src/ScreenRanking.cpp @@ -543,7 +543,7 @@ void ScreenRankingLines::Init() for( unsigned i=0; i