Added theme metrics for controlling random bg behavior.
This commit is contained in:
@@ -4,6 +4,18 @@ The StepMania 5 Changelog covers all post-sm-ssc changes. For a list of changes
|
||||
from StepMania 4 alpha 5 to sm-ssc v1.2.5, see Changelog_sm-ssc.txt.
|
||||
________________________________________________________________________________
|
||||
|
||||
2015/07/02
|
||||
----------
|
||||
* [Gameplay] Random background video behavior is now controlled by these
|
||||
three metrics in the Background section:
|
||||
RandomBGStartBeat sets the beat of the music the first random bg occurs on.
|
||||
RandomBGChangeMeasures sets the number of measures between changes.
|
||||
RandomBGChangesWhenBPMChangesAtMeasureStart toggles the behavior in its name.
|
||||
|
||||
================================================================================
|
||||
StepMania 5.0.9 | 20150520
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
2015/06/10
|
||||
----------
|
||||
* [global] get_music_file_length lua function added. [kyzentun]
|
||||
|
||||
@@ -239,6 +239,9 @@ LeftEdge=SCREEN_LEFT
|
||||
RightEdge=SCREEN_RIGHT
|
||||
TopEdge=SCREEN_TOP
|
||||
BottomEdge=SCREEN_BOTTOM
|
||||
RandomBGStartBeat=-1000
|
||||
RandomBGChangeMeasures=1
|
||||
RandomBGChangesWhenBPMChangesAtMeasureStart=true
|
||||
|
||||
[Banner]
|
||||
# Scroll stuff when you roll over it, DDR Extreme style.
|
||||
|
||||
+16
-2
@@ -31,6 +31,9 @@ static ThemeMetric<float> BOTTOM_EDGE ("Background","BottomEdge");
|
||||
static ThemeMetric<float> CLAMP_OUTPUT_PERCENT ("Background","ClampOutputPercent");
|
||||
static ThemeMetric<bool> SHOW_DANCING_CHARACTERS ("Background","ShowDancingCharacters");
|
||||
static ThemeMetric<bool> USE_STATIC_BG ("Background","UseStaticBackground");
|
||||
static ThemeMetric<float> RAND_BG_START_BEAT("Background", "RandomBGStartBeat");
|
||||
static ThemeMetric<float> RAND_BG_CHANGE_MEASURES("Background", "RandomBGChangeMeasures");
|
||||
static ThemeMetric<bool> RAND_BG_CHANGES_WHEN_BPM_CHANGES("Background", "RandomBGChangesWhenBPMChangesAtMeasureStart");
|
||||
|
||||
|
||||
static Preference<bool> g_bShowDanger( "ShowDanger", true );
|
||||
@@ -440,9 +443,10 @@ void BackgroundImpl::LoadFromRandom( float fFirstBeat, float fEndBeat, const Bac
|
||||
int iSegmentEndRow = (i + 1 == tSigs.size()) ? iEndRow : tSigs[i+1]->GetRow();
|
||||
|
||||
|
||||
for(int j=max(ts->GetRow(),iStartRow);
|
||||
int time_signature_start= max(ts->GetRow(),iStartRow);
|
||||
for(int j= time_signature_start;
|
||||
j<min(iEndRow,iSegmentEndRow);
|
||||
j+=4*ts->GetNoteRowsPerMeasure())
|
||||
j+= RAND_BG_CHANGE_MEASURES * ts->GetNoteRowsPerMeasure())
|
||||
{
|
||||
// Don't fade. It causes frame rate dip, especially on slower machines.
|
||||
BackgroundDef bd = m_Layer[0].CreateRandomBGA(m_pSong,
|
||||
@@ -452,12 +456,21 @@ void BackgroundImpl::LoadFromRandom( float fFirstBeat, float fEndBeat, const Bac
|
||||
{
|
||||
BackgroundChange c = change;
|
||||
c.m_def = bd;
|
||||
if(j == time_signature_start && i == 0)
|
||||
{
|
||||
c.m_fStartBeat = RAND_BG_START_BEAT;
|
||||
}
|
||||
else
|
||||
{
|
||||
c.m_fStartBeat = NoteRowToBeat(j);
|
||||
}
|
||||
m_Layer[0].m_aBGChanges.push_back( c );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(RAND_BG_CHANGES_WHEN_BPM_CHANGES)
|
||||
{
|
||||
// change BG every BPM change that is at the beginning of a measure
|
||||
const vector<TimingSegment *> &bpms = timing.GetTimingSegments(SEGMENT_BPM);
|
||||
for( unsigned i=0; i<bpms.size(); i++ )
|
||||
@@ -492,6 +505,7 @@ void BackgroundImpl::LoadFromRandom( float fFirstBeat, float fEndBeat, const Bac
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void BackgroundImpl::LoadFromSong( const Song* pSong )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user