diff --git a/stepmania/src/Profile.cpp b/stepmania/src/Profile.cpp index e1a70b3b2e..d604c8a0e7 100644 --- a/stepmania/src/Profile.cpp +++ b/stepmania/src/Profile.cpp @@ -1161,7 +1161,11 @@ void Profile::LoadGeneralDataFromNode( const XNode* pNode ) pNode->GetChildValue( "TotalGameplaySeconds", m_iTotalGameplaySeconds ); pNode->GetChildValue( "CurrentCombo", m_iCurrentCombo ); pNode->GetChildValue( "TotalCaloriesBurned", m_fTotalCaloriesBurned ); - pNode->GetChildValue( "GoalType", (int&)m_GoalType ); + { + int temp; + pNode->GetChildValue( "GoalType", temp ); + m_GoalType = GoalType( temp ); + } pNode->GetChildValue( "GoalCalories", m_iGoalCalories ); pNode->GetChildValue( "GoalSeconds", m_iGoalSeconds ); pNode->GetChildValue( "LastPlayedMachineGuid", m_sLastPlayedMachineGuid ); diff --git a/stepmania/src/ScreenPrompt.cpp b/stepmania/src/ScreenPrompt.cpp index 6d80f1ffe3..e7ebbd4734 100644 --- a/stepmania/src/ScreenPrompt.cpp +++ b/stepmania/src/ScreenPrompt.cpp @@ -78,7 +78,7 @@ void ScreenPrompt::BeginScreen() ScreenWithMenuElements::BeginScreen(); m_Answer = g_defaultAnswer; - CLAMP( (int&)m_Answer, 0, g_PromptType ); + ENUM_CLAMP( m_Answer, PromptAnswer(0), PromptAnswer(g_PromptType) ); m_textQuestion.SetText( g_sText ); SET_XY_AND_ON_COMMAND( m_textQuestion ); diff --git a/stepmania/src/ScreenSetTime.cpp b/stepmania/src/ScreenSetTime.cpp index d40fd446bd..6439c6b01b 100644 --- a/stepmania/src/ScreenSetTime.cpp +++ b/stepmania/src/ScreenSetTime.cpp @@ -148,7 +148,7 @@ void ScreenSetTime::ChangeSelection( int iDirection ) SetTimeSelection OldSelection = m_Selection; enum_add( m_Selection, iDirection ); - CLAMP( (int&)m_Selection, 0, NUM_SetTimeSelection-1 ); + ENUM_CLAMP( m_Selection, SetTimeSelection(0), SetTimeSelection(NUM_SetTimeSelection-1) ); if( iDirection != 0 && m_Selection == OldSelection ) return; // can't move any more diff --git a/stepmania/src/ScreenTextEntry.cpp b/stepmania/src/ScreenTextEntry.cpp index 731cc0d572..ca0ff50edf 100644 --- a/stepmania/src/ScreenTextEntry.cpp +++ b/stepmania/src/ScreenTextEntry.cpp @@ -406,7 +406,11 @@ void ScreenTextEntryVisual::MoveY( int iDir ) do { m_iFocusY = enum_add2( m_iFocusY, +iDir ); - wrap( (int&)m_iFocusY, NUM_KeyboardRow ); + { + int temp = m_iFocusY; + wrap( temp, NUM_KeyboardRow ); + m_iFocusY = KeyboardRow( temp ); + } // HACK: Round to nearest option so that we always stop // on KEYBOARD_ROW_SPECIAL.