From 8e564b0def38e912efdf70d3b79ac179fef80c27 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 22 Jan 2005 05:00:33 +0000 Subject: [PATCH] Avoid checking for bHoldNoteBeginsOnThisBeat if the note skin doesn't really need it. --- stepmania/src/NoteDisplay.cpp | 5 +++++ stepmania/src/NoteDisplay.h | 2 ++ stepmania/src/NoteField.cpp | 21 +++++++++++++-------- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/stepmania/src/NoteDisplay.cpp b/stepmania/src/NoteDisplay.cpp index cab1456857..13e611bc8e 100644 --- a/stepmania/src/NoteDisplay.cpp +++ b/stepmania/src/NoteDisplay.cpp @@ -344,6 +344,11 @@ void NoteDisplay::Load( int iColNum, const PlayerState* pPlayerState, CString No } } +bool NoteDisplay::DrawHoldHeadForTapsOnSameRow() const +{ + return cache->m_bDrawHoldHeadForTapsOnSameRow; +} + void NoteDisplay::Update( float fDeltaTime ) { /* This function is static: it's called once per game loop, not once per diff --git a/stepmania/src/NoteDisplay.h b/stepmania/src/NoteDisplay.h index 2da6fe0b2d..5f079ac8ff 100644 --- a/stepmania/src/NoteDisplay.h +++ b/stepmania/src/NoteDisplay.h @@ -24,6 +24,8 @@ public: void DrawActor( Actor* pActor, int iCol, float fBeat, float fPercentFadeToFail, float fLife, float fReverseOffsetPixels, bool bUseLighting ); void DrawTap( int iCol, float fBeat, bool bOnSameRowAsHoldStart, bool bIsAddition, bool bIsMine, float fPercentFadeToFail, float fLife, float fReverseOffsetPixels ); void DrawHold( const HoldNote& hn, bool bIsBeingHeld, bool bIsActive, const HoldNoteResult &Result, float fPercentFadeToFail, bool bDrawGlowOnly, float fReverseOffsetPixels ); + + bool DrawHoldHeadForTapsOnSameRow() const; protected: void SetActiveFrame( float fNoteBeat, Actor &actorToSet, float fAnimationLengthInBeats, bool bVivid, bool bNoteColor ); diff --git a/stepmania/src/NoteField.cpp b/stepmania/src/NoteField.cpp index fd911675d3..48f6011f56 100644 --- a/stepmania/src/NoteField.cpp +++ b/stepmania/src/NoteField.cpp @@ -632,14 +632,22 @@ void NoteField::DrawPrimitives() if( fYOffset < iFirstPixelToDraw ) // off screen continue; // skip - // See if there is a hold step that begins on this index. + ASSERT_M( NoteRowToBeat(i) > -2000, ssprintf("%i %i %i, %f %f", i, iLastIndexToDraw, iFirstIndexToDraw, GAMESTATE->m_fSongBeat, GAMESTATE->m_fMusicSeconds) ); + SearchForBeat( CurDisplay, NextDisplay, NoteRowToBeat(i) ); + NoteDisplayCols *nd = CurDisplay->second; + + // See if there is a hold step that begins on this index. Only do this + // if the note skin cares. bool bHoldNoteBeginsOnThisBeat = false; - for( int c2=0; c2GetNumTracks(); c2++ ) + if( nd->display[c].DrawHoldHeadForTapsOnSameRow() ) { - if( m_pNoteData->GetTapNote(c2, i).type == TapNote::hold_head) + for( int c2=0; c2GetNumTracks(); c2++ ) { - bHoldNoteBeginsOnThisBeat = true; - break; + if( m_pNoteData->GetTapNote(c2, i).type == TapNote::hold_head) + { + bHoldNoteBeginsOnThisBeat = true; + break; + } } } @@ -654,9 +662,6 @@ void NoteField::DrawPrimitives() bool bIsMine = (tn.type == TapNote::mine); bool bIsAttack = (tn.type == TapNote::attack); - ASSERT_M( NoteRowToBeat(i) > -2000, ssprintf("%i %i %i, %f %f", i, iLastIndexToDraw, iFirstIndexToDraw, GAMESTATE->m_fSongBeat, GAMESTATE->m_fMusicSeconds) ); - SearchForBeat( CurDisplay, NextDisplay, NoteRowToBeat(i) ); - NoteDisplayCols *nd = CurDisplay->second; if( bIsAttack ) { Sprite sprite;