diff --git a/Docs/Changelog_sm5.txt b/Docs/Changelog_sm5.txt index 264971b4ca..bac154e0ab 100644 --- a/Docs/Changelog_sm5.txt +++ b/Docs/Changelog_sm5.txt @@ -10,6 +10,11 @@ StepMania 5.0 Preview 2 | 20110??? 2011/06/13 ---------- +* [NoteDisplay] Add two new metrics. + * DrawRollHeadForTapsOnSameRow: bool, similar to DrawHoldHeadForTapsOnSameRow + * TapHoldRollOnRowMeansHold: bool, true means hold and false means roll + * No noteskins should require updating, as these were placed in common/common + for ease of use. [Wolfman2000] * [LifeMeterBattery] Added DangerThreshold metric. [AJ] * [LifeMeterBattery] Added some important metrics. [AJ] * MinScoreToKeepLife='TapNoteScore_*' - any score below this = loss of life. diff --git a/NoteSkins/common/common/metrics.ini b/NoteSkins/common/common/metrics.ini index 619f75b3f6..6c9f3f4e31 100644 --- a/NoteSkins/common/common/metrics.ini +++ b/NoteSkins/common/common/metrics.ini @@ -1,5 +1,7 @@ [NoteDisplay] DrawHoldHeadForTapsOnSameRow=1 +DrawRollHeadForTapsOnSameRow=1 +TapHoldRollOnRowMeansHold=1 AnimationIsBeatBased=1 TapNoteAnimationLength=1 TapMineAnimationLength=1 diff --git a/src/NoteDisplay.cpp b/src/NoteDisplay.cpp index a5c530bd73..9695fd09e9 100644 --- a/src/NoteDisplay.cpp +++ b/src/NoteDisplay.cpp @@ -46,6 +46,8 @@ static const NoteType MAX_DISPLAY_NOTE_TYPE = (NoteType)7; struct NoteMetricCache_t { bool m_bDrawHoldHeadForTapsOnSameRow; + bool m_bDrawRollHeadForTapsOnSameRow; + bool m_bTapHoldRollOnRowMeansHold; float m_fAnimationLength[NUM_NotePart]; bool m_bAnimationIsVivid[NUM_NotePart]; RageVector2 m_fAdditionTextureCoordOffset[NUM_NotePart]; @@ -69,6 +71,8 @@ struct NoteMetricCache_t void NoteMetricCache_t::Load( const RString &sButton ) { m_bDrawHoldHeadForTapsOnSameRow = NOTESKIN->GetMetricB(sButton,"DrawHoldHeadForTapsOnSameRow"); + m_bDrawRollHeadForTapsOnSameRow = NOTESKIN->GetMetricB(sButton,"DrawRollHeadForTapsOnSameRow"); + m_bTapHoldRollOnRowMeansHold = NOTESKIN->GetMetricB(sButton,"TapHoldRollOnRowMeansHold"); FOREACH_NotePart( p ) { const RString &s = NotePartToString(p); @@ -271,6 +275,11 @@ bool NoteDisplay::DrawHoldHeadForTapsOnSameRow() const return cache->m_bDrawHoldHeadForTapsOnSameRow; } +bool NoteDisplay::DrawRollHeadForTapsOnSameRow() const +{ + return cache->m_bDrawRollHeadForTapsOnSameRow; +} + void NoteDisplay::Update( float fDeltaTime ) { /* This function is static: it's called once per game loop, not once per @@ -718,7 +727,13 @@ void NoteDisplay::DrawActor( const TapNote& tn, Actor* pActor, NotePart part, in } } -void NoteDisplay::DrawTap( const TapNote& tn, int iCol, float fBeat, bool bOnSameRowAsHoldStart, bool bIsAddition, float fPercentFadeToFail, float fReverseOffsetPixels, float fDrawDistanceAfterTargetsPixels, float fDrawDistanceBeforeTargetsPixels, float fFadeInPercentOfDrawFar ) +void NoteDisplay::DrawTap(const TapNote& tn, int iCol, float fBeat, + bool bOnSameRowAsHoldStart, bool bOnSameRowAsRollStart, + bool bIsAddition, float fPercentFadeToFail, + float fReverseOffsetPixels, + float fDrawDistanceAfterTargetsPixels, + float fDrawDistanceBeforeTargetsPixels, + float fFadeInPercentOfDrawFar) { Actor* pActor = NULL; NotePart part = NotePart_Tap; @@ -738,10 +753,40 @@ void NoteDisplay::DrawTap( const TapNote& tn, int iCol, float fBeat, bool bOnSam pActor = GetTapActor( m_TapFake, NotePart_Fake, fBeat ); part = NotePart_Fake; } + // TODO: Simplify all of the below. + else if (bOnSameRowAsHoldStart && bOnSameRowAsRollStart) + { + if (cache->m_bDrawHoldHeadForTapsOnSameRow && cache->m_bDrawRollHeadForTapsOnSameRow) + { + if (cache->m_bTapHoldRollOnRowMeansHold) // another new metric? + { + pActor = GetHoldActor( m_HoldHead, NotePart_HoldHead, fBeat, false, false ); + } + else + { + pActor = GetHoldActor( m_HoldHead, NotePart_HoldHead, fBeat, true, false ); + } + } + else if (cache->m_bDrawHoldHeadForTapsOnSameRow) + { + pActor = GetHoldActor( m_HoldHead, NotePart_HoldHead, fBeat, false, false ); + } + else if (cache->m_bDrawRollHeadForTapsOnSameRow) + { + pActor = GetHoldActor( m_HoldHead, NotePart_HoldHead, fBeat, true, false ); + } + } + else if( bOnSameRowAsHoldStart && cache->m_bDrawHoldHeadForTapsOnSameRow ) { pActor = GetHoldActor( m_HoldHead, NotePart_HoldHead, fBeat, false, false ); } + + else if( bOnSameRowAsRollStart && cache->m_bDrawRollHeadForTapsOnSameRow ) + { + pActor = GetHoldActor( m_HoldHead, NotePart_HoldHead, fBeat, true, false ); + } + else { pActor = GetTapActor( m_TapNote, NotePart_Tap, fBeat ); diff --git a/src/NoteDisplay.h b/src/NoteDisplay.h index 8f79041e17..a7e45f3f62 100644 --- a/src/NoteDisplay.h +++ b/src/NoteDisplay.h @@ -80,13 +80,33 @@ public: static void Update( float fDeltaTime ); - void DrawTap( const TapNote& tn, int iCol, float fBeat, bool bOnSameRowAsHoldStart, bool bIsAddition, - float fPercentFadeToFail, float fReverseOffsetPixels, float fDrawDistanceAfterTargetsPixels, float fDrawDistanceBeforeTargetsPixels, float fFadeInPercentOfDrawFar ); + /** + * @brief Draw the TapNote onto the NoteField. + * @param tn the TapNote in question. + * @param iCol the column. + * @param float fBeat the beat to draw them on. + * @param bOnSameRowAsHoldStart a flag to see if a hold is on the same beat. + * @param bOnSameRowAsRollStart a flag to see if a roll is on the same beat. + * @param bIsAddition a flag to see if this note was added via mods. + * @param fPercentFadeToFail at what point do the notes fade on failure? + * @param fReverseOffsetPixels How are the notes adjusted on Reverse? + * @param fDrawDistanceAfterTargetsPixels how much to draw after the receptors. + * @param fDrawDistanceBeforeTargetsPixels how much ot draw before the receptors. + * @param fFadeInPercentOfDrawFar when to start fading in. */ + void DrawTap(const TapNote& tn, int iCol, float fBeat, + bool bOnSameRowAsHoldStart, bool bOnSameRowAsRollBeat, + bool bIsAddition, float fPercentFadeToFail, + float fReverseOffsetPixels, + float fDrawDistanceAfterTargetsPixels, + float fDrawDistanceBeforeTargetsPixels, + float fFadeInPercentOfDrawFar ); void DrawHold( const TapNote& tn, int iCol, int iRow, bool bIsBeingHeld, const HoldNoteResult &Result, bool bIsAddition, float fPercentFadeToFail, float fReverseOffsetPixels, float fDrawDistanceAfterTargetsPixels, float fDrawDistanceBeforeTargetsPixels, float fDrawDistanceBeforeTargetsPixels2, float fFadeInPercentOfDrawFar ); bool DrawHoldHeadForTapsOnSameRow() const; + + bool DrawRollHeadForTapsOnSameRow() const; private: void SetActiveFrame( float fNoteBeat, Actor &actorToSet, float fAnimationLength, bool bVivid ); diff --git a/src/NoteField.cpp b/src/NoteField.cpp index 3795881eb7..70faf81a5f 100644 --- a/src/NoteField.cpp +++ b/src/NoteField.cpp @@ -1260,13 +1260,31 @@ void NoteField::DrawPrimitives() { for( int c2=0; c2GetNumTracks(); c2++ ) { - if( m_pNoteData->GetTapNote(c2, q).type == TapNote::hold_head) + const TapNote &tmp = m_pNoteData->GetTapNote(c2, q); + if(tmp.type == TapNote::hold_head && + tmp.subType == TapNote::hold_head_hold) { bHoldNoteBeginsOnThisBeat = true; break; } } } + + // do the same for a roll. + bool bRollNoteBeginsOnThisBeat = false; + if (m_pCurDisplay->display[c].DrawRollHeadForTapsOnSameRow() ) + { + for( int c2=0; c2GetNumTracks(); c2++ ) + { + const TapNote &tmp = m_pNoteData->GetTapNote(c2, q); + if(tmp.type == TapNote::hold_head && + tmp.subType == TapNote::hold_head_roll) + { + bRollNoteBeginsOnThisBeat = true; + break; + } + } + } bool bIsInSelectionRange = false; if( m_iBeginMarker!=-1 && m_iEndMarker!=-1 ) @@ -1276,7 +1294,8 @@ void NoteField::DrawPrimitives() bool bIsHopoPossible = (tn.bHopoPossible); bool bUseAdditionColoring = bIsAddition || bIsHopoPossible; NoteDisplayCols *displayCols = tn.pn == PLAYER_INVALID ? m_pCurDisplay : m_pDisplays[tn.pn]; - displayCols->display[c].DrawTap( tn, c, NoteRowToVisibleBeat(m_pPlayerState, q), bHoldNoteBeginsOnThisBeat, + displayCols->display[c].DrawTap(tn, c, NoteRowToVisibleBeat(m_pPlayerState, q), + bHoldNoteBeginsOnThisBeat, bRollNoteBeginsOnThisBeat, bUseAdditionColoring, bIsInSelectionRange ? fSelectedRangeGlow : m_fPercentFadeToFail, m_fYReverseOffsetPixels, iDrawDistanceAfterTargetsPixels, iDrawDistanceBeforeTargetsPixels, FADE_BEFORE_TARGETS_PERCENT );