From 7ffbc225f45a93fb707635e5327c392a00338e5a Mon Sep 17 00:00:00 2001 From: Andrew Livy Date: Sat, 23 May 2009 16:17:24 +0000 Subject: [PATCH] Adds a metric feature to force static backgrounds off during gameplay (useful if you just want videos and no static bg before the song) doesn't turn off the background at the end of the song yet (todo). --- stepmania/Themes/default/metrics.ini | 1 + stepmania/src/Background.cpp | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/stepmania/Themes/default/metrics.ini b/stepmania/Themes/default/metrics.ini index 2d15387af2..1633f79aa4 100644 --- a/stepmania/Themes/default/metrics.ini +++ b/stepmania/Themes/default/metrics.ini @@ -2332,6 +2332,7 @@ BottomEdge=SCREEN_BOTTOM BrightnessOverlayFadeCommand= ClampOutputPercent=0 ShowDancingCharacters=true +DontUseStaticBackground=false [Judgment] JudgmentW1Command=shadowlength,0;diffusealpha,1;zoom,1.3;linear,0.05;zoom,1;sleep,0.8;linear,0.1;zoomy,0.5;zoomx,2;diffusealpha,0;glowblink;effectperiod,0.05;effectcolor1,1,1,1,0;effectcolor2,1,1,1,0.8 diff --git a/stepmania/src/Background.cpp b/stepmania/src/Background.cpp index 7de990eda3..0b85f4d30e 100644 --- a/stepmania/src/Background.cpp +++ b/stepmania/src/Background.cpp @@ -30,6 +30,7 @@ static ThemeMetric BOTTOM_EDGE ("Background","BottomEdge"); #define RECT_BACKGROUND RectF (LEFT_EDGE,TOP_EDGE,RIGHT_EDGE,BOTTOM_EDGE) static ThemeMetric CLAMP_OUTPUT_PERCENT ("Background","ClampOutputPercent"); static ThemeMetric SHOW_DANCING_CHARACTERS ("Background","ShowDancingCharacters"); +static ThemeMetric DONT_USE_STATIC_BG ("Background","DontUseStaticBackground"); static Preference g_bShowDanger( "ShowDanger", true ); @@ -169,6 +170,12 @@ void BackgroundImpl::Init() m_bDangerAllWasVisible = false; m_StaticBackgroundDef = BackgroundDef(); + if( DONT_USE_STATIC_BG ) + { + m_StaticBackgroundDef.m_sColor1 = "0,0,0,0"; + m_StaticBackgroundDef.m_sColor2 = "0,0,0,0"; + } + // load transitions { ASSERT( m_mapNameToTransition.empty() ); @@ -582,6 +589,7 @@ void BackgroundImpl::LoadFromSong( const Song* pSong ) // end showing the static song background BackgroundChange change; + change.m_def = m_StaticBackgroundDef; change.m_fStartBeat = pSong->m_fLastBeat; layer.m_aBGChanges.push_back( change ); @@ -604,6 +612,7 @@ void BackgroundImpl::LoadFromSong( const Song* pSong ) { BackgroundChange change; change.m_def = m_StaticBackgroundDef; + change.m_fStartBeat = -10000; mainlayer.m_aBGChanges.insert( mainlayer.m_aBGChanges.begin(), change ); }