diff --git a/stepmania/NoteSkins/dance/default/Down Hold Explosion 2x1.png b/stepmania/NoteSkins/dance/default/Down Hold Explosion 2x1.png new file mode 100644 index 0000000000..4d0a1c8d6a Binary files /dev/null and b/stepmania/NoteSkins/dance/default/Down Hold Explosion 2x1.png differ diff --git a/stepmania/src/GhostArrow.cpp b/stepmania/src/GhostArrow.cpp index a8cb303131..ce4a79200e 100644 --- a/stepmania/src/GhostArrow.cpp +++ b/stepmania/src/GhostArrow.cpp @@ -26,18 +26,18 @@ GhostArrow::GhostArrow() } } -void GhostArrow::Load( CString sNoteSkin, CString sButton, CString sFile, bool bLoadJustOne ) +void GhostArrow::Load( CString sNoteSkin, CString sButton, CString sElement, bool bLoadJustOne ) { for( int i=0; iGetPathToFromNoteSkinAndButton(sNoteSkin, sButton, sFullFile, true); // optional + CString sPath = NOTESKIN->GetPathToFromNoteSkinAndButton(sNoteSkin, sButton, sFullElement, true); // optional if( sPath.empty() ) - sPath = NOTESKIN->GetPathToFromNoteSkinAndButton(sNoteSkin, sButton, sFile); // not optional + sPath = NOTESKIN->GetPathToFromNoteSkinAndButton(sNoteSkin, sButton, sElement); // not optional m_spr[i].Load( sPath ); } } diff --git a/stepmania/src/GhostArrowRow.cpp b/stepmania/src/GhostArrowRow.cpp index 8d0bdb3bc0..6ae5f46f96 100644 --- a/stepmania/src/GhostArrowRow.cpp +++ b/stepmania/src/GhostArrowRow.cpp @@ -55,7 +55,7 @@ void GhostArrowRow::Load( PlayerNumber pn, CString NoteSkin, float fYReverseOffs m_GhostDim[c].Load( NoteSkin, Button, "tap explosion dim", false); m_GhostBright[c].Load( NoteSkin, Button, "tap explosion bright", false ); m_GhostMine[c].Load( NoteSkin, Button, "tap explosion mine", true ); - m_HoldGhost[c].Load( NOTESKIN->GetPathToFromNoteSkinAndButton(NoteSkin, Button, "hold explosion") ); + m_HoldGhost[c].Load( NoteSkin, Button, "hold explosion" ); } } @@ -115,10 +115,10 @@ void GhostArrowRow::DidTapNote( int iCol, TapNoteScore score, bool bBright ) m_GhostDim[iCol].Step( score ); } -void GhostArrowRow::DidHoldNote( int iCol ) +void GhostArrowRow::SetHoldIsActive( int iCol ) { ASSERT( iCol >= 0 && iCol < m_iNumCols ); - m_HoldGhost[iCol].Step(); + m_HoldGhost[iCol].SetHoldIsActive( true ); } void GhostArrowRow::DidTapMine( int iCol, TapNoteScore score ) diff --git a/stepmania/src/GhostArrowRow.h b/stepmania/src/GhostArrowRow.h index 80df42e6f5..1794d0c9ad 100644 --- a/stepmania/src/GhostArrowRow.h +++ b/stepmania/src/GhostArrowRow.h @@ -31,7 +31,7 @@ public: void DidTapNote( int iCol, TapNoteScore score, bool bBright ); void DidTapMine( int iCol, TapNoteScore score ); - void DidHoldNote( int iCol ); + void SetHoldIsActive( int iCol ); protected: int m_iNumCols; diff --git a/stepmania/src/HoldGhostArrow.cpp b/stepmania/src/HoldGhostArrow.cpp index 3070c819b2..9dc55c5cc0 100644 --- a/stepmania/src/HoldGhostArrow.cpp +++ b/stepmania/src/HoldGhostArrow.cpp @@ -3,7 +3,7 @@ ----------------------------------------------------------------------------- Class: HoldGhostArrow - Desc: A graphic displayed in the HoldJudgment during Dancing. + Desc: See header Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved. Ben Nordstrom @@ -15,57 +15,32 @@ #include "PrefsManager.h" #include "RageException.h" #include "RageTimer.h" -#include -#include "ThemeManager.h" - - -CachedThemeMetricF WARM_UP_SECONDS ("HoldGhostArrow","WarmUpSeconds"); - +#include "NoteSkinManager.h" +#include "GameState.h" HoldGhostArrow::HoldGhostArrow() { - WARM_UP_SECONDS.Refresh(); + m_bHoldIsActive = false; +} - m_bWasSteppedOnLastFrame = false; - m_fHeatLevel = 0; - -// LoadFromSpriteFile( THEME->GetPathTo(GRAPHIC_HOLD_GHOST_ARROW) ); - SetDiffuse( RageColor(1,1,1,1) ); +void HoldGhostArrow::Load( CString sNoteSkin, CString sButton, CString sElement ) +{ + Sprite::Load( NOTESKIN->GetPathToFromNoteSkinAndButton(sNoteSkin, sButton, sElement) ); // not optional + m_sOnCommand = NOTESKIN->GetMetric(sNoteSkin,"HoldGhostArrow","OnCommand"); + this->Command( m_sOnCommand ); } void HoldGhostArrow::Update( float fDeltaTime ) { Sprite::Update( fDeltaTime ); - - if( m_bWasSteppedOnLastFrame ) - m_fHeatLevel += fDeltaTime/(float)WARM_UP_SECONDS; - else - m_fHeatLevel -= fDeltaTime/(float)WARM_UP_SECONDS; - - CLAMP( m_fHeatLevel, 0, 1 ); - - int iStateNum = (int)min( m_fHeatLevel * GetNumStates(), GetNumStates()-1 ); - SetState( iStateNum ); - - if( m_fHeatLevel == 1 ) - { - bool bZooomALittle = fmodf( RageTimer::GetTimeSinceStart(), 1/20.0f ) > 1/40.0f; - SetZoom( bZooomALittle ? 1.04f : 1.0f ); - } - else - SetZoom( 1 ); - SetDiffuse( RageColor(1,1,1,m_fHeatLevel*3) ); - - m_bWasSteppedOnLastFrame = false; // reset for next frame + m_bHoldIsActive = false; } void HoldGhostArrow::DrawPrimitives() { + if( !m_bHoldIsActive ) + return; + Sprite::DrawPrimitives(); } - -void HoldGhostArrow::Step() -{ - m_bWasSteppedOnLastFrame = true; -} diff --git a/stepmania/src/HoldGhostArrow.h b/stepmania/src/HoldGhostArrow.h index e03e0e1ad4..1d955612e1 100644 --- a/stepmania/src/HoldGhostArrow.h +++ b/stepmania/src/HoldGhostArrow.h @@ -4,7 +4,7 @@ ----------------------------------------------------------------------------- Class: HoldGhostArrow - Desc: The "electricity around the stationary arrow as it's pressing a HoldNote. + Desc: The graphic shown while holding a HoldNote. Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved. Ben Nordstrom @@ -13,19 +13,22 @@ */ #include "Sprite.h" +#include "PlayerNumber.h" class HoldGhostArrow : public Sprite { public: HoldGhostArrow(); + virtual void Load( CString sNoteSkin, CString sButton, CString sElement ); + virtual void Update( float fDeltaTime ); virtual void DrawPrimitives(); - void Step(); + void SetHoldIsActive( bool bHoldIsActive ) { m_bHoldIsActive = bHoldIsActive; } - bool m_bWasSteppedOnLastFrame; - float m_fHeatLevel; // brightness - between 0 and 1 + bool m_bHoldIsActive; + CString m_sOnCommand; }; diff --git a/stepmania/src/NoteField.cpp b/stepmania/src/NoteField.cpp index 923036d99b..c48d197669 100644 --- a/stepmania/src/NoteField.cpp +++ b/stepmania/src/NoteField.cpp @@ -97,6 +97,7 @@ void NoteField::Load( const NoteData* pNoteData, PlayerNumber pn, int iFirstPixe NoteDataWithScoring::Init(); m_HeldHoldNotes.clear(); + m_ActiveHoldNotes.clear(); this->CopyAll( pNoteData ); ASSERT( GetNumTracks() == GAMESTATE->GetCurrentStyleDef()->m_iColsPerPlayer ); @@ -519,6 +520,11 @@ void NoteField::DrawPrimitives() const HoldNoteScore hns = GetHoldNoteScore( hn ); const float fLife = GetHoldNoteLife( hn ); const bool bIsHoldingNote = m_HeldHoldNotes[hn]; + const bool bIsActive = m_ActiveHoldNotes[hn]; + + if( bIsActive ) + SearchForSongBeat()->m_GhostArrowRow.SetHoldIsActive( hn.iTrack ); + if( hns == HNS_OK ) // if this HoldNote was completed continue; // don't draw anything @@ -628,5 +634,5 @@ void NoteField::FadeToFail() void NoteField::Step( int iCol ) { SearchForSongBeat()->m_ReceptorArrowRow.Step( iCol ); } void NoteField::SetPressed( int iCol ) { SearchForSongBeat()->m_ReceptorArrowRow.SetPressed( iCol ); } void NoteField::DidTapNote( int iCol, TapNoteScore score, bool bBright ) { SearchForSongBeat()->m_GhostArrowRow.DidTapNote( iCol, score, bBright ); } -void NoteField::DidHoldNote( int iCol ) { SearchForSongBeat()->m_GhostArrowRow.DidHoldNote( iCol ); } +void NoteField::DidHoldNote( int iCol ) { /*SearchForSongBeat()->m_GhostArrowRow.DidHoldNote( iCol );*/ } void NoteField::DidTapMine( int iCol, TapNoteScore score ) { SearchForSongBeat()->m_GhostArrowRow.DidTapMine( iCol, score ); } diff --git a/stepmania/src/NoteField.h b/stepmania/src/NoteField.h index 1539e1b5b1..c322b095a5 100644 --- a/stepmania/src/NoteField.h +++ b/stepmania/src/NoteField.h @@ -39,7 +39,8 @@ public: virtual void Unload(); void RemoveTapNoteRow( int iIndex ); - map m_HeldHoldNotes; // hack: Need this to know when to "light up" the center of hold notes + map m_HeldHoldNotes; // true if button is being held down + map m_ActiveHoldNotes; // true if hold has life > 0 float m_fBeginMarker, m_fEndMarker; // only used with MODE_EDIT diff --git a/stepmania/src/Player.cpp b/stepmania/src/Player.cpp index 6e4d55099f..0d6a13e546 100644 --- a/stepmania/src/Player.cpp +++ b/stepmania/src/Player.cpp @@ -288,6 +288,7 @@ void PlayerMinus::Update( float fDeltaTime ) HoldNoteScore hns = GetHoldNoteScore(hn); m_pNoteField->m_HeldHoldNotes[hn] = false; // set hold flag so NoteField can do intelligent drawing + m_pNoteField->m_ActiveHoldNotes[hn] = false; // set hold flag so NoteField can do intelligent drawing if( hns != HNS_NONE ) // if this HoldNote already has a result @@ -315,6 +316,7 @@ void PlayerMinus::Update( float fDeltaTime ) // set hold flag so NoteField can do intelligent drawing m_pNoteField->m_HeldHoldNotes[hn] = bIsHoldingButton && bSteppedOnTapNote; + m_pNoteField->m_ActiveHoldNotes[hn] = bSteppedOnTapNote; if( bSteppedOnTapNote ) // this note is not judged and we stepped on its head { @@ -324,6 +326,7 @@ void PlayerMinus::Update( float fDeltaTime ) fhn.iStartRow = min( iSongRow, fhn.iEndRow ); } + if( bSteppedOnTapNote && bIsHoldingButton ) { // Increase life