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
+7 -7
View File
@@ -578,7 +578,7 @@ void BackgroundImpl::LoadFromSong( const Song* pSong )
{
BackgroundChange change = bgc;
BackgroundDef &bd = change.m_def;
bool bIsAlreadyLoaded = layer.m_BGAnimations.find(bd) != layer.m_BGAnimations.end();
if( bd.m_sFile1 != RANDOM_BACKGROUND_FILE && !bIsAlreadyLoaded )
@@ -600,7 +600,7 @@ void BackgroundImpl::LoadFromSong( const Song* pSong )
}
}
}
if( !bd.IsEmpty() )
layer.m_aBGChanges.push_back( change );
}
@@ -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);
@@ -773,7 +773,7 @@ void BackgroundImpl::Layer::UpdateCurBGChange( const Song *pSong, float fLastMus
if( m_pFadingBGA )
{
m_pFadingBGA->PlayCommand( "LoseFocus" );
if( !change.m_sTransition.empty() )
{
map<RString,BackgroundTransition>::const_iterator lIter = mapNameToTransition.find( change.m_sTransition );
@@ -993,7 +993,7 @@ void Background::GetLoadedBackgroundChanges( vector<BackgroundChange> *pBackgrou
/*
* (c) 2001-2004 Chris Danford, Ben Nordstrom
* All rights reserved.
*
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
@@ -1003,7 +1003,7 @@ void Background::GetLoadedBackgroundChanges( vector<BackgroundChange> *pBackgrou
* copyright notice(s) and this permission notice appear in all copies of
* the Software and that both the above copyright notice(s) and this
* permission notice appear in supporting documentation.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
+4 -4
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 )
{
@@ -138,7 +138,7 @@ void Foreground::HandleMessage( const Message &msg )
/*
* (c) 2004 Glenn Maynard
* All rights reserved.
*
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
@@ -148,7 +148,7 @@ void Foreground::HandleMessage( const Message &msg )
* copyright notice(s) and this permission notice appear in all copies of
* the Software and that both the above copyright notice(s) and this
* permission notice appear in supporting documentation.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
+22 -20
View File
@@ -106,13 +106,15 @@ void PlayerOptions::Init()
ZERO( m_fTiny ); ONE( m_SpeedfTiny );
ZERO( m_fBumpy ); ONE( m_SpeedfBumpy );
ZERO( m_fReverse ); ONE( m_SpeedfReverse );
}
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;
@@ -263,7 +265,7 @@ void PlayerOptions::GetMods( vector<RString> &AddTo, bool bForceNoteSkin ) const
RString s = ssprintf( "C%.0f", m_fScrollBPM );
AddTo.push_back( s );
}
switch(m_ModTimerType)
{
case ModTimerType_Game:
@@ -418,11 +420,11 @@ void PlayerOptions::GetMods( vector<RString> &AddTo, bool bForceNoteSkin ) const
AddPart( AddTo, m_bDizzyHolds, "DizzyHolds");
AddPart( AddTo, m_bZBuffer, "ZBuffer");
AddPart( AddTo, m_bCosecant, "Cosecant");
for( int i=0; i<16; i++)
{
RString s = ssprintf( "MoveX%d", i+1 );
AddPart( AddTo, m_fMovesX[i], s );
s = ssprintf( "MoveY%d", i+1 );
AddPart( AddTo, m_fMovesY[i], s );
@@ -464,7 +466,7 @@ void PlayerOptions::GetMods( vector<RString> &AddTo, bool bForceNoteSkin ) const
AddPart( AddTo, m_fModTimerOffset, "ModTimerOffset" );
AddPart( AddTo, m_fDrawSize, "DrawSize" );
AddPart( AddTo, m_fDrawSizeBack, "DrawSizeBack" );
AddPart( AddTo, m_fDark, "Dark" );
AddPart( AddTo, m_fBlind, "Blind" );
@@ -1068,7 +1070,7 @@ bool PlayerOptions::FromOneModString( const RString &sOneMod, RString &sErrorOut
m_sNoteSkin = CommonMetrics::DEFAULT_NOTESKIN_NAME;
}
else if( sBit == "randomspeed" ) SET_FLOAT( fRandomSpeed )
else if( sBit == "failarcade" ||
else if( sBit == "failarcade" ||
sBit == "failimmediate" ) m_FailType = FailType_Immediate;
else if( sBit == "failendofsong" ||
sBit == "failimmediatecontinue" ) m_FailType = FailType_ImmediateContinue;
@@ -1082,7 +1084,7 @@ bool PlayerOptions::FromOneModString( const RString &sOneMod, RString &sErrorOut
}
else if( sBit == "muteonerror" ) m_bMuteOnError = on;
else if( sBit == "random" ) ChooseRandomModifiers();
else if( sBit.find("move") != sBit.npos)
{
if (sBit.find("x") != sBit.npos)
@@ -1552,7 +1554,7 @@ bool PlayerOptions::IsEasierForSongAndSteps( Song* pSong, Steps* pSteps, PlayerN
if( m_bTransforms[TRANSFORM_NOSTRETCH] )
return true;
// Inserted holds can be really easy on some songs, and scores will be
// Inserted holds can be really easy on some songs, and scores will be
// highly hold-weighted, and very little tap score weighted.
if( m_bTransforms[TRANSFORM_LITTLE] ) return true;
if( m_bTransforms[TRANSFORM_PLANTED] ) return true;
@@ -1561,13 +1563,13 @@ bool PlayerOptions::IsEasierForSongAndSteps( Song* pSong, Steps* pSteps, PlayerN
// This makes songs with sparse notes easier.
if( m_bTransforms[TRANSFORM_ECHO] ) return true;
// Removing attacks is easier in general.
if ((m_fNoAttack && pSteps->HasAttacks()) || m_fRandAttack)
return true;
if( m_fCover ) return true;
// M-mods make songs with indefinite BPMs easier because
// they ensure that the song has a scrollable speed.
if( m_fMaxScrollBPM != 0 )
@@ -1726,7 +1728,7 @@ void PlayerOptions::ResetPrefs( ResetPrefsType type )
#include "LuaBinding.h"
#include "OptionsBinding.h"
/** @brief Allow Lua to have access to PlayerOptions. */
/** @brief Allow Lua to have access to PlayerOptions. */
class LunaPlayerOptions: public Luna<PlayerOptions>
{
public:
@@ -1914,7 +1916,7 @@ public:
FLOAT_INTERFACE(Tilt, PerspectiveTilt, true);
FLOAT_INTERFACE(Passmark, Passmark, true); // Passmark is not sanity checked to the [0, 1] range because LifeMeterBar::IsFailing is the only thing that uses it, and it's used in a <= test. Any theme passing a value outside the [0, 1] range probably expects the result they get. -Kyz
FLOAT_INTERFACE(RandomSpeed, RandomSpeed, true);
MULTICOL_FLOAT_INTERFACE(MoveX, MovesX, true);
MULTICOL_FLOAT_INTERFACE(MoveY, MovesY, true);
MULTICOL_FLOAT_INTERFACE(MoveZ, MovesZ, true);
@@ -1926,7 +1928,7 @@ public:
MULTICOL_FLOAT_INTERFACE(Tiny, Tiny, true);
MULTICOL_FLOAT_INTERFACE(Bumpy, Bumpy, true);
MULTICOL_FLOAT_INTERFACE(Reverse, Reverse, true);
BOOL_INTERFACE(StealthType, StealthType);
BOOL_INTERFACE(StealthPastReceptors, StealthPastReceptors);
BOOL_INTERFACE(DizzyHolds, DizzyHolds);
@@ -2209,7 +2211,7 @@ public:
OPTIONAL_RETURN_SELF(original_top);
return 2;
}
static int Distant(T* p, lua_State* L)
{
int original_top= lua_gettop(L);
@@ -2472,7 +2474,7 @@ public:
ADD_METHOD(NoQuads);
ADD_METHOD(NoStretch);
ADD_METHOD(MuteOnError);
ADD_MULTICOL_METHOD(MoveX);
ADD_MULTICOL_METHOD(MoveY);
ADD_MULTICOL_METHOD(MoveZ);
@@ -2484,7 +2486,7 @@ public:
ADD_MULTICOL_METHOD(Tiny);
ADD_MULTICOL_METHOD(Bumpy);
ADD_MULTICOL_METHOD(Reverse);
ADD_METHOD(NoteSkin);
ADD_METHOD(FailSetting);
@@ -2515,7 +2517,7 @@ LUA_REGISTER_CLASS( PlayerOptions )
/*
* (c) 2001-2004 Chris Danford, Glenn Maynard
* All rights reserved.
*
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
@@ -2525,7 +2527,7 @@ LUA_REGISTER_CLASS( PlayerOptions )
* copyright notice(s) and this permission notice appear in all copies of
* the Software and that both the above copyright notice(s) and this
* permission notice appear in supporting documentation.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
+7 -6
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
@@ -276,7 +277,7 @@ PrefsManager::PrefsManager() :
m_iRageSoundSampleCountClamp ("RageSoundSampleCountClamp", 0), //some sound drivers mask the sample location number, the most popular number for this is 2^27, this causes lockup after ~50 minutes at 44.1khz sample rate
m_iSoundPreferredSampleRate ( "SoundPreferredSampleRate", 0 ),
m_sLightsStepsDifficulty ( "LightsStepsDifficulty", "hard,medium" ),
m_bAllowUnacceleratedRenderer ( "AllowUnacceleratedRenderer", false ),
m_bAllowUnacceleratedRenderer ( "AllowUnacceleratedRenderer", false ),
m_bThreadedInput ( "ThreadedInput", true ),
m_bThreadedMovieDecode ( "ThreadedMovieDecode", true ),
m_sTestInitialScreen ( "TestInitialScreen", "" ),
@@ -546,7 +547,7 @@ RString PrefsManager::GetPreferencesSection() const
// lua start
#include "LuaBinding.h"
/** @brief Allow Lua to have access to the PrefsManager. */
/** @brief Allow Lua to have access to the PrefsManager. */
class LunaPrefsManager: public Luna<PrefsManager>
{
public:
@@ -607,9 +608,9 @@ public:
lua_pushboolean( L, true );
return 1;
}
static int SavePreferences( T* p, lua_State *L ) { p->SavePrefsToDisk(); COMMON_RETURN_SELF; }
LunaPrefsManager()
{
ADD_METHOD( GetPreference );
@@ -626,7 +627,7 @@ LUA_REGISTER_CLASS( PrefsManager )
/*
* (c) 2001-2004 Chris Danford, Chris Gomez
* All rights reserved.
*
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
@@ -636,7 +637,7 @@ LUA_REGISTER_CLASS( PrefsManager )
* copyright notice(s) and this permission notice appear in all copies of
* the Software and that both the above copyright notice(s) and this
* permission notice appear in supporting documentation.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
+28 -22
View File
@@ -15,36 +15,36 @@ void ValidateSongsPerPlay( int &val );
const int MAX_SONGS_PER_PLAY = 7;
enum MusicWheelUsesSections
{
MusicWheelUsesSections_NEVER,
MusicWheelUsesSections_ALWAYS,
MusicWheelUsesSections_ABC_ONLY,
NUM_MusicWheelUsesSections,
{
MusicWheelUsesSections_NEVER,
MusicWheelUsesSections_ALWAYS,
MusicWheelUsesSections_ABC_ONLY,
NUM_MusicWheelUsesSections,
MusicWheelUsesSections_Invalid
};
/** @brief The options for allowing the W1 timing. */
enum AllowW1
{
{
ALLOW_W1_NEVER, /**< The W1 timing is not used. */
ALLOW_W1_COURSES_ONLY, /**< The W1 timing is used for courses only. */
ALLOW_W1_EVERYWHERE, /**< The W1 timing is used for all modes. */
NUM_AllowW1,
NUM_AllowW1,
AllowW1_Invalid
};
enum Maybe
{
Maybe_ASK,
Maybe_NO,
Maybe_YES,
NUM_Maybe,
Maybe_Invalid
{
Maybe_ASK,
Maybe_NO,
Maybe_YES,
NUM_Maybe,
Maybe_Invalid
};
enum GetRankingName
{
RANKING_OFF,
RANKING_ON,
RANKING_LIST,
NUM_GetRankingName,
enum GetRankingName
{
RANKING_OFF,
RANKING_ON,
RANKING_LIST,
NUM_GetRankingName,
GetRankingName_Invalid
};
enum RandomBackgroundMode
@@ -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
@@ -281,7 +287,7 @@ public:
Preference<RString> m_sVideoRenderers; // StepMania.cpp sets these on first run based on the card
Preference<bool> m_bSmoothLines;
Preference<int> m_iSoundWriteAhead;
Preference<RString> m_iSoundDevice;
Preference<RString> m_iSoundDevice;
Preference<int> m_iRageSoundSampleCountClamp;
Preference<int> m_iSoundPreferredSampleRate;
Preference<RString> m_sLightsStepsDifficulty;
@@ -363,7 +369,7 @@ extern PrefsManager* PREFSMAN; // global and accessible from anywhere in our pro
* @author Chris Danford, Chris Gomez (c) 2001-2004
* @section LICENSE
* All rights reserved.
*
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
@@ -373,7 +379,7 @@ extern PrefsManager* PREFSMAN; // global and accessible from anywhere in our pro
* copyright notice(s) and this permission notice appear in all copies of
* the Software and that both the above copyright notice(s) and this
* permission notice appear in supporting documentation.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
+216 -207
View File
File diff suppressed because it is too large Load Diff
+36 -35
View File
@@ -99,14 +99,14 @@ static Preference<bool> g_bEasterEggs( "EasterEggs", true );
PlayerInfo::PlayerInfo(): m_pn(PLAYER_INVALID), m_mp(MultiPlayer_Invalid),
m_bIsDummy(false), m_iDummyIndex(0), m_iAddToDifficulty(0),
m_bPlayerEnabled(false), m_PlayerStateDummy(),
m_bPlayerEnabled(false), m_PlayerStateDummy(),
m_PlayerStageStatsDummy(), m_SoundEffectControl(),
m_vpStepsQueue(), m_asModifiersQueue(), m_pLifeMeter(nullptr),
m_vpStepsQueue(), m_asModifiersQueue(), m_pLifeMeter(nullptr),
m_ptextCourseSongNumber(nullptr), m_ptextStepsDescription(nullptr),
m_pPrimaryScoreDisplay(nullptr), m_pSecondaryScoreDisplay(nullptr),
m_pPrimaryScoreKeeper(nullptr), m_pSecondaryScoreKeeper(nullptr),
m_ptextPlayerOptions(nullptr), m_pActiveAttackList(nullptr),
m_NoteData(), m_pPlayer(nullptr), m_pInventory(nullptr),
m_NoteData(), m_pPlayer(nullptr), m_pInventory(nullptr),
m_pStepsDisplay(nullptr), m_sprOniGameOver() {}
void PlayerInfo::Load( PlayerNumber pn, MultiPlayer mp, bool bShowNoteField, int iAddToDifficulty )
@@ -250,7 +250,7 @@ bool PlayerInfo::IsEnabled()
FAIL_M("Invalid non-dummy player.");
}
vector<PlayerInfo>::iterator
vector<PlayerInfo>::iterator
GetNextEnabledPlayerInfo( vector<PlayerInfo>::iterator iter, vector<PlayerInfo> &v )
{
for( ; iter != v.end(); ++iter )
@@ -262,7 +262,7 @@ GetNextEnabledPlayerInfo( vector<PlayerInfo>::iterator iter, vector<PlayerInfo>
return iter;
}
vector<PlayerInfo>::iterator
vector<PlayerInfo>::iterator
GetNextEnabledPlayerInfoNotDummy( vector<PlayerInfo>::iterator iter, vector<PlayerInfo> &v )
{
for( ; iter != v.end(); iter++ )
@@ -423,7 +423,7 @@ void ScreenGameplay::Init()
FOREACH_EnabledPlayerInfo( m_vPlayerInfo, pi )
{
unsigned int count = pi->m_vpStepsQueue.size();
for (unsigned int i = 0; i < count; i++)
{
Steps *curSteps = pi->m_vpStepsQueue[i];
@@ -433,7 +433,7 @@ void ScreenGameplay::Init()
{
LOG->Trace("Notes should be loaded for player %d", player);
}
else
else
{
LOG->Trace("Error loading notes for player %d", player);
}
@@ -441,7 +441,7 @@ void ScreenGameplay::Init()
}
player++;
}
if(!GAMESTATE->IsCourseMode() && !GAMESTATE->m_bDemonstrationOrJukebox)
{
// fill in difficulty of CPU players with that of the first human player
@@ -582,7 +582,7 @@ void ScreenGameplay::Init()
right_marge= margins[PLAYER_2][1]; \
field_space= screen_space - left_marge - right_marge; \
}
// If pi->m_pn is set, then the player will be visible. If not, then it's not
// If pi->m_pn is set, then the player will be visible. If not, then it's not
// visible and don't bother setting its position.
if(GAMESTATE->m_bMultiplayer && !pi->m_bIsDummy)
CENTER_PLAYER_BLOCK
@@ -650,7 +650,7 @@ void ScreenGameplay::Init()
// if you wait too long at the second checkpoint, you will
// appear dead when you begin your game.
if( !m_bForceNoNetwork )
NSMAN->StartRequest(0);
NSMAN->StartRequest(0);
// Add individual life meter
@@ -861,16 +861,16 @@ void ScreenGameplay::Init()
RString sType = PLAYER_TYPE;
if( pi->m_bIsDummy )
sType += "Dummy";
pi->m_pPlayer->Init(
pi->m_pPlayer->Init(
sType,
pi->GetPlayerState(),
pi->GetPlayerStageStats(),
pi->m_pLifeMeter,
m_pCombinedLifeMeter,
pi->m_pPrimaryScoreDisplay,
pi->m_pSecondaryScoreDisplay,
pi->m_pInventory,
pi->m_pPrimaryScoreKeeper,
pi->m_pLifeMeter,
m_pCombinedLifeMeter,
pi->m_pPrimaryScoreDisplay,
pi->m_pSecondaryScoreDisplay,
pi->m_pInventory,
pi->m_pPrimaryScoreKeeper,
pi->m_pSecondaryScoreKeeper );
}
@@ -914,7 +914,7 @@ bool ScreenGameplay::Center1Player() const
* StyleType for ONE_PLAYER_ONE_CREDIT_AND_ONE_COMPUTER,
* but for now just ignore Center1Player when it's Battle or Rave
* Mode. This doesn't begin to address two-player solo (6 arrows) */
return g_bCenter1Player &&
return g_bCenter1Player &&
(bool)ALLOW_CENTER_1_PLAYER &&
GAMESTATE->m_PlayMode != PLAY_MODE_BATTLE &&
GAMESTATE->m_PlayMode != PLAY_MODE_RAVE &&
@@ -958,7 +958,7 @@ void ScreenGameplay::InitSongQueues()
// In a survival course, override stored mods
if( pCourse->GetCourseType() == COURSE_TYPE_SURVIVAL && SURVIVAL_MOD_OVERRIDE )
{
pi->GetPlayerState()->m_PlayerOptions.FromString( ModsLevel_Stage,
pi->GetPlayerState()->m_PlayerOptions.FromString( ModsLevel_Stage,
"clearall,"
+ CommonMetrics::DEFAULT_NOTESKIN_NAME.GetValue()
+ ","
@@ -975,7 +975,7 @@ void ScreenGameplay::InitSongQueues()
Steps *pSteps = GAMESTATE->m_pCurSteps[ pi->GetStepsAndTrailIndex() ];
pi->m_vpStepsQueue.push_back( pSteps );
const PlayerOptions &p = pi->GetPlayerState()->m_PlayerOptions.GetCurrent();
if (p.m_fNoAttack == 0 && p.m_fRandAttack == 0 &&
pSteps->m_Attacks.size() > 0 )
{
@@ -1072,7 +1072,7 @@ void ScreenGameplay::SetupSong( int iSongIndex )
Steps *pSteps = pi->m_vpStepsQueue[iSongIndex];
GAMESTATE->m_pCurSteps[ pi->GetStepsAndTrailIndex() ].Set( pSteps );
/* Load new NoteData into Player. Do this before
/* Load new NoteData into Player. Do this before
* RebuildPlayerOptionsFromActiveAttacks or else transform mods will get
* propagated to GAMESTATE->m_pPlayerOptions too early and be double-applied
* to the NoteData:
@@ -1145,7 +1145,7 @@ void ScreenGameplay::SetupSong( int iSongIndex )
Attack a = pi->m_asModifiersQueue[iSongIndex][i];
if( a.fStartSecond == 0 )
a.fStartSecond = ATTACK_STARTS_NOW; // now
pi->GetPlayerState()->LaunchAttack( a );
GAMESTATE->m_SongOptions.FromString( ModsLevel_Song, a.sModifiers );
}
@@ -1273,7 +1273,7 @@ void ScreenGameplay::LoadNextSong()
else
pi->GetPlayerState()->m_PlayerController = GamePreferences::m_AutoPlay;
}
}
}
}
bool bAllReverse = true;
@@ -1625,7 +1625,7 @@ void ScreenGameplay::BeginScreen()
float startOffset = g_fNetStartOffset;
NSMAN->StartRequest(1);
NSMAN->StartRequest(1);
RageSoundParams p;
p.m_fSpeed = 1.0f; // Force 1.0 playback speed
@@ -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
@@ -1850,7 +1851,7 @@ void ScreenGameplay::Update( float fDeltaTime )
}
// Update living players' alive time
// HACK: Don't scale alive time when using tab/tilde. Instead of accumulating time from a timer,
// HACK: Don't scale alive time when using tab/tilde. Instead of accumulating time from a timer,
// this time should instead be tied to the music position.
float fUnscaledDeltaTime = m_timerGameplaySeconds.GetDeltaTime();
@@ -1862,7 +1863,7 @@ void ScreenGameplay::Update( float fDeltaTime )
STATSMAN->m_CurStageStats.m_fGameplaySeconds += fUnscaledDeltaTime;
float curBeat = GAMESTATE->m_Position.m_fSongBeat;
Song &s = *GAMESTATE->m_pCurSong;
if( curBeat >= s.GetFirstBeat() && curBeat < s.GetLastBeat() )
{
STATSMAN->m_CurStageStats.m_fStepsSeconds += fUnscaledDeltaTime;
@@ -2949,7 +2950,7 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
if(course->GetCourseType() == COURSE_TYPE_SURVIVAL &&
SURVIVAL_MOD_OVERRIDE)
{
pi->GetPlayerState()->m_PlayerOptions.FromString(ModsLevel_Stage,
pi->GetPlayerState()->m_PlayerOptions.FromString(ModsLevel_Stage,
"clearall," + CommonMetrics::DEFAULT_NOTESKIN_NAME.GetValue() +
"," + CommonMetrics::DEFAULT_MODIFIERS.GetValue());
pi->GetPlayerState()->RebuildPlayerOptionsFromActiveAttacks();
@@ -3134,7 +3135,7 @@ void ScreenGameplay::HandleMessage( const Message &msg )
ScreenWithMenuElements::HandleMessage( msg );
}
void ScreenGameplay::Cancel( ScreenMessage smSendWhenDone )
{
m_pSoundMusic->Stop();
@@ -3257,7 +3258,7 @@ bool ScreenGameplay::LoadReplay()
#include "LuaBinding.h"
#include "OptionsBinding.h"
/** @brief Allow Lua to have access to the ScreenGameplay. */
/** @brief Allow Lua to have access to the ScreenGameplay. */
class LunaScreenGameplay: public Luna<ScreenGameplay>
{
public:
@@ -3344,7 +3345,7 @@ public:
lua_pushnumber(L, true_bps);
return 1;
}
LunaScreenGameplay()
{
ADD_METHOD( GetNextCourseSong );
@@ -3368,7 +3369,7 @@ public:
LUA_REGISTER_DERIVED_CLASS( ScreenGameplay, ScreenWithMenuElements )
/** @brief Allow Lua to have access to the PlayerInfo. */
/** @brief Allow Lua to have access to the PlayerInfo. */
class LunaPlayerInfo: public Luna<PlayerInfo>
{
public:
@@ -3381,7 +3382,7 @@ public:
}
return 0;
}
static int GetStepsQueueWrapped( T* p, lua_State *L )
{
int iIndex = IArg(1);
@@ -3404,7 +3405,7 @@ LUA_REGISTER_CLASS( PlayerInfo )
/*
* (c) 2001-2004 Chris Danford, Glenn Maynard
* All rights reserved.
*
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
@@ -3414,7 +3415,7 @@ LUA_REGISTER_CLASS( PlayerInfo )
* copyright notice(s) and this permission notice appear in all copies of
* the Software and that both the above copyright notice(s) and this
* permission notice appear in supporting documentation.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF