track fOverlappedTime for hold notes
This commit is contained in:
@@ -27,7 +27,7 @@ struct TapNoteResult
|
|||||||
|
|
||||||
struct HoldNoteResult
|
struct HoldNoteResult
|
||||||
{
|
{
|
||||||
HoldNoteResult() : hns(HNS_None), fLife(1.f), iLastHeldRow(0), bHeld(false), bActive(false) { }
|
HoldNoteResult() : hns(HNS_None), fLife(1.f), fOverlappedTime(0), iLastHeldRow(0), bHeld(false), bActive(false) { }
|
||||||
float GetLastHeldBeat() const;
|
float GetLastHeldBeat() const;
|
||||||
|
|
||||||
HoldNoteScore hns;
|
HoldNoteScore hns;
|
||||||
@@ -38,6 +38,10 @@ struct HoldNoteResult
|
|||||||
* If the life is > 0.0 when the HoldNote ends, then m_HoldScore becomes HNS_Held. */
|
* If the life is > 0.0 when the HoldNote ends, then m_HoldScore becomes HNS_Held. */
|
||||||
float fLife;
|
float fLife;
|
||||||
|
|
||||||
|
/* The number of seconds the hold note has overlapped the current beat, or 0 if it
|
||||||
|
* doesn't overlap. */
|
||||||
|
float fOverlappedTime;
|
||||||
|
|
||||||
/* Last index where fLife was greater than 0. If the tap was missed, this will
|
/* Last index where fLife was greater than 0. If the tap was missed, this will
|
||||||
* be the first index of the hold. */
|
* be the first index of the hold. */
|
||||||
int iLastHeldRow;
|
int iLastHeldRow;
|
||||||
|
|||||||
@@ -663,11 +663,18 @@ void Player::Update( float fDeltaTime )
|
|||||||
if( tn.type != TapNote::hold_head )
|
if( tn.type != TapNote::hold_head )
|
||||||
continue;
|
continue;
|
||||||
int iRow = begin->first;
|
int iRow = begin->first;
|
||||||
|
int iEndRow = iRow + tn.iDuration;
|
||||||
|
|
||||||
// set hold flags so NoteField can do intelligent drawing
|
// set hold flags so NoteField can do intelligent drawing
|
||||||
tn.HoldResult.bHeld = false;
|
tn.HoldResult.bHeld = false;
|
||||||
tn.HoldResult.bActive = false;
|
tn.HoldResult.bActive = false;
|
||||||
|
|
||||||
|
// If the song beat is in the range of this hold:
|
||||||
|
if( iRow <= iSongRow && iRow <= iEndRow )
|
||||||
|
tn.HoldResult.fOverlappedTime += fDeltaTime;
|
||||||
|
else
|
||||||
|
tn.HoldResult.fOverlappedTime = 0;
|
||||||
|
|
||||||
HoldNoteScore hns = tn.HoldResult.hns;
|
HoldNoteScore hns = tn.HoldResult.hns;
|
||||||
if( hns != HNS_None ) // if this HoldNote already has a result
|
if( hns != HNS_None ) // if this HoldNote already has a result
|
||||||
continue; // we don't need to update the logic for this one
|
continue; // we don't need to update the logic for this one
|
||||||
@@ -693,8 +700,6 @@ void Player::Update( float fDeltaTime )
|
|||||||
bIsHoldingButton = INPUTMAPPER->IsBeingPressed( GameI, m_pPlayerState->m_mp );
|
bIsHoldingButton = INPUTMAPPER->IsBeingPressed( GameI, m_pPlayerState->m_mp );
|
||||||
}
|
}
|
||||||
|
|
||||||
int iEndRow = iRow + tn.iDuration;
|
|
||||||
|
|
||||||
float fLife = tn.HoldResult.fLife;
|
float fLife = tn.HoldResult.fLife;
|
||||||
if( bSteppedOnTapNote && fLife != 0 )
|
if( bSteppedOnTapNote && fLife != 0 )
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user