From b36f6a6f041ce159e0567d79871f72a4cd6731cd Mon Sep 17 00:00:00 2001 From: Charles Lohr Date: Mon, 14 Mar 2005 20:26:50 +0000 Subject: [PATCH] VC6 cleanup. Remove .GetValue() "fixes" by overloading binary operators. --- stepmania/src/MusicWheel.cpp | 6 +++--- stepmania/src/ScreenAttract.cpp | 2 +- stepmania/src/ScreenEditMenu.cpp | 2 +- stepmania/src/ScreenGameplay.cpp | 6 +++--- stepmania/src/ScreenSplash.cpp | 2 +- stepmania/src/ScreenStage.cpp | 2 +- stepmania/src/ThemeMetric.h | 6 ++++++ 7 files changed, 16 insertions(+), 10 deletions(-) diff --git a/stepmania/src/MusicWheel.cpp b/stepmania/src/MusicWheel.cpp index c0de9ebd62..c34a123bcd 100644 --- a/stepmania/src/MusicWheel.cpp +++ b/stepmania/src/MusicWheel.cpp @@ -636,10 +636,10 @@ void MusicWheel::BuildWheelItemDatas( vector &arrayWheelItemDatas if( arrayWheelItemDatas[i].m_Type == TYPE_SONG ) bFoundAnySong = true; - if( SHOW_RANDOM.GetValue() && bFoundAnySong ) + if( SHOW_RANDOM && bFoundAnySong ) arrayWheelItemDatas.push_back( WheelItemData(TYPE_RANDOM, NULL, "", NULL, RageColor(1,0,0,1)) ); - if( SHOW_PORTAL.GetValue() && bFoundAnySong ) + if( SHOW_PORTAL && bFoundAnySong ) arrayWheelItemDatas.push_back( WheelItemData(TYPE_PORTAL, NULL, "", NULL, RageColor(1,0,0,1)) ); } @@ -783,7 +783,7 @@ void MusicWheel::GetItemPosition( float fPosOffsetsFromMiddle, float& fX_out, fl // printf( "fRotationX_out = %f\n", fRotationX_out ); } - else if(!USE_LINEAR_WHEEL.GetValue()) + else if(!USE_LINEAR_WHEEL) { fX_out = (1-cosf(fPosOffsetsFromMiddle/PI))*ITEM_CURVE_X; fY_out = fPosOffsetsFromMiddle*ITEM_SPACING_Y; diff --git a/stepmania/src/ScreenAttract.cpp b/stepmania/src/ScreenAttract.cpp index 63f1857664..5e3be1dbd9 100644 --- a/stepmania/src/ScreenAttract.cpp +++ b/stepmania/src/ScreenAttract.cpp @@ -27,7 +27,7 @@ ScreenAttract::ScreenAttract( CString sName, bool bResetGameState ) : ScreenWith GAMESTATE->Reset(); // increment times through attract count - if( m_sName == INITIAL_SCREEN.GetValue() ) + if( INITIAL_SCREEN == m_sName ) GAMESTATE->m_iNumTimesThroughAttract++; } diff --git a/stepmania/src/ScreenEditMenu.cpp b/stepmania/src/ScreenEditMenu.cpp index b439d7eda0..3663b836a0 100644 --- a/stepmania/src/ScreenEditMenu.cpp +++ b/stepmania/src/ScreenEditMenu.cpp @@ -63,7 +63,7 @@ void DeleteCurSteps( void* pThrowAway ) Song* pSong = GAMESTATE->m_pCurSong; Steps* pStepsToDelete = GAMESTATE->m_pCurSteps[PLAYER_1]; pSong->RemoveSteps( pStepsToDelete ); - if( !HOME_EDIT_MODE.GetValue() ) + if( !HOME_EDIT_MODE ) { pSong->Save(); SCREENMAN->ZeroNextUpdate(); diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index ff3ccfa42d..d15bb525df 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -1769,8 +1769,8 @@ void ScreenGameplay::Input( const DeviceInput& DeviceI, const InputEventType typ * * However, if this is also a style button, don't do this. (pump center = start) */ bool bHoldingGiveUp = false; - bHoldingGiveUp |= (MenuI.button == MENU_BUTTON_START && !StyleI.IsValid() && START_GIVES_UP.GetValue()); - bHoldingGiveUp |= (MenuI.button == MENU_BUTTON_BACK && !StyleI.IsValid() && BACK_GIVES_UP.GetValue()); + bHoldingGiveUp |= ( START_GIVES_UP && MenuI.button == MENU_BUTTON_START && !StyleI.IsValid() ); + bHoldingGiveUp |= ( BACK_GIVES_UP && MenuI.button == MENU_BUTTON_BACK && !StyleI.IsValid() ); if( bHoldingGiveUp ) { @@ -1792,7 +1792,7 @@ void ScreenGameplay::Input( const DeviceInput& DeviceI, const InputEventType typ /* Only handle MENU_BUTTON_BACK as a regular BACK button if BACK_GIVES_UP is * disabled. */ - if( MenuI.button == MENU_BUTTON_BACK && !BACK_GIVES_UP.GetValue() ) + if( MenuI.button == MENU_BUTTON_BACK && !BACK_GIVES_UP ) { if( ((!PREFSMAN->m_bDelayedBack && type==IET_FIRST_PRESS) || (DeviceI.device==DEVICE_KEYBOARD && (type==IET_SLOW_REPEAT||type==IET_FAST_REPEAT)) || diff --git a/stepmania/src/ScreenSplash.cpp b/stepmania/src/ScreenSplash.cpp index fd08ce8b44..4670e2eeac 100644 --- a/stepmania/src/ScreenSplash.cpp +++ b/stepmania/src/ScreenSplash.cpp @@ -67,7 +67,7 @@ void ScreenSplash::MenuStart( PlayerNumber pn ) { if( IsTransitioning() ) return; - if( !ALLOW_START_TO_SKIP.GetValue() ) + if( !ALLOW_START_TO_SKIP ) return; this->ClearMessageQueue( SM_PrepScreen ); HandleScreenMessage( SM_PrepScreen ); diff --git a/stepmania/src/ScreenStage.cpp b/stepmania/src/ScreenStage.cpp index 30e15ce8e2..ebbabd1b42 100644 --- a/stepmania/src/ScreenStage.cpp +++ b/stepmania/src/ScreenStage.cpp @@ -150,7 +150,7 @@ void ScreenStage::MenuBack( PlayerNumber pn ) if( m_In.IsTransitioning() || m_Out.IsTransitioning() || m_Back.IsTransitioning() ) return; - if( !ALLOW_BACK.GetValue() ) + if( !ALLOW_BACK ) return; this->ClearMessageQueue(); diff --git a/stepmania/src/ThemeMetric.h b/stepmania/src/ThemeMetric.h index a27f98d476..1d984ba15b 100644 --- a/stepmania/src/ThemeMetric.h +++ b/stepmania/src/ThemeMetric.h @@ -77,6 +77,12 @@ public: { return m_currentValue; } + + //Hacks for VC6 for all boolean operators. + bool operator ! () const { return !m_currentValue; } + bool operator && ( const T& input ) const { return m_currentValue && input; } + bool operator || ( const T& input ) const { return m_currentValue || input; } + bool operator == ( const T& input ) const { return m_currentValue == input; } }; typedef CString (*MetricName1D)(size_t N);