Merge pull request #2062 from FMS-Cat/RateModsAffectFGChanges

feature: Add a preference, RateModsAffectFGChanges
This commit is contained in:
Crystal Squirrel
2021-01-28 08:50:12 +00:00
committed by GitHub
7 changed files with 320 additions and 301 deletions
+2 -2
View File
@@ -729,8 +729,8 @@ void BackgroundImpl::Layer::UpdateCurBGChange( const Song *pSong, float fLastMus
beat_info.elapsed_time= fCurrentTime;
pSong->m_SongTiming.GetBeatAndBPSFromElapsedTime(beat_info);
// Calls to Update() should *not* be scaled by music rate; fCurrentTime is. Undo it.
const float fRate = GAMESTATE->m_SongOptions.GetCurrent().m_fMusicRate;
// Calls to Update() should *not* be scaled by music rate unless RateModsAffectFGChanges is enabled; fCurrentTime is. Undo it.
const float fRate = PREFSMAN->m_bRateModsAffectTweens ? 1.0f : GAMESTATE->m_SongOptions.GetCurrent().m_fMusicRate;
// Find the BGSegment we're in
const int i = FindBGSegmentForBeat(beat_info.beat);
+2 -2
View File
@@ -72,8 +72,8 @@ void Foreground::LoadFromSong( const Song *pSong )
void Foreground::Update( float fDeltaTime )
{
// Calls to Update() should *not* be scaled by music rate. Undo it.
const float fRate = GAMESTATE->m_SongOptions.GetCurrent().m_fMusicRate;
// Calls to Update() should *not* be scaled by music rate unless RateModsAffectFGChanges is enabled. Undo it.
const float fRate = PREFSMAN->m_bRateModsAffectTweens ? 1.0f : GAMESTATE->m_SongOptions.GetCurrent().m_fMusicRate;
for( unsigned i=0; i < m_BGAnimations.size(); ++i )
{
+3 -1
View File
@@ -111,8 +111,10 @@ void PlayerOptions::Init()
void PlayerOptions::Approach( const PlayerOptions& other, float fDeltaSeconds )
{
const float fRateMult = PREFSMAN->m_bRateModsAffectTweens ? GAMESTATE->m_SongOptions.GetCurrent().m_fMusicRate : 1.0f;
#define APPROACH( opt ) \
fapproach( m_ ## opt, other.m_ ## opt, fDeltaSeconds * other.m_Speed ## opt );
fapproach( m_ ## opt, other.m_ ## opt, fRateMult * fDeltaSeconds * other.m_Speed ## opt );
#define DO_COPY( x ) \
x = other.x;
+1
View File
@@ -190,6 +190,7 @@ PrefsManager::PrefsManager() :
m_fLifeDifficultyScale ( "LifeDifficultyScale", 1.0f ),
m_bRateModsAffectTweens ( "RateModsAffectFGChanges", false ),
m_iRegenComboAfterMiss ( "RegenComboAfterMiss", 5 ),
m_iMaxRegenComboAfterMiss ( "MaxRegenComboAfterMiss", 5 ), // this was 10 by default in SM3.95 -dguzek
+6
View File
@@ -182,6 +182,12 @@ public:
Preference<float> m_fLifeDifficultyScale;
/**
* Whether ratemod should affect playback speeds of FGChanges or not.
* Originally introduced in NotITG.
*/
Preference<bool> m_bRateModsAffectTweens;
// Whoever added these: Please add a comment saying what they do. -Chris
Preference<int> m_iRegenComboAfterMiss; // combo that must be met after a Miss to regen life
Preference<int> m_iMaxRegenComboAfterMiss; // caps RegenComboAfterMiss if multiple Misses occur in rapid succession
+10 -1
View File
@@ -1651,6 +1651,8 @@ void ScreenEdit::Update( float fDeltaTime )
{
m_PlayerStateEdit.Update( fDeltaTime );
const float fRate = PREFSMAN->m_bRateModsAffectTweens ? GAMESTATE->m_SongOptions.GetCurrent().m_fMusicRate : 1.0f;
if( m_pSoundMusic->IsPlaying() )
{
RageTimer tm;
@@ -1755,7 +1757,14 @@ void ScreenEdit::Update( float fDeltaTime )
}
//LOG->Trace( "ScreenEdit::Update(%f)", fDeltaTime );
ScreenWithMenuElements::Update( fDeltaTime );
if( m_EditState == STATE_PLAYING )
{
ScreenWithMenuElements::Update( fDeltaTime * fRate );
}
else
{
ScreenWithMenuElements::Update( fDeltaTime );
}
// Update trailing beat
+2 -1
View File
@@ -1701,7 +1701,8 @@ void ScreenGameplay::Update( float fDeltaTime )
}
else
{
Screen::Update( fDeltaTime );
const float fRate = PREFSMAN->m_bRateModsAffectTweens ? GAMESTATE->m_SongOptions.GetCurrent().m_fMusicRate : 1.0f;
Screen::Update( fDeltaTime * fRate );
}
/* This happens if ScreenDemonstration::HandleScreenMessage sets a new screen when