diff --git a/stepmania/src/LightsManager.cpp b/stepmania/src/LightsManager.cpp index f01c46deec..53c083cd88 100644 --- a/stepmania/src/LightsManager.cpp +++ b/stepmania/src/LightsManager.cpp @@ -426,11 +426,7 @@ void LightsManager::ChangeTestCabinetLight( int iDir ) m_iControllerTestManualCycleCurrent = -1; m_clTestManualCycleCurrent = (CabinetLight)(m_clTestManualCycleCurrent+iDir); - { - int temp = m_clTestManualCycleCurrent; - wrap( temp, NUM_CabinetLight ); - m_clTestManualCycleCurrent = CabinetLight( temp ); - } + wrap( UnionCast(m_clTestManualCycleCurrent), NUM_CabinetLight ); } void LightsManager::ChangeTestGameButtonLight( int iDir ) diff --git a/stepmania/src/Profile.cpp b/stepmania/src/Profile.cpp index d604c8a0e7..8c07fd242f 100644 --- a/stepmania/src/Profile.cpp +++ b/stepmania/src/Profile.cpp @@ -1161,11 +1161,7 @@ void Profile::LoadGeneralDataFromNode( const XNode* pNode ) pNode->GetChildValue( "TotalGameplaySeconds", m_iTotalGameplaySeconds ); pNode->GetChildValue( "CurrentCombo", m_iCurrentCombo ); pNode->GetChildValue( "TotalCaloriesBurned", m_fTotalCaloriesBurned ); - { - int temp; - pNode->GetChildValue( "GoalType", temp ); - m_GoalType = GoalType( temp ); - } + pNode->GetChildValue( "GoalType", UnionCast(m_GoalType) ); pNode->GetChildValue( "GoalCalories", m_iGoalCalories ); pNode->GetChildValue( "GoalSeconds", m_iGoalSeconds ); pNode->GetChildValue( "LastPlayedMachineGuid", m_sLastPlayedMachineGuid ); diff --git a/stepmania/src/ScreenTextEntry.cpp b/stepmania/src/ScreenTextEntry.cpp index ca0ff50edf..cdafaf5b23 100644 --- a/stepmania/src/ScreenTextEntry.cpp +++ b/stepmania/src/ScreenTextEntry.cpp @@ -406,11 +406,7 @@ void ScreenTextEntryVisual::MoveY( int iDir ) do { m_iFocusY = enum_add2( m_iFocusY, +iDir ); - { - int temp = m_iFocusY; - wrap( temp, NUM_KeyboardRow ); - m_iFocusY = KeyboardRow( temp ); - } + wrap( UnionCast(m_iFocusY), NUM_KeyboardRow ); // HACK: Round to nearest option so that we always stop // on KEYBOARD_ROW_SPECIAL. diff --git a/stepmania/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp b/stepmania/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp index b80345f6e3..7edc608817 100644 --- a/stepmania/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp +++ b/stepmania/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp @@ -589,10 +589,7 @@ void MovieDecoder_FFMpeg::Close() RageSurface *MovieDecoder_FFMpeg::CreateCompatibleSurface( int iTextureWidth, int iTextureHeight, bool bPreferHighColor ) { - int temp = m_AVTexfmt; - RageSurface *surface = MovieTexture_FFMpeg::AVCodecCreateCompatibleSurface( iTextureWidth, iTextureHeight, bPreferHighColor, temp ); - m_AVTexfmt = avcodec::PixelFormat( temp ); - return surface; + return MovieTexture_FFMpeg::AVCodecCreateCompatibleSurface( iTextureWidth, iTextureHeight, bPreferHighColor, UnionCast(m_AVTexfmt) ); } MovieTexture_FFMpeg::MovieTexture_FFMpeg( RageTextureID ID ): diff --git a/stepmania/src/arch/MovieTexture/MovieTexture_Theora.cpp b/stepmania/src/arch/MovieTexture/MovieTexture_Theora.cpp index a5073ae2d6..55e2dd6c57 100644 --- a/stepmania/src/arch/MovieTexture/MovieTexture_Theora.cpp +++ b/stepmania/src/arch/MovieTexture/MovieTexture_Theora.cpp @@ -267,10 +267,7 @@ int MovieDecoder_Theora::GetFrame( RageSurface *pOut, float fTargetTime ) RageSurface *MovieDecoder_Theora::CreateCompatibleSurface( int iTextureWidth, int iTextureHeight, bool bPreferHighColor ) { - int temp = m_OutputPixFmt; - RageSurface *surface = MovieTexture_FFMpeg::AVCodecCreateCompatibleSurface( iTextureWidth, iTextureHeight, bPreferHighColor, temp ); - m_OutputPixFmt = avcodec::PixelFormat( temp ); - return surface; + return MovieTexture_FFMpeg::AVCodecCreateCompatibleSurface( iTextureWidth, iTextureHeight, bPreferHighColor, UnionCast(m_OutputPixFmt) ); } void MovieDecoder_Theora::ConvertToSurface( RageSurface *pSurface ) const @@ -607,10 +604,7 @@ int MovieDecoder_Theora::GetFrame( RageSurface *pOut, float fTargetTime ) RageSurface *MovieDecoder_Theora::CreateCompatibleSurface( int iTextureWidth, int iTextureHeight, bool bPreferHighColor ) { - int temp = m_OutputPixFmt; - RageSurface *surface = MovieTexture_FFMpeg::AVCodecCreateCompatibleSurface( iTextureWidth, iTextureHeight, bPreferHighColor, temp ); - m_OutputPixFmt = avcodec::PixelFormat( temp ); - return surface; + return MovieTexture_FFMpeg::AVCodecCreateCompatibleSurface( iTextureWidth, iTextureHeight, bPreferHighColor, UnionCast(m_OutputPixFmt) ); } void MovieDecoder_Theora::DecodeStripeStub( void *pCtx, theora_ycbcr_buffer yuv, int yfrag0, int yfrag_end )