diff --git a/Docs/Changelog_sm5.txt b/Docs/Changelog_sm5.txt index 6689c3b902..9ad07b0294 100644 --- a/Docs/Changelog_sm5.txt +++ b/Docs/Changelog_sm5.txt @@ -5,10 +5,15 @@ from StepMania 4 alpha 5 to sm-ssc v1.2.5, see Changelog_sm-ssc.txt. ________________________________________________________________________________ ================================================================================ -StepMania 5.0 ????????? | 20110??? +StepMania 5.0 Preview 2 | 20110??? -------------------------------------------------------------------------------- -2011/05/31 +2011/06/02 +---------- +* [BPMDisplay] Added SetFromSteps Lua binding. [AJ] + +2011/06/01 +---------- * [TimingData] Added the HasScrollChanges lua binding. [Wolfman2000] 2011/05/31 @@ -16,6 +21,7 @@ StepMania 5.0 ????????? | 20110??? * [Player] Added the BattleRaveMirror metric. This determines if Battle and Rave mode will have the two players with mirrored charts or not. By default, this is set to true, preserving the ITG style behavior. [Wolfman2000] +* [TimingData] Added the HasScrollChanges lua binding. [Wolfman2000] ================================================================================ StepMania 5.0 Preview 1 | 20110529 diff --git a/Docs/Luadoc/LuaDocumentation.xml b/Docs/Luadoc/LuaDocumentation.xml index c8156deda0..0f01eb1189 100644 --- a/Docs/Luadoc/LuaDocumentation.xml +++ b/Docs/Luadoc/LuaDocumentation.xml @@ -1273,6 +1273,9 @@ Sets the BPMDisplay from the specified Song. + + Sets the BPMDisplay from the specified Steps. + diff --git a/Docs/Luadoc/favicon.ico b/Docs/Luadoc/favicon.ico index 5a530ab403..95519364bc 100644 Binary files a/Docs/Luadoc/favicon.ico and b/Docs/Luadoc/favicon.ico differ diff --git a/src/BPMDisplay.cpp b/src/BPMDisplay.cpp index bdeb805d52..a891f7161f 100644 --- a/src/BPMDisplay.cpp +++ b/src/BPMDisplay.cpp @@ -9,6 +9,7 @@ #include "CommonMetrics.h" #include "LocalizedString.h" #include "Song.h" +#include "Steps.h" #include @@ -198,6 +199,17 @@ void BPMDisplay::SetBpmFromSong( const Song* pSong ) } } +void BPMDisplay::SetBpmFromSteps( const Steps* pSteps ) +{ + ASSERT( pSteps ); + DisplayBpms bpms; + float fMinBPM, fMaxBPM; + pSteps->m_Timing.GetActualBPM( fMinBPM, fMaxBPM ); + bpms.Add( fMinBPM ); + bpms.Add( fMaxBPM ); + m_fCycleTime = 1.0f; +} + void BPMDisplay::SetBpmFromCourse( const Course* pCourse ) { ASSERT( pCourse ); @@ -307,6 +319,16 @@ public: } return 0; } + static int SetFromSteps( T* p, lua_State *L ) + { + if( lua_isnil(L,1) ) { p->NoBPM(); } + else + { + const Steps* pSteps = Luna::check( L, 1, true ); + p->SetBpmFromSteps(pSteps); + } + return 0; + } static int SetFromCourse( T* p, lua_State *L ) { if( lua_isnil(L,1) ) { p->NoBPM(); } @@ -323,6 +345,7 @@ public: { ADD_METHOD( SetFromGameState ); ADD_METHOD( SetFromSong ); + ADD_METHOD( SetFromSteps ); ADD_METHOD( SetFromCourse ); ADD_METHOD( GetText ); } diff --git a/src/BPMDisplay.h b/src/BPMDisplay.h index b27f96408a..d868ab23be 100644 --- a/src/BPMDisplay.h +++ b/src/BPMDisplay.h @@ -6,6 +6,7 @@ #include "ThemeMetric.h" #include "LocalizedString.h" class Song; +class Steps; class Course; struct DisplayBpms; @@ -30,6 +31,11 @@ public: * @param pSong the song in question. */ void SetBpmFromSong( const Song* pSong ); + /** + * @brief Use the BPM[s] from a steps. + * @param pSteps the steps in question. + */ + void SetBpmFromSteps( const Steps* pSteps ); /** * @brief Use the BPM[s] from a course. * @param pCourse the course in question.