diff --git a/Docs/Changelog_sm5.txt b/Docs/Changelog_sm5.txt index 975e00f49e..3b35cfac8a 100644 --- a/Docs/Changelog_sm5.txt +++ b/Docs/Changelog_sm5.txt @@ -12,6 +12,7 @@ StepMania 5.0 Preview 3 | 20110??? ---------- * [LifeMeterBattery] Added LostLife param to LifeChanged message. [AJ] * [LifeMeterBattery] Converted LifeMeterBattery lives to an AutoActor. [AJ] +* [TimingData] Add HasDelays() Lua binding; HasStops() now only checks stops. [AJ] 2011/08/06 ---------- diff --git a/src/TimingData.cpp b/src/TimingData.cpp index d078221cc8..ab2907b316 100644 --- a/src/TimingData.cpp +++ b/src/TimingData.cpp @@ -1367,12 +1367,14 @@ bool TimingData::HasBpmChanges() const return this->allTimingSegments[SEGMENT_BPM].size()>1; } -// TODO: Think about splitting this up into HasStops and HasDelays. bool TimingData::HasStops() const { - return - this->allTimingSegments[SEGMENT_STOP].size()>0 || - this->allTimingSegments[SEGMENT_DELAY].size()>0; + return this->allTimingSegments[SEGMENT_STOP].size()>0; +} + +bool TimingData::HasDelays() const +{ + return this->allTimingSegments[SEGMENT_DELAY].size()>0; } bool TimingData::HasWarps() const @@ -1454,6 +1456,7 @@ class LunaTimingData: public Luna { public: static int HasStops( T* p, lua_State *L ) { lua_pushboolean(L, p->HasStops()); return 1; } + static int HasDelays( T* p, lua_State *L ) { lua_pushboolean(L, p->HasDelays()); return 1; } static int HasBPMChanges( T* p, lua_State *L ) { lua_pushboolean(L, p->HasBpmChanges()); return 1; } static int HasWarps( T* p, lua_State *L ) { lua_pushboolean(L, p->HasWarps()); return 1; } static int HasFakes( T* p, lua_State *L ) { lua_pushboolean(L, p->HasFakes()); return 1; } @@ -1548,6 +1551,7 @@ public: LunaTimingData() { ADD_METHOD( HasStops ); + ADD_METHOD( HasDelays ); ADD_METHOD( HasBPMChanges ); ADD_METHOD( HasWarps ); ADD_METHOD( HasFakes ); diff --git a/src/TimingData.h b/src/TimingData.h index d222308001..f62575701b 100644 --- a/src/TimingData.h +++ b/src/TimingData.h @@ -714,11 +714,14 @@ public: bool HasBpmChanges() const; /** * @brief View the TimingData to see if there is at least one stop at any point. - * - * For the purposes of this function, Stops and Delays are considered the same. * @return true if there is at least one stop, false otherwise. */ bool HasStops() const; + /** + * @brief View the TimingData to see if there is at least one delay at any point. + * @return true if there is at least one delay, false otherwise. + */ + bool HasDelays() const; /** * @brief View the TimingData to see if there is at least one warp at any point. * @return true if there is at least one warp, false otherwise.