Skip to content

Commit

Permalink
Copy over changes from last beat to first beat calculations. Without …
Browse files Browse the repository at this point in the history
…this lowering cmod would cause arrows to disappear before leaving the screen.
  • Loading branch information
xwidghet committed Nov 5, 2016
1 parent 26b8064 commit 28cce6d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/NoteField.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -628,21 +628,29 @@ float FindFirstDisplayedBeat( const PlayerState* pPlayerState, int iDrawDistance
{
float fFirstBeatToDraw = pPlayerState->GetDisplayedPosition().m_fSongBeatVisible;

// TODO: Account for M Mods...
static float lastKnownBPS = 0;
static float lastKnownRate = 0;
static float lastKnownXSpeed = 0;
static float lastKnownCSpeed = 0;
static float pixelsPerBeat = 0;

float currentBPS = pPlayerState->GetDisplayedPosition().m_fCurBPS;
float currentRate = GAMESTATE->m_SongOptions.GetCurrent().m_fMusicRate;
float currentXSpace = pPlayerState->m_PlayerOptions.GetCurrent().m_fScrollSpeed;
float currentCSpace = pPlayerState->m_PlayerOptions.GetCurrent().m_fScrollBPM;

// Song or BPM changed
if (lastKnownBPS != currentBPS || lastKnownRate != currentRate)
if (lastKnownBPS != currentBPS || lastKnownRate != currentRate
|| lastKnownCSpeed != currentCSpace || lastKnownXSpeed != currentXSpace)
{
bool bIsPastPeakYOffset;
float fPeakYOffset;

lastKnownBPS = currentBPS;
lastKnownRate = currentRate;
lastKnownXSpeed = currentXSpace;
lastKnownCSpeed = currentCSpace;

float lastBeatElapsedTime = pPlayerState->GetDisplayedTiming().ElapsedTimesAtAllRows.at(pPlayerState->GetDisplayedTiming().ElapsedTimesAtAllRows.size() - 1);

Expand Down

0 comments on commit 28cce6d

Please sign in to comment.