change hold explosion format

This commit is contained in:
Chris Danford
2004-01-01 01:53:25 +00:00
parent f979d8474f
commit 7fa80e5530
9 changed files with 41 additions and 53 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

+4 -4
View File
@@ -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; i<NUM_TAP_NOTE_SCORES; i++ )
{
CString sJudge = TapNoteScoreToString( (TapNoteScore)i );
CString sFullFile = bLoadJustOne ? sFile : sFile + " " + sJudge;
CString sFullElement = bLoadJustOne ? sElement : sElement + " " + sJudge;
// HACK: for backward noteskin compatibility
CString sPath = NOTESKIN->GetPathToFromNoteSkinAndButton(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 );
}
}
+3 -3
View File
@@ -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 )
+1 -1
View File
@@ -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;
+14 -39
View File
@@ -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 <math.h>
#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;
}
+7 -4
View File
@@ -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;
};
+7 -1
View File
@@ -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 ); }
+2 -1
View File
@@ -39,7 +39,8 @@ public:
virtual void Unload();
void RemoveTapNoteRow( int iIndex );
map<RowTrack,bool> m_HeldHoldNotes; // hack: Need this to know when to "light up" the center of hold notes
map<RowTrack,bool> m_HeldHoldNotes; // true if button is being held down
map<RowTrack,bool> m_ActiveHoldNotes; // true if hold has life > 0
float m_fBeginMarker, m_fEndMarker; // only used with MODE_EDIT
+3
View File
@@ -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