From 5f8353bdd0f02fc875434900661a9adcf39ef1a1 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Wed, 25 May 2011 14:07:53 -0400 Subject: [PATCH] Use Step Timing if steps are already on Splits. --- src/ScreenEdit.cpp | 4 ++++ src/Steps.cpp | 15 +++++++-------- src/Steps.h | 5 +++++ 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/ScreenEdit.cpp b/src/ScreenEdit.cpp index 65d41e3c54..0c8f3b6427 100644 --- a/src/ScreenEdit.cpp +++ b/src/ScreenEdit.cpp @@ -733,6 +733,10 @@ void ScreenEdit::Init() m_pSong = GAMESTATE->m_pCurSong; m_pSteps = GAMESTATE->m_pCurSteps[PLAYER_1]; + + if( m_pSteps->UsesSplitTiming() ) + GAMESTATE->m_bIsUsingStepTiming = true; + m_bReturnToRecordMenuAfterPlay = false; m_fBeatToReturnTo = 0; diff --git a/src/Steps.cpp b/src/Steps.cpp index e2b658f213..de2634e83c 100644 --- a/src/Steps.cpp +++ b/src/Steps.cpp @@ -424,6 +424,12 @@ void Steps::SetCachedRadarValues( const RadarValues v[NUM_PLAYERS] ) copy( v, v + NUM_PLAYERS, m_CachedRadarValues ); } +bool Steps::UsesSplitTiming() const +{ + Song *song = SONGMAN->GetSongFromSteps(const_cast(this)); + return song->m_SongTiming != this->m_Timing; +} + // lua start #include "LuaBinding.h" @@ -441,6 +447,7 @@ public: DEFINE_METHOD( IsAutogen, IsAutogen() ) DEFINE_METHOD( IsAnEdit, IsAnEdit() ) DEFINE_METHOD( IsAPlayerEdit, IsAPlayerEdit() ) + DEFINE_METHOD( UsesSplitTiming, UsesSplitTiming() ) static int HasSignificantTimingChanges( T* p, lua_State *L ) { lua_pushboolean(L, p->HasSignificantTimingChanges()); return 1; } @@ -468,14 +475,6 @@ public: lua_pushstring( L, out ); return 1; } - - static int UsesSplitTiming( T* p, lua_State *L ) - { - Song *song = SONGMAN->GetSongFromSteps(p); - lua_pushboolean(L, p->m_Timing != song->m_SongTiming); - return 1; - } - LunaSteps() { diff --git a/src/Steps.h b/src/Steps.h index 078295bc71..94e2046cf5 100644 --- a/src/Steps.h +++ b/src/Steps.h @@ -132,6 +132,11 @@ public: StepsType m_StepsType; CachedObject m_CachedObject; + + /** + * @brief Determine if the Steps use Split Timing by comparing the Song it's in. + * @return true if the Step and Song use different timings, false otherwise. */ + bool UsesSplitTiming() const; private: inline const Steps *Real() const { return parent ? parent : this; }