From 5a30c390d6872916321750f37cfb74e7e7e08c92 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 6 Nov 2003 07:17:31 +0000 Subject: [PATCH] Fix crashes due to rendering nonexistant NOTE_TYPE_48TH and NOTE_TYPE_64TH. --- stepmania/src/NoteDisplay.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/stepmania/src/NoteDisplay.cpp b/stepmania/src/NoteDisplay.cpp index 5c40defcc4..40ed33f7c5 100644 --- a/stepmania/src/NoteDisplay.cpp +++ b/stepmania/src/NoteDisplay.cpp @@ -295,6 +295,8 @@ Actor * NoteDisplay::GetTapNoteActor( float fNoteBeat ) nt = BeatToNoteType( fNoteBeat ); if( nt == NOTE_TYPE_INVALID ) nt = NOTE_TYPE_32ND; + nt = min( nt, (NoteType) (NOTE_COLOR_IMAGES-1) ); + Actor *pActorOut = m_pTapNote[nt]; SetActiveFrame( @@ -338,6 +340,7 @@ Sprite * NoteDisplay::GetHoldTopCapSprite( float fNoteBeat, bool bActive ) nt = BeatToNoteType( fNoteBeat ); if( nt == NOTE_TYPE_INVALID ) nt = NOTE_TYPE_32ND; + nt = min( nt, (NoteType) (NOTE_COLOR_IMAGES-1) ); Sprite *pSpriteOut = bActive ? &m_sprHoldTopCapActive[nt] : &m_sprHoldTopCapInactive[nt]; @@ -358,6 +361,7 @@ Sprite * NoteDisplay::GetHoldBottomCapSprite( float fNoteBeat, bool bActive ) nt = BeatToNoteType( fNoteBeat ); if( nt == NOTE_TYPE_INVALID ) nt = NOTE_TYPE_32ND; + nt = min( nt, (NoteType) (NOTE_COLOR_IMAGES-1) ); Sprite *pSpriteOut = bActive ? &m_sprHoldBottomCapActive[nt] : &m_sprHoldBottomCapInactive[nt]; @@ -379,6 +383,7 @@ Actor* NoteDisplay::GetHoldHeadActor( float fNoteBeat, bool bActive ) nt = BeatToNoteType( fNoteBeat ); if( nt == NOTE_TYPE_INVALID ) nt = NOTE_TYPE_32ND; + nt = min( nt, (NoteType) (NOTE_COLOR_IMAGES-1) ); Actor *pActorOut = bActive ? m_pHoldHeadActive[nt] : m_pHoldHeadInactive[nt]; @@ -399,6 +404,7 @@ Sprite *NoteDisplay::GetHoldBodySprite( float fNoteBeat, bool bActive ) nt = BeatToNoteType( fNoteBeat ); if( nt == NOTE_TYPE_INVALID ) nt = NOTE_TYPE_32ND; + nt = min( nt, (NoteType) (NOTE_COLOR_IMAGES-1) ); Sprite *pSpriteOut = bActive ? &m_sprHoldBodyActive[nt] : &m_sprHoldBodyInactive[nt]; @@ -419,6 +425,7 @@ Actor* NoteDisplay::GetHoldTailActor( float fNoteBeat, bool bActive ) nt = BeatToNoteType( fNoteBeat ); if( nt == NOTE_TYPE_INVALID ) nt = NOTE_TYPE_32ND; + nt = min( nt, (NoteType) NOTE_COLOR_IMAGES-1 ); Actor *pActorOut = bActive ? m_pHoldTailActive[nt] : m_pHoldTailInactive[nt];