Skip to content

Commit

Permalink
Increase timing window for notes immediately after holds & rolls to g…
Browse files Browse the repository at this point in the history
…oods

and formatting
experimental change pending testing
  • Loading branch information
poco0317 committed Feb 15, 2019
1 parent efd7c11 commit 1c19cdf
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions src/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,8 @@ Player::Init(const RString& sType,
m_vpHoldJudgment[i] = NULL;
// set this reasonably negative because if we don't, the first row of
// the song doesn't get judged
// and also it gets changed back to a realistic number after a hold is hit -poco
// and also it gets changed back to a realistic number after a hold is
// hit -poco
lastHoldHeadsSeconds[i] = -1000.f;
}

Expand Down Expand Up @@ -947,7 +948,6 @@ Player::Update(float fDeltaTime)
if (bIsHoldingButton && m_pPlayerState->m_PlayerController == PC_HUMAN)
if (m_pNoteField != nullptr)
m_pNoteField->SetPressed(col);

}

// handle Autoplay for rolls
Expand Down Expand Up @@ -1003,7 +1003,9 @@ Player::Update(float fDeltaTime)
int iRow = iter.Row();
TrackRowTapNote trtn = { iTrack, iRow, &tn };

lastHoldHeadsSeconds[iTrack] = max(lastHoldHeadsSeconds[iTrack],m_Timing->WhereUAtBro(NoteRowToBeat(iRow+ tn.iDuration)));
lastHoldHeadsSeconds[iTrack] =
max(lastHoldHeadsSeconds[iTrack],
m_Timing->WhereUAtBro(NoteRowToBeat(iRow + tn.iDuration)));

/* All holds must be of the same subType because fLife is handled
* in different ways depending on the SubType. Handle Rolls one at
Expand Down Expand Up @@ -1507,8 +1509,7 @@ Player::DrawPrimitives()
// TODO: Remove use of PlayerNumber.
PlayerNumber pn = m_pPlayerState->m_PlayerNumber;


if (pn !=PLAYER_1)
if (pn != PLAYER_1)
return;

bool draw_notefield = (m_pNoteField != nullptr);
Expand Down Expand Up @@ -2156,7 +2157,7 @@ Player::Step(int col,
if (iRowOfOverlappingNoteOrRow != -1) {
// compute the score for this hit
float fNoteOffset = 0.f;
// only valid if
// only valid if
float fMusicSeconds;
// we need this later if we are autosyncing
const float fStepBeat = NoteRowToBeat(iRowOfOverlappingNoteOrRow);
Expand Down Expand Up @@ -2231,8 +2232,11 @@ Player::Step(int col,
}
// Fall through to default.
default:
if (pTN->type != TapNoteType_HoldHead && lastHoldHeadsSeconds[col] > fMusicSeconds)
break;
if (pTN->type != TapNoteType_HoldHead &&
lastHoldHeadsSeconds[col] > fMusicSeconds) {
if (fSecondsFromExact > GetWindowSeconds(TW_W4))
break;
}
if ((pTN->type == TapNoteType_Lift) == bRelease) {
if (fSecondsFromExact <= GetWindowSeconds(TW_W1))
score = TNS_W1;
Expand Down Expand Up @@ -2724,9 +2728,9 @@ Player::StepReplay(int col,
const float fSecondsFromExact = fabsf(fNoteOffset);

TapNote* pTN = nullptr;
NoteData::iterator iter =
m_NoteData.FindTapNote(col, GetClosestNote(col, iSongRow, MAX_NOTE_ROW, MAX_NOTE_ROW, true));
NoteData::iterator iter = m_NoteData.FindTapNote(
col, GetClosestNote(col, iSongRow, MAX_NOTE_ROW, MAX_NOTE_ROW, true));

pTN = &iter->second;

// We don't really have to care if we are releasing on a non-lift,
Expand Down Expand Up @@ -3371,7 +3375,6 @@ Player::HandleTapRowScore(unsigned row)
bNoCheating = false;
#endif


// don't accumulate points if AutoPlay is on.
if (bNoCheating && m_pPlayerState->m_PlayerController == PC_AUTOPLAY)
return;
Expand Down Expand Up @@ -3531,7 +3534,6 @@ Player::HandleHoldScore(const TapNote& tn)
bNoCheating = false;
#endif


// don't accumulate points if AutoPlay is on.
if (bNoCheating && m_pPlayerState->m_PlayerController == PC_AUTOPLAY)
return;
Expand Down

0 comments on commit 1c19cdf

Please sign in to comment.