[splittiming] m_Position needed. (50)
This commit is contained in:
+1
-1
@@ -32,7 +32,7 @@ void Attack::GetRealtimeAttackBeats( const Song *pSong, const PlayerState* pPlay
|
||||
ASSERT( pSong );
|
||||
|
||||
/* If reasonable, push the attack forward 8 beats so that notes on screen don't change suddenly. */
|
||||
fStartBeat = min( GAMESTATE->m_fSongBeat+8, pPlayerState->m_fLastDrawnBeat );
|
||||
fStartBeat = min( GAMESTATE->m_Position.m_fSongBeat+8, pPlayerState->m_fLastDrawnBeat );
|
||||
fStartBeat = truncf(fStartBeat)+1;
|
||||
|
||||
const TimingData &timing = pSong->m_SongTiming;
|
||||
|
||||
+2
-2
@@ -800,9 +800,9 @@ void BackgroundImpl::Update( float fDeltaTime )
|
||||
FOREACH_BackgroundLayer( i )
|
||||
{
|
||||
Layer &layer = m_Layer[i];
|
||||
layer.UpdateCurBGChange( m_pSong, m_fLastMusicSeconds, GAMESTATE->m_fMusicSeconds, m_mapNameToTransition );
|
||||
layer.UpdateCurBGChange( m_pSong, m_fLastMusicSeconds, GAMESTATE->m_Position.m_fMusicSeconds, m_mapNameToTransition );
|
||||
}
|
||||
m_fLastMusicSeconds = GAMESTATE->m_fMusicSeconds;
|
||||
m_fLastMusicSeconds = GAMESTATE->m_Position.m_fMusicSeconds;
|
||||
}
|
||||
|
||||
void BackgroundImpl::DrawPrimitives()
|
||||
|
||||
@@ -175,7 +175,7 @@ int Neg1OrPos1() { return RandomInt( 2 ) ? -1 : +1; }
|
||||
|
||||
void DancingCharacters::Update( float fDelta )
|
||||
{
|
||||
if( GAMESTATE->m_bFreeze || GAMESTATE->m_bDelay )
|
||||
if( GAMESTATE->m_Position.m_bFreeze || GAMESTATE->m_Position.m_bDelay )
|
||||
{
|
||||
// spin the camera Matrix-style
|
||||
m_CameraPanYStart += fDelta*40;
|
||||
@@ -184,7 +184,7 @@ void DancingCharacters::Update( float fDelta )
|
||||
else
|
||||
{
|
||||
// make the characters move
|
||||
float fBPM = GAMESTATE->m_fCurBPS*60;
|
||||
float fBPM = GAMESTATE->m_Position.m_fCurBPS*60;
|
||||
float fUpdateScale = SCALE( fBPM, 60.f, 300.f, 0.75f, 1.5f );
|
||||
CLAMP( fUpdateScale, 0.75f, 1.5f );
|
||||
|
||||
@@ -209,8 +209,8 @@ void DancingCharacters::Update( float fDelta )
|
||||
}
|
||||
bWasGameplayStarting = bGameplayStarting;
|
||||
|
||||
static float fLastBeat = GAMESTATE->m_fSongBeat;
|
||||
float fThisBeat = GAMESTATE->m_fSongBeat;
|
||||
static float fLastBeat = GAMESTATE->m_Position.m_fSongBeat;
|
||||
float fThisBeat = GAMESTATE->m_Position.m_fSongBeat;
|
||||
if( fLastBeat < GAMESTATE->m_pCurSong->m_fFirstBeat &&
|
||||
fThisBeat >= GAMESTATE->m_pCurSong->m_fFirstBeat )
|
||||
{
|
||||
@@ -220,7 +220,7 @@ void DancingCharacters::Update( float fDelta )
|
||||
fLastBeat = fThisBeat;
|
||||
|
||||
// time for a new sweep?
|
||||
if( GAMESTATE->m_fSongBeat > m_fThisCameraEndBeat )
|
||||
if( GAMESTATE->m_Position.m_fSongBeat > m_fThisCameraEndBeat )
|
||||
{
|
||||
if( RandomInt(6) >= 4 )
|
||||
{
|
||||
@@ -248,7 +248,7 @@ void DancingCharacters::Update( float fDelta )
|
||||
m_fLookAtHeight = CAMERA_STILL_LOOK_AT_HEIGHT;
|
||||
}
|
||||
|
||||
int iCurBeat = (int)GAMESTATE->m_fSongBeat;
|
||||
int iCurBeat = (int)GAMESTATE->m_Position.m_fSongBeat;
|
||||
iCurBeat -= iCurBeat%8;
|
||||
|
||||
m_fThisCameraStartBeat = (float) iCurBeat;
|
||||
@@ -313,7 +313,7 @@ void DancingCharacters::DrawPrimitives()
|
||||
if(m_fThisCameraStartBeat == m_fThisCameraEndBeat)
|
||||
fPercentIntoSweep = 0;
|
||||
else
|
||||
fPercentIntoSweep = SCALE(GAMESTATE->m_fSongBeat, m_fThisCameraStartBeat, m_fThisCameraEndBeat, 0.f, 1.f );
|
||||
fPercentIntoSweep = SCALE(GAMESTATE->m_Position.m_fSongBeat, m_fThisCameraStartBeat, m_fThisCameraEndBeat, 0.f, 1.f );
|
||||
float fCameraPanY = SCALE( fPercentIntoSweep, 0.f, 1.f, m_CameraPanYStart, m_CameraPanYEnd );
|
||||
float fCameraHeight = SCALE( fPercentIntoSweep, 0.f, 1.f, m_fCameraHeightStart, m_fCameraHeightEnd );
|
||||
|
||||
|
||||
+5
-5
@@ -65,7 +65,7 @@ void Foreground::Update( float fDeltaTime )
|
||||
{
|
||||
LoadedBGA &bga = m_BGAnimations[i];
|
||||
|
||||
if( GAMESTATE->m_fSongBeat < bga.m_fStartBeat )
|
||||
if( GAMESTATE->m_Position.m_fSongBeat < bga.m_fStartBeat )
|
||||
{
|
||||
// The animation hasn't started yet.
|
||||
continue;
|
||||
@@ -83,11 +83,11 @@ void Foreground::Update( float fDeltaTime )
|
||||
bga.m_bga->PlayCommand( "On" );
|
||||
|
||||
const float fStartSecond = m_pSong->m_SongTiming.GetElapsedTimeFromBeat( bga.m_fStartBeat );
|
||||
lDeltaTime = GAMESTATE->m_fMusicSeconds - fStartSecond;
|
||||
lDeltaTime = GAMESTATE->m_Position.m_fMusicSeconds - fStartSecond;
|
||||
}
|
||||
else
|
||||
{
|
||||
lDeltaTime = GAMESTATE->m_fMusicSeconds - m_fLastMusicSeconds;
|
||||
lDeltaTime = GAMESTATE->m_Position.m_fMusicSeconds - m_fLastMusicSeconds;
|
||||
}
|
||||
|
||||
// This shouldn't go down, but be safe:
|
||||
@@ -95,7 +95,7 @@ void Foreground::Update( float fDeltaTime )
|
||||
|
||||
bga.m_bga->Update( lDeltaTime / fRate );
|
||||
|
||||
if( GAMESTATE->m_fSongBeat > bga.m_fStopBeat )
|
||||
if( GAMESTATE->m_Position.m_fSongBeat > bga.m_fStopBeat )
|
||||
{
|
||||
// Finished.
|
||||
bga.m_bga->SetVisible( false );
|
||||
@@ -104,7 +104,7 @@ void Foreground::Update( float fDeltaTime )
|
||||
}
|
||||
}
|
||||
|
||||
m_fLastMusicSeconds = GAMESTATE->m_fMusicSeconds;
|
||||
m_fLastMusicSeconds = GAMESTATE->m_Position.m_fMusicSeconds;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -230,12 +230,12 @@ void LightsManager::Update( float fDeltaTime )
|
||||
static float fLastBeat;
|
||||
static int iLight;
|
||||
|
||||
if( fracf(GAMESTATE->m_fLightSongBeat) < fracf(fLastBeat) )
|
||||
if( fracf(GAMESTATE->m_Position.m_fLightSongBeat) < fracf(fLastBeat) )
|
||||
{
|
||||
++iLight;
|
||||
wrap( iLight, 4 );
|
||||
}
|
||||
fLastBeat = GAMESTATE->m_fLightSongBeat;
|
||||
fLastBeat = GAMESTATE->m_Position.m_fLightSongBeat;
|
||||
switch( iLight )
|
||||
{
|
||||
case 0: m_LightsState.m_bCabinetLights[LIGHT_MARQUEE_UP_LEFT] = true; break;
|
||||
@@ -405,7 +405,7 @@ void LightsManager::Update( float fDeltaTime )
|
||||
// If not joined, has enough credits, and not too late to join, then
|
||||
// blink the menu buttons rapidly so they'll press Start
|
||||
{
|
||||
int iBeat = (int)(GAMESTATE->m_fLightSongBeat*4);
|
||||
int iBeat = (int)(GAMESTATE->m_Position.m_fLightSongBeat*4);
|
||||
bool bBlinkOn = (iBeat%2)==0;
|
||||
FOREACH_PlayerNumber( pn )
|
||||
{
|
||||
|
||||
@@ -41,9 +41,9 @@ void LyricDisplay::Update( float fDeltaTime )
|
||||
return;
|
||||
|
||||
// If the song has changed (in a course), reset.
|
||||
if( GAMESTATE->m_fMusicSeconds < m_fLastSecond )
|
||||
if( GAMESTATE->m_Position.m_fMusicSeconds < m_fLastSecond )
|
||||
Init();
|
||||
m_fLastSecond = GAMESTATE->m_fMusicSeconds;
|
||||
m_fLastSecond = GAMESTATE->m_Position.m_fMusicSeconds;
|
||||
|
||||
if( m_iCurLyricNumber >= GAMESTATE->m_pCurSong->m_LyricSegments.size() )
|
||||
return;
|
||||
@@ -51,7 +51,7 @@ void LyricDisplay::Update( float fDeltaTime )
|
||||
const Song *pSong = GAMESTATE->m_pCurSong;
|
||||
const float fStartTime = (pSong->m_LyricSegments[m_iCurLyricNumber].m_fStartTime) - IN_LENGTH.GetValue();
|
||||
|
||||
if( GAMESTATE->m_fMusicSeconds < fStartTime )
|
||||
if( GAMESTATE->m_Position.m_fMusicSeconds < fStartTime )
|
||||
return;
|
||||
|
||||
// Clamp this lyric to the beginning of the next or the end of the music.
|
||||
|
||||
@@ -61,7 +61,7 @@ void ScreenNameEntry::ScrollingText::Init( const RString &sName, const vector<fl
|
||||
|
||||
void ScreenNameEntry::ScrollingText::DrawPrimitives()
|
||||
{
|
||||
const float fFakeBeat = GAMESTATE->m_fSongBeat;
|
||||
const float fFakeBeat = GAMESTATE->m_Position.m_fSongBeat;
|
||||
const size_t iClosestIndex = lrintf( fFakeBeat ) % CHARS_CHOICES.size();
|
||||
const float fClosestYOffset = GetClosestCharYOffset( fFakeBeat );
|
||||
|
||||
@@ -325,7 +325,7 @@ void ScreenNameEntry::Update( float fDelta )
|
||||
SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo("name entry") );
|
||||
|
||||
m_fFakeBeat += fDelta * FAKE_BEATS_PER_SEC;
|
||||
GAMESTATE->m_fSongBeat = m_fFakeBeat;
|
||||
GAMESTATE->m_Position.m_fSongBeat = m_fFakeBeat;
|
||||
|
||||
ScreenWithMenuElements::Update(fDelta);
|
||||
}
|
||||
|
||||
@@ -221,7 +221,7 @@ bool ScreenSyncOverlay::OverlayInput( const InputEventPlus &input )
|
||||
}
|
||||
if( GAMESTATE->m_pCurSong != NULL )
|
||||
{
|
||||
BPMSegment& seg = GAMESTATE->m_pCurSong->m_SongTiming.GetBPMSegmentAtBeat( GAMESTATE->m_fSongBeat );
|
||||
BPMSegment& seg = GAMESTATE->m_pCurSong->m_SongTiming.GetBPMSegmentAtBeat( GAMESTATE->m_Position.m_fSongBeat );
|
||||
seg.m_fBPS += fDelta;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ void SoundEffectControl::Update( float fDeltaTime )
|
||||
|
||||
if( LOCK_TO_HOLD )
|
||||
{
|
||||
int iRow = BeatToNoteRow( GAMESTATE->m_fSongBeat );
|
||||
int iRow = BeatToNoteRow( GAMESTATE->m_Position.m_fSongBeat );
|
||||
int iHoldsHeld, iHoldsLetGo;
|
||||
HoldsBeingHeld( iRow, iHoldsHeld, iHoldsLetGo );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user