metric to specify what brightness to fade the background from
This commit is contained in:
@@ -906,6 +906,12 @@ NextScreenOni=ScreenEvaluationOni
|
|||||||
NextScreenEndless=ScreenEvaluationEndless
|
NextScreenEndless=ScreenEvaluationEndless
|
||||||
NextScreenBattle=ScreenEvaluationBattle
|
NextScreenBattle=ScreenEvaluationBattle
|
||||||
NextScreenRave=ScreenEvaluationRave
|
NextScreenRave=ScreenEvaluationRave
|
||||||
|
InitialBackgroundBrightnessArcade=1
|
||||||
|
InitialBackgroundBrightnessNonstop=1
|
||||||
|
InitialBackgroundBrightnessOni=1
|
||||||
|
InitialBackgroundBrightnessEndless=1
|
||||||
|
InitialBackgroundBrightnessBattle=1
|
||||||
|
InitialBackgroundBrightnessRave=1
|
||||||
BPMDisplayX=999 // don't show by default
|
BPMDisplayX=999 // don't show by default
|
||||||
BPMDisplayY=999
|
BPMDisplayY=999
|
||||||
BPMDisplayOnCommand=zoom,0
|
BPMDisplayOnCommand=zoom,0
|
||||||
|
|||||||
@@ -663,7 +663,10 @@ BrightnessOverlay::BrightnessOverlay()
|
|||||||
void BrightnessOverlay::Update( float fDeltaTime )
|
void BrightnessOverlay::Update( float fDeltaTime )
|
||||||
{
|
{
|
||||||
ActorFrame::Update( fDeltaTime );
|
ActorFrame::Update( fDeltaTime );
|
||||||
SetBackgrounds();
|
/* If we're actually playing, then we're past fades, etc; update the background
|
||||||
|
* brightness to follow Cover. */
|
||||||
|
if( GAMESTATE->m_bPastHereWeGo )
|
||||||
|
SetBackgrounds();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BrightnessOverlay::SetBackgrounds()
|
void BrightnessOverlay::SetBackgrounds()
|
||||||
@@ -688,18 +691,17 @@ void BrightnessOverlay::SetBackgrounds()
|
|||||||
m_quadBGBrightnessFade.SetDiffuseRightEdge( RightColor );
|
m_quadBGBrightnessFade.SetDiffuseRightEdge( RightColor );
|
||||||
}
|
}
|
||||||
|
|
||||||
void BrightnessOverlay::FadeIn()
|
void BrightnessOverlay::Set( float fBrightness )
|
||||||
{
|
{
|
||||||
FOREACH_PlayerNumber(pn)
|
FOREACH_PlayerNumber(pn)
|
||||||
m_quadBGBrightness[pn].BeginTweening( 0.5f );
|
m_quadBGBrightness[pn].SetDiffuse( RageColor(0,0,0,1-fBrightness) );
|
||||||
SetBackgrounds();
|
m_quadBGBrightnessFade.SetDiffuse( RageColor(0,0,0,1-fBrightness) );
|
||||||
}
|
}
|
||||||
|
|
||||||
void BrightnessOverlay::FadeOut()
|
void BrightnessOverlay::FadeToActualBrightness()
|
||||||
{
|
{
|
||||||
FOREACH_PlayerNumber(pn)
|
FOREACH_PlayerNumber(pn)
|
||||||
{
|
|
||||||
m_quadBGBrightness[pn].BeginTweening( 0.5f );
|
m_quadBGBrightness[pn].BeginTweening( 0.5f );
|
||||||
m_quadBGBrightness[pn].SetDiffuse( RageColor(0,0,0,1-0.5f) );
|
m_quadBGBrightnessFade.BeginTweening( 0.5f );
|
||||||
}
|
SetBackgrounds();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,8 +31,8 @@ public:
|
|||||||
BrightnessOverlay();
|
BrightnessOverlay();
|
||||||
void Update( float fDeltaTime );
|
void Update( float fDeltaTime );
|
||||||
|
|
||||||
void FadeIn();
|
void FadeToActualBrightness();
|
||||||
void FadeOut();
|
void Set( float fBrightness );
|
||||||
};
|
};
|
||||||
|
|
||||||
class Background : public ActorFrame
|
class Background : public ActorFrame
|
||||||
@@ -47,8 +47,8 @@ public:
|
|||||||
virtual void Update( float fDeltaTime );
|
virtual void Update( float fDeltaTime );
|
||||||
virtual void DrawPrimitives();
|
virtual void DrawPrimitives();
|
||||||
|
|
||||||
void FadeIn() { m_Brightness.FadeIn(); }
|
void FadeToActualBrightness() { m_Brightness.FadeToActualBrightness(); }
|
||||||
void FadeOut() { m_Brightness.FadeOut(); }
|
void SetBrightness( float fBrightness ) { m_Brightness.Set(fBrightness); } /* overrides pref and Cover */
|
||||||
|
|
||||||
DancingCharacters* GetDancingCharacters() { return m_pDancingCharacters; };
|
DancingCharacters* GetDancingCharacters() { return m_pDancingCharacters; };
|
||||||
|
|
||||||
@@ -62,7 +62,6 @@ protected:
|
|||||||
bool IsDangerAllVisible();
|
bool IsDangerAllVisible();
|
||||||
bool IsDeadPlayerVisible( PlayerNumber pn );
|
bool IsDeadPlayerVisible( PlayerNumber pn );
|
||||||
void UpdateCurBGChange( float fCurrentTime );
|
void UpdateCurBGChange( float fCurrentTime );
|
||||||
void SetBackgrounds();
|
|
||||||
|
|
||||||
DancingCharacters* m_pDancingCharacters;
|
DancingCharacters* m_pDancingCharacters;
|
||||||
|
|
||||||
|
|||||||
@@ -60,6 +60,9 @@
|
|||||||
#define EVAL_ON_FAIL THEME->GetMetricB("ScreenGameplay","ShowEvaluationOnFail")
|
#define EVAL_ON_FAIL THEME->GetMetricB("ScreenGameplay","ShowEvaluationOnFail")
|
||||||
#define SHOW_SCORE_IN_RAVE THEME->GetMetricB("ScreenGameplay","ShowScoreInRave")
|
#define SHOW_SCORE_IN_RAVE THEME->GetMetricB("ScreenGameplay","ShowScoreInRave")
|
||||||
#define SONG_POSITION_METER_WIDTH THEME->GetMetricF("ScreenGameplay","SongPositionMeterWidth")
|
#define SONG_POSITION_METER_WIDTH THEME->GetMetricF("ScreenGameplay","SongPositionMeterWidth")
|
||||||
|
/* XXX: This is ugly; most people don't need to override this per-mode. This will
|
||||||
|
* go away eventually, once metrics can redirect to Lua calls. */
|
||||||
|
#define INITIAL_BACKGROUND_BRIGHTNESS( play_mode ) THEME->GetMetricF("ScreenGameplay","InitialBackgroundBrightness"+Capitalize(PlayModeToString(play_mode)))
|
||||||
|
|
||||||
static CachedThemeMetricF SECONDS_BETWEEN_COMMENTS ("ScreenGameplay","SecondsBetweenComments");
|
static CachedThemeMetricF SECONDS_BETWEEN_COMMENTS ("ScreenGameplay","SecondsBetweenComments");
|
||||||
static CachedThemeMetricF TICK_EARLY_SECONDS ("ScreenGameplay","TickEarlySeconds");
|
static CachedThemeMetricF TICK_EARLY_SECONDS ("ScreenGameplay","TickEarlySeconds");
|
||||||
@@ -1015,6 +1018,7 @@ void ScreenGameplay::LoadNextSong()
|
|||||||
{
|
{
|
||||||
/* BeginnerHelper disabled/failed to load. */
|
/* BeginnerHelper disabled/failed to load. */
|
||||||
m_Background.LoadFromSong( GAMESTATE->m_pCurSong );
|
m_Background.LoadFromSong( GAMESTATE->m_pCurSong );
|
||||||
|
m_Background.SetBrightness( INITIAL_BACKGROUND_BRIGHTNESS(GAMESTATE->m_PlayMode) );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_Foreground.LoadFromSong( GAMESTATE->m_pCurSong );
|
m_Foreground.LoadFromSong( GAMESTATE->m_pCurSong );
|
||||||
@@ -1902,7 +1906,7 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
|
|||||||
switch( SM )
|
switch( SM )
|
||||||
{
|
{
|
||||||
case SM_PlayReady:
|
case SM_PlayReady:
|
||||||
m_Background.FadeIn();
|
m_Background.FadeToActualBrightness();
|
||||||
SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo("gameplay ready") );
|
SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo("gameplay ready") );
|
||||||
m_Ready.StartTransitioning( SM_PlayGo );
|
m_Ready.StartTransitioning( SM_PlayGo );
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user