Fixed operator= for PlayerOptions.

This commit is contained in:
Kyzentun
2015-01-27 21:02:24 -07:00
parent 5d616b244b
commit bd3671ed2e
+31 -17
View File
@@ -791,39 +791,53 @@ PlayerOptions& PlayerOptions::operator=(PlayerOptions const& other)
{ {
// Do not copy m_pn from the other, it must be preserved as what PlayerState set it to. // Do not copy m_pn from the other, it must be preserved as what PlayerState set it to.
#define CPY(x) x= other.x; #define CPY(x) x= other.x;
#define CPY_SPEED(x) m_ ## x = other.m_ ## x; m_Speed ## x = other.m_Speed ## x;
CPY(m_LifeType); CPY(m_LifeType);
CPY(m_DrainType); CPY(m_DrainType);
CPY(m_BatteryLives); CPY(m_BatteryLives);
CPY(m_fTimeSpacing); CPY_SPEED(fTimeSpacing);
CPY(m_fScrollSpeed); CPY_SPEED(fScrollSpeed);
CPY(m_fScrollBPM); CPY_SPEED(fScrollBPM);
CPY(m_fMaxScrollBPM); CPY_SPEED(fMaxScrollBPM);
CPY(m_fRandomSpeed); CPY_SPEED(fRandomSpeed);
CPY(m_FailType); CPY(m_FailType);
CPY(m_MinTNSToHideNotes); CPY(m_MinTNSToHideNotes);
CPY(m_bMuteOnError); CPY(m_bMuteOnError);
CPY(m_fDark); CPY_SPEED(fDark);
CPY(m_fBlind); CPY_SPEED(fBlind);
CPY(m_fCover); CPY_SPEED(fCover);
CPY(m_fRandAttack); CPY_SPEED(fRandAttack);
CPY(m_fNoAttack); CPY_SPEED(fNoAttack);
CPY(m_fPlayerAutoPlay); CPY_SPEED(fPlayerAutoPlay);
CPY(m_fPerspectiveTilt); CPY_SPEED(fPerspectiveTilt);
CPY(m_fSkew); CPY_SPEED(fSkew);
CPY(m_sNoteSkin); CPY(m_sNoteSkin);
for( int i = 0; i < PlayerOptions::NUM_ACCELS; ++i ) for( int i = 0; i < PlayerOptions::NUM_ACCELS; ++i )
CPY(m_fAccels[i]); {
CPY_SPEED(fAccels[i]);
}
for( int i = 0; i < PlayerOptions::NUM_EFFECTS; ++i ) for( int i = 0; i < PlayerOptions::NUM_EFFECTS; ++i )
CPY(m_fEffects[i]); {
CPY_SPEED(fEffects[i]);
}
for( int i = 0; i < PlayerOptions::NUM_APPEARANCES; ++i ) for( int i = 0; i < PlayerOptions::NUM_APPEARANCES; ++i )
CPY(m_fAppearances[i]); {
CPY_SPEED(fAppearances[i]);
}
for( int i = 0; i < PlayerOptions::NUM_SCROLLS; ++i ) for( int i = 0; i < PlayerOptions::NUM_SCROLLS; ++i )
CPY(m_fScrolls[i]); {
CPY_SPEED(fScrolls[i]);
}
for( int i = 0; i < PlayerOptions::NUM_TURNS; ++i ) for( int i = 0; i < PlayerOptions::NUM_TURNS; ++i )
{
CPY(m_bTurns[i]); CPY(m_bTurns[i]);
}
for( int i = 0; i < PlayerOptions::NUM_TRANSFORMS; ++i ) for( int i = 0; i < PlayerOptions::NUM_TRANSFORMS; ++i )
{
CPY(m_bTransforms[i]); CPY(m_bTransforms[i]);
}
#undef CPY #undef CPY
#undef CPY_SPEED
return *this; return *this;
} }