VC6 cleanup. Remove .GetValue() "fixes" by overloading binary operators.

This commit is contained in:
Charles Lohr
2005-03-14 20:26:50 +00:00
parent 81290aa995
commit b36f6a6f04
7 changed files with 16 additions and 10 deletions
+3 -3
View File
@@ -636,10 +636,10 @@ void MusicWheel::BuildWheelItemDatas( vector<WheelItemData> &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;
+1 -1
View File
@@ -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++;
}
+1 -1
View File
@@ -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();
+3 -3
View File
@@ -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)) ||
+1 -1
View File
@@ -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 );
+1 -1
View File
@@ -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();
+6
View File
@@ -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);