An attempt to make the arrows flash with the steps' timing. If it works then we can expand it to..... I don't know, lifebars?

This commit is contained in:
Thai Pangsakulyanont
2011-05-20 21:33:42 +07:00
parent 904e7ba2dd
commit ab178b1e65
3 changed files with 21 additions and 1 deletions
+8 -1
View File
@@ -18,6 +18,8 @@
static Preference<bool> g_bShowMasks("ShowMasks", false); static Preference<bool> g_bShowMasks("ShowMasks", false);
PlayerNumber Actor::m_ActivePlayerNumber = PLAYER_1;
/** /**
* @brief Set up a hidden Actor that won't be drawn. * @brief Set up a hidden Actor that won't be drawn.
* *
@@ -683,6 +685,11 @@ void Actor::UpdateInternal( float fDeltaTime )
m_fSecsIntoEffect = g_fCurrentBGMBeat; m_fSecsIntoEffect = g_fCurrentBGMBeat;
break; break;
case CLOCK_BGM_BEAT_PLAYER_ACTIVE:
m_fEffectDelta = g_vfCurrentBGMBeatPlayer[m_ActivePlayerNumber] - m_fSecsIntoEffect;
m_fSecsIntoEffect = g_vfCurrentBGMBeatPlayerNoOffset[m_ActivePlayerNumber];
break;
case CLOCK_BGM_BEAT_PLAYER1: case CLOCK_BGM_BEAT_PLAYER1:
m_fEffectDelta = g_vfCurrentBGMBeatPlayer[PLAYER_1] - m_fSecsIntoEffect; m_fEffectDelta = g_vfCurrentBGMBeatPlayer[PLAYER_1] - m_fSecsIntoEffect;
m_fSecsIntoEffect = g_vfCurrentBGMBeatPlayerNoOffset[PLAYER_1]; m_fSecsIntoEffect = g_vfCurrentBGMBeatPlayerNoOffset[PLAYER_1];
@@ -847,7 +854,7 @@ void Actor::SetEffectClockString( const RString &s )
{ {
if (s.EqualsNoCase("timer")) this->SetEffectClock( CLOCK_TIMER ); if (s.EqualsNoCase("timer")) this->SetEffectClock( CLOCK_TIMER );
if (s.EqualsNoCase("timerglobal")) this->SetEffectClock( CLOCK_TIMER_GLOBAL ); if (s.EqualsNoCase("timerglobal")) this->SetEffectClock( CLOCK_TIMER_GLOBAL );
else if(s.EqualsNoCase("beat")) this->SetEffectClock( CLOCK_BGM_BEAT ); else if(s.EqualsNoCase("beat")) this->SetEffectClock( CLOCK_BGM_BEAT_ACTIVE );
else if(s.EqualsNoCase("music")) this->SetEffectClock( CLOCK_BGM_TIME ); else if(s.EqualsNoCase("music")) this->SetEffectClock( CLOCK_BGM_TIME );
else if(s.EqualsNoCase("bgm")) this->SetEffectClock( CLOCK_BGM_BEAT ); // compat, deprecated else if(s.EqualsNoCase("bgm")) this->SetEffectClock( CLOCK_BGM_BEAT ); // compat, deprecated
else if(s.EqualsNoCase("musicnooffset"))this->SetEffectClock( CLOCK_BGM_TIME_NO_OFFSET ); else if(s.EqualsNoCase("musicnooffset"))this->SetEffectClock( CLOCK_BGM_TIME_NO_OFFSET );
+8
View File
@@ -113,6 +113,13 @@ public:
static void SetPlayerBGMBeat( PlayerNumber pn, float fBeat, float fBeatNoOffset ); static void SetPlayerBGMBeat( PlayerNumber pn, float fBeat, float fBeatNoOffset );
static void SetBGMLight( int iLightNumber, float fCabinetLights ); static void SetBGMLight( int iLightNumber, float fCabinetLights );
/**
* @brief The actively-drawing player number. This is used as a hack
* so that we don't need to tell each actor which player it belongs to.
* This is used to figure out the right player for "beat" effect clock.
*/
static PlayerNumber m_ActivePlayerNumber;
/** /**
* @brief The list of the different effects. * @brief The list of the different effects.
* *
@@ -135,6 +142,7 @@ public:
CLOCK_BGM_BEAT_NO_OFFSET, CLOCK_BGM_BEAT_NO_OFFSET,
CLOCK_BGM_BEAT_PLAYER1, CLOCK_BGM_BEAT_PLAYER1,
CLOCK_BGM_BEAT_PLAYER2, CLOCK_BGM_BEAT_PLAYER2,
CLOCK_BGM_BEAT_PLAYER_ACTIVE,
CLOCK_LIGHT_1 = 1000, CLOCK_LIGHT_1 = 1000,
CLOCK_LIGHT_LAST = 1100, CLOCK_LIGHT_LAST = 1100,
NUM_CLOCKS NUM_CLOCKS
+5
View File
@@ -19,6 +19,7 @@
#include "BackgroundUtil.h" #include "BackgroundUtil.h"
#include "Course.h" #include "Course.h"
#include "NoteData.h" #include "NoteData.h"
#include "Actor.h"
static ThemeMetric<bool> SHOW_BOARD( "NoteField", "ShowBoard" ); static ThemeMetric<bool> SHOW_BOARD( "NoteField", "ShowBoard" );
static ThemeMetric<bool> SHOW_BEAT_BARS( "NoteField", "ShowBeatBars" ); static ThemeMetric<bool> SHOW_BEAT_BARS( "NoteField", "ShowBeatBars" );
@@ -765,6 +766,10 @@ bool NoteField::IsOnScreen( float fBeat, int iCol, int iDrawDistanceAfterTargets
void NoteField::DrawPrimitives() void NoteField::DrawPrimitives()
{ {
// XXX Hack: Set Actor's active player number so the notes get the flashing that matches the steps.
Actor::m_ActivePlayerNumber = m_pPlayerState->m_PlayerNumber;
//LOG->Trace( "NoteField::DrawPrimitives()" ); //LOG->Trace( "NoteField::DrawPrimitives()" );
// This should be filled in on the first update. // This should be filled in on the first update.