[splittiming] Re-establish Actor code.
This commit is contained in:
+19
-2
@@ -34,6 +34,8 @@ REGISTER_ACTOR_CLASS_WITH_NAME( HiddenActor, Actor );
|
||||
|
||||
float Actor::g_fCurrentBGMTime = 0, Actor::g_fCurrentBGMBeat;
|
||||
float Actor::g_fCurrentBGMTimeNoOffset = 0, Actor::g_fCurrentBGMBeatNoOffset = 0;
|
||||
vector<float> Actor::g_vfCurrentBGMBeatPlayer(NUM_PlayerNumber, 0);
|
||||
vector<float> Actor::g_vfCurrentBGMBeatPlayerNoOffset(NUM_PlayerNumber, 0);
|
||||
|
||||
|
||||
Actor *Actor::Copy() const { return new Actor(*this); }
|
||||
@@ -68,6 +70,12 @@ void Actor::SetBGMTime( float fTime, float fBeat, float fTimeNoOffset, float fBe
|
||||
g_fCurrentBGMBeatNoOffset = fBeatNoOffset;
|
||||
}
|
||||
|
||||
void Actor::SetPlayerBGMBeat( PlayerNumber pn, float fBeat, float fBeatNoOffset )
|
||||
{
|
||||
g_vfCurrentBGMBeatPlayer[pn] = fBeat;
|
||||
g_vfCurrentBGMBeatPlayerNoOffset[pn] = fBeatNoOffset;
|
||||
}
|
||||
|
||||
void Actor::SetBGMLight( int iLightNumber, float fCabinetLights )
|
||||
{
|
||||
ASSERT( iLightNumber < NUM_CabinetLight );
|
||||
@@ -150,8 +158,7 @@ Actor::Actor()
|
||||
lua_setfield( L, -2, "ctx" );
|
||||
lua_pop( L, 1 );
|
||||
LUA->Release( L );
|
||||
|
||||
|
||||
|
||||
m_size = RageVector2( 1, 1 );
|
||||
InitState();
|
||||
m_pParent = NULL;
|
||||
@@ -676,6 +683,16 @@ void Actor::UpdateInternal( float fDeltaTime )
|
||||
m_fSecsIntoEffect = g_fCurrentBGMBeat;
|
||||
break;
|
||||
|
||||
case CLOCK_BGM_BEAT_PLAYER1:
|
||||
m_fEffectDelta = g_vfCurrentBGMBeatPlayer[PLAYER_1] - m_fSecsIntoEffect;
|
||||
m_fSecsIntoEffect = g_vfCurrentBGMBeatPlayerNoOffset[PLAYER_1];
|
||||
break;
|
||||
|
||||
case CLOCK_BGM_BEAT_PLAYER2:
|
||||
m_fEffectDelta = g_vfCurrentBGMBeatPlayer[PLAYER_2] - m_fSecsIntoEffect;
|
||||
m_fSecsIntoEffect = g_vfCurrentBGMBeatPlayerNoOffset[PLAYER_2];
|
||||
break;
|
||||
|
||||
case CLOCK_BGM_TIME:
|
||||
m_fEffectDelta = g_fCurrentBGMTime - m_fSecsIntoEffect;
|
||||
m_fSecsIntoEffect = g_fCurrentBGMTime;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef ACTOR_H
|
||||
#define ACTOR_H
|
||||
|
||||
#include "PlayerNumber.h"
|
||||
#include "RageTypes.h"
|
||||
#include "RageUtil_AutoPtr.h"
|
||||
#include "LuaReference.h"
|
||||
@@ -109,6 +110,7 @@ public:
|
||||
virtual void LoadFromNode( const XNode* pNode );
|
||||
|
||||
static void SetBGMTime( float fTime, float fBeat, float fTimeNoOffset, float fBeatNoOffset );
|
||||
static void SetPlayerBGMBeat( PlayerNumber pn, float fBeat, float fBeatNoOffset );
|
||||
static void SetBGMLight( int iLightNumber, float fCabinetLights );
|
||||
|
||||
/**
|
||||
@@ -131,6 +133,8 @@ public:
|
||||
CLOCK_BGM_BEAT,
|
||||
CLOCK_BGM_TIME_NO_OFFSET,
|
||||
CLOCK_BGM_BEAT_NO_OFFSET,
|
||||
CLOCK_BGM_BEAT_PLAYER1,
|
||||
CLOCK_BGM_BEAT_PLAYER2,
|
||||
CLOCK_LIGHT_1 = 1000,
|
||||
CLOCK_LIGHT_LAST = 1100,
|
||||
NUM_CLOCKS
|
||||
@@ -713,6 +717,8 @@ protected:
|
||||
// global state
|
||||
static float g_fCurrentBGMTime, g_fCurrentBGMBeat;
|
||||
static float g_fCurrentBGMTimeNoOffset, g_fCurrentBGMBeatNoOffset;
|
||||
static vector<float> g_vfCurrentBGMBeatPlayer;
|
||||
static vector<float> g_vfCurrentBGMBeatPlayerNoOffset;
|
||||
|
||||
private:
|
||||
// commands
|
||||
|
||||
+1
-1
@@ -953,7 +953,7 @@ void GameState::UpdateSongPosition( float fPositionSeconds, const TimingData &ti
|
||||
if( m_pCurSteps[pn] )
|
||||
{
|
||||
m_pPlayerState[pn]->m_Position.UpdateSongPosition( fPositionSeconds, m_pCurSteps[pn]->m_Timing, timestamp );
|
||||
// Actor::SetPlayerBGMBeat( pn, m_pPlayerState[pn]->m_Position.m_fSongBeatVisible, m_pPlayerState[pn]->m_Position.m_fSongBeatNoOffset );
|
||||
Actor::SetPlayerBGMBeat( pn, m_pPlayerState[pn]->m_Position.m_fSongBeatVisible, m_pPlayerState[pn]->m_Position.m_fSongBeatNoOffset );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user