Replace Steps:UseSplitTiming.

Instead, use Song:IsStepsUsingDifferentTiming.
This commit is contained in:
Jason Felds
2012-04-08 23:56:28 -04:00
parent 2031cbb366
commit 26f5e8d78c
6 changed files with 16 additions and 15 deletions
+2
View File
@@ -13,6 +13,8 @@ StepMania 5.0 alpha 2 | 201204??
----------
* [ScreenNetworkOptions] Fixed a bug where localized text would not show up
properly. Fixes issue 759. [AJ]
* [Steps, Song] Replace Steps:UsesSplitTiming with
Song:IsStepsUsingDifferentTiming for both C++ and Lua. [wolfman2000]
2012/04/06
----------
+1 -1
View File
@@ -1122,7 +1122,7 @@ void ScreenEdit::Init()
/* The user will most likely switch into Step Timing after laying down
some initial notes. It also throws off many people at first glance.
*/
if( m_pSteps->UsesSplitTiming() )
if( m_pSong->IsStepsUsingDifferentTiming(m_pSteps) )
GAMESTATE->m_bIsUsingStepTiming = true;
+11
View File
@@ -1580,6 +1580,11 @@ bool Song::IsEditAlreadyLoaded( Steps* pSteps ) const
return false;
}
bool Song::IsStepsUsingDifferentTiming(Steps *pSteps) const
{
return pSteps->m_Timing != this->m_SongTiming;
}
bool Song::HasSignificantBpmChangesOrStops() const
{
if( m_SongTiming.HasStops() || m_SongTiming.HasDelays() )
@@ -1819,6 +1824,11 @@ public:
lua_pushboolean( L, p->HasStepsTypeAndDifficulty(st, dc) );
return 1;
}
static int IsStepsUsingDifferentTiming(T* p, lua_State *L)
{
lua_pushboolean(L, p->IsStepsUsingDifferentTiming(Luna<Steps>::check( L, 1, true )));
return 1;
}
/* TODO: HasStepsTypeAndDifficulty and GetOneSteps should be in
* a SongUtil Lua table and a method of Steps. */
static int GetOneSteps( T* p, lua_State *L )
@@ -1993,6 +2003,7 @@ public:
ADD_METHOD( IsDisplayBpmSecret );
ADD_METHOD( IsDisplayBpmConstant );
ADD_METHOD( IsDisplayBpmRandom );
ADD_METHOD( IsStepsUsingDifferentTiming );
ADD_METHOD( ShowInDemonstrationAndRanking );
ADD_METHOD( HasPreviewVid );
ADD_METHOD( GetPreviewVidPath );
+2
View File
@@ -418,6 +418,8 @@ public:
int GetNumStepsLoadedFromProfile( ProfileSlot slot ) const;
bool IsEditAlreadyLoaded( Steps* pSteps ) const;
bool IsStepsUsingDifferentTiming(Steps *pSteps ) const;
/**
* @brief An array of keysound file names (e.g. "beep.wav").
* The index in this array corresponds to the index in TapNote.
-9
View File
@@ -521,13 +521,6 @@ void Steps::SetCachedRadarValues( const RadarValues v[NUM_PLAYERS] )
m_bAreCachedRadarValuesJustLoaded = true;
}
bool Steps::UsesSplitTiming() const
{
Song *song = SONGMAN->GetSongFromSteps(const_cast<Steps *>(this));
return song->m_SongTiming != this->m_Timing;
}
// lua start
#include "LuaBinding.h"
/** @brief Allow Lua to have access to the Steps. */
@@ -544,7 +537,6 @@ 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 )
{
@@ -641,7 +633,6 @@ public:
ADD_METHOD( IsAnEdit );
ADD_METHOD( IsAutogen );
ADD_METHOD( IsAPlayerEdit );
ADD_METHOD( UsesSplitTiming );
ADD_METHOD( GetDisplayBpms );
ADD_METHOD( IsDisplayBpmSecret );
ADD_METHOD( IsDisplayBpmConstant );
-5
View File
@@ -174,11 +174,6 @@ public:
CachedObject<Steps> 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;
void SetDisplayBPM(const DisplayBPM type) { this->displayBPMType = type; }
DisplayBPM GetDisplayBPM() const { return this->displayBPMType; }
void SetMinBPM(const float f) { this->specifiedBPMMin = f; }