Simplify.
This commit is contained in:
+27
-124
@@ -85,7 +85,7 @@ void NoteMetricCache_t::Load( const RString &sButton )
|
||||
|
||||
struct NoteSkinAndPath
|
||||
{
|
||||
NoteSkinAndPath( const RString sNoteSkin_, const RString sPath_ ) { sNoteSkin = sNoteSkin_; sPath = sPath_; }
|
||||
NoteSkinAndPath( const RString sNoteSkin_, const RString sPath_ ) : sNoteSkin(sNoteSkin_), sPath(sPath_) { }
|
||||
RString sNoteSkin;
|
||||
RString sPath;
|
||||
bool operator<( const NoteSkinAndPath &other ) const
|
||||
@@ -326,124 +326,27 @@ void NoteDisplay::SetActiveFrame( float fNoteBeat, Actor &actorToSet, float fAni
|
||||
actorToSet.SetSecondsIntoAnimation( fPercentIntoAnimation*fLengthSeconds );
|
||||
}
|
||||
|
||||
Actor * NoteDisplay::GetTapNoteActor( float fNoteBeat )
|
||||
Actor *NoteDisplay::GetTapActor( NoteColorActor &nca, NotePart part, float fNoteBeat )
|
||||
{
|
||||
Actor *pActorOut = m_TapNote.Get();
|
||||
|
||||
SetActiveFrame(
|
||||
fNoteBeat,
|
||||
*pActorOut,
|
||||
cache->m_fAnimationLengthInBeats[NotePart_Tap],
|
||||
cache->m_bAnimationIsVivid[NotePart_Tap] );
|
||||
|
||||
return pActorOut;
|
||||
}
|
||||
|
||||
Actor * NoteDisplay::GetTapAdditionActor( float fNoteBeat )
|
||||
{
|
||||
Actor *pActorOut = m_TapAddition.Get();
|
||||
|
||||
SetActiveFrame(
|
||||
fNoteBeat,
|
||||
*pActorOut,
|
||||
cache->m_fAnimationLengthInBeats[NotePart_Addition],
|
||||
cache->m_bAnimationIsVivid[NotePart_Addition] );
|
||||
|
||||
return pActorOut;
|
||||
}
|
||||
|
||||
Actor * NoteDisplay::GetTapMineActor( float fNoteBeat )
|
||||
{
|
||||
Actor *pActorOut = m_TapMine.Get();
|
||||
|
||||
SetActiveFrame(
|
||||
fNoteBeat,
|
||||
*pActorOut,
|
||||
cache->m_fAnimationLengthInBeats[NotePart_Mine],
|
||||
cache->m_bAnimationIsVivid[NotePart_Mine] );
|
||||
|
||||
return pActorOut;
|
||||
}
|
||||
|
||||
Actor * NoteDisplay::GetTapLiftActor( float fNoteBeat )
|
||||
{
|
||||
Actor *pActorOut = m_TapLift.Get();
|
||||
Actor *pActorOut = nca.Get();
|
||||
|
||||
SetActiveFrame(
|
||||
fNoteBeat,
|
||||
*pActorOut,
|
||||
cache->m_fAnimationLengthInBeats[NotePart_Lift],
|
||||
cache->m_bAnimationIsVivid[NotePart_Mine] );
|
||||
SetActiveFrame( fNoteBeat, *pActorOut, cache->m_fAnimationLengthInBeats[part], cache->m_bAnimationIsVivid[part] );
|
||||
return pActorOut;
|
||||
}
|
||||
|
||||
Actor *NoteDisplay::GetHoldActor( NoteColorActor nca[NUM_HOLD_TYPES][NUM_ACTIVE_TYPES], NotePart part, float fNoteBeat, bool bIsRoll, bool bIsBeingHeld )
|
||||
{
|
||||
return GetTapActor( nca[bIsRoll ? roll:hold][bIsBeingHeld ? active:inactive], part, fNoteBeat );
|
||||
}
|
||||
|
||||
Sprite *NoteDisplay::GetHoldSprite( NoteColorSprite ncs[NUM_HOLD_TYPES][NUM_ACTIVE_TYPES], NotePart part, float fNoteBeat, bool bIsRoll, bool bIsBeingHeld )
|
||||
{
|
||||
Sprite *pSpriteOut = ncs[bIsRoll ? roll:hold][bIsBeingHeld ? active:inactive].Get();
|
||||
|
||||
return pActorOut;
|
||||
}
|
||||
|
||||
Sprite * NoteDisplay::GetHoldTopCapSprite( float fNoteBeat, bool bIsRoll, bool bIsBeingHeld )
|
||||
{
|
||||
Sprite *pSpriteOut = m_HoldTopCap[bIsRoll ? roll:hold][bIsBeingHeld ? active:inactive].Get();
|
||||
|
||||
SetActiveFrame(
|
||||
fNoteBeat,
|
||||
*pSpriteOut,
|
||||
cache->m_fAnimationLengthInBeats[NotePart_HoldTopCap],
|
||||
cache->m_bAnimationIsVivid[NotePart_HoldTopCap] );
|
||||
|
||||
SetActiveFrame( fNoteBeat, *pSpriteOut, cache->m_fAnimationLengthInBeats[part], cache->m_bAnimationIsVivid[part] );
|
||||
return pSpriteOut;
|
||||
}
|
||||
|
||||
Sprite * NoteDisplay::GetHoldBottomCapSprite( float fNoteBeat, bool bIsRoll, bool bIsBeingHeld )
|
||||
{
|
||||
Sprite *pSpriteOut = m_HoldBottomCap[bIsRoll ? roll:hold][bIsBeingHeld ? active:inactive].Get();
|
||||
|
||||
SetActiveFrame(
|
||||
fNoteBeat,
|
||||
*pSpriteOut,
|
||||
cache->m_fAnimationLengthInBeats[NotePart_HoldBottomCap],
|
||||
cache->m_bAnimationIsVivid[NotePart_HoldBottomCap] );
|
||||
|
||||
return pSpriteOut;
|
||||
}
|
||||
|
||||
|
||||
Actor* NoteDisplay::GetHoldHeadActor( float fNoteBeat, bool bIsRoll, bool bIsBeingHeld )
|
||||
{
|
||||
Actor *pActorOut = m_HoldHead[bIsRoll ? roll:hold][bIsBeingHeld ? active:inactive].Get();
|
||||
|
||||
SetActiveFrame(
|
||||
fNoteBeat,
|
||||
*pActorOut,
|
||||
cache->m_fAnimationLengthInBeats[NotePart_HoldHead],
|
||||
cache->m_bAnimationIsVivid[NotePart_HoldHead] );
|
||||
|
||||
return pActorOut;
|
||||
}
|
||||
|
||||
Sprite *NoteDisplay::GetHoldBodySprite( float fNoteBeat, bool bIsRoll, bool bIsBeingHeld )
|
||||
{
|
||||
Sprite *pSpriteOut = m_HoldBody[bIsRoll ? roll:hold][bIsBeingHeld ? active:inactive].Get();
|
||||
|
||||
SetActiveFrame(
|
||||
fNoteBeat,
|
||||
*pSpriteOut,
|
||||
cache->m_fAnimationLengthInBeats[NotePart_HoldBody],
|
||||
cache->m_bAnimationIsVivid[NotePart_HoldBody] );
|
||||
|
||||
return pSpriteOut;
|
||||
}
|
||||
|
||||
Actor* NoteDisplay::GetHoldTailActor( float fNoteBeat, bool bIsRoll, bool bIsBeingHeld )
|
||||
{
|
||||
Actor *pActorOut = m_HoldTail[bIsRoll ? roll:hold][bIsBeingHeld ? active:inactive].Get();
|
||||
|
||||
SetActiveFrame(
|
||||
fNoteBeat,
|
||||
*pActorOut,
|
||||
cache->m_fAnimationLengthInBeats[NotePart_HoldTail],
|
||||
cache->m_bAnimationIsVivid[NotePart_HoldTail] );
|
||||
|
||||
return pActorOut;
|
||||
}
|
||||
|
||||
static float ArrowGetAlphaOrGlow( bool bGlow, const PlayerState* pPlayerState, int iCol, float fYOffset, float fPercentFadeToFail, float fYReverseOffsetPixels )
|
||||
{
|
||||
if( bGlow )
|
||||
@@ -486,7 +389,7 @@ void NoteDisplay::DrawHoldTopCap( const TapNote& tn, int iCol, int iRow, bool bI
|
||||
//
|
||||
StripBuffer queue;
|
||||
|
||||
Sprite* pSprTopCap = GetHoldTopCapSprite( NoteRowToBeat(iRow), tn.subType == TapNote::hold_head_roll, bIsBeingHeld );
|
||||
Sprite *pSprTopCap = GetHoldSprite( m_HoldTopCap, NotePart_HoldTopCap, NoteRowToBeat(iRow), tn.subType == TapNote::hold_head_roll, bIsBeingHeld );
|
||||
|
||||
pSprTopCap->SetZoom( ArrowEffects::GetZoom( m_pPlayerState ) );
|
||||
|
||||
@@ -575,7 +478,7 @@ void NoteDisplay::DrawHoldBody( const TapNote& tn, int iCol, int iRow, bool bIsB
|
||||
//
|
||||
StripBuffer queue;
|
||||
|
||||
Sprite* pSprBody = GetHoldBodySprite( NoteRowToBeat(iRow), tn.subType == TapNote::hold_head_roll, bIsBeingHeld );
|
||||
Sprite *pSprBody = GetHoldSprite( m_HoldBody, NotePart_HoldBody, NoteRowToBeat(iRow), tn.subType == TapNote::hold_head_roll, bIsBeingHeld );
|
||||
|
||||
pSprBody->SetZoom( ArrowEffects::GetZoom( m_pPlayerState ) );
|
||||
|
||||
@@ -673,7 +576,7 @@ void NoteDisplay::DrawHoldBottomCap( const TapNote& tn, int iCol, int iRow, bool
|
||||
//
|
||||
StripBuffer queue;
|
||||
|
||||
Sprite* pBottomCap = GetHoldBottomCapSprite( NoteRowToBeat(iRow), tn.subType == TapNote::hold_head_roll, bIsBeingHeld );
|
||||
Sprite* pBottomCap = GetHoldSprite( m_HoldBottomCap, NotePart_HoldBottomCap, NoteRowToBeat(iRow), tn.subType == TapNote::hold_head_roll, bIsBeingHeld );
|
||||
|
||||
pBottomCap->SetZoom( ArrowEffects::GetZoom( m_pPlayerState ) );
|
||||
|
||||
@@ -755,7 +658,7 @@ void NoteDisplay::DrawHoldTail( const TapNote& tn, int iCol, int iRow, bool bIsB
|
||||
//
|
||||
// Draw the tail
|
||||
//
|
||||
Actor* pSprTail = GetHoldTailActor( NoteRowToBeat(iRow), tn.subType == TapNote::hold_head_roll, bIsBeingHeld );
|
||||
Actor* pSprTail = GetHoldActor( m_HoldTail, NotePart_HoldTail, NoteRowToBeat(iRow), tn.subType == TapNote::hold_head_roll, bIsBeingHeld );
|
||||
|
||||
pSprTail->SetZoom( ArrowEffects::GetZoom( m_pPlayerState ) );
|
||||
|
||||
@@ -822,7 +725,7 @@ void NoteDisplay::DrawHoldHead( const TapNote& tn, int iCol, int iRow, bool bIsB
|
||||
//
|
||||
// Draw the head
|
||||
//
|
||||
Actor* pActor = GetHoldHeadActor( NoteRowToBeat(iRow), tn.subType == TapNote::hold_head_roll, bIsBeingHeld );
|
||||
Actor *pActor = GetHoldActor( m_HoldHead, NotePart_HoldHead, NoteRowToBeat(iRow), tn.subType == TapNote::hold_head_roll, bIsBeingHeld );
|
||||
|
||||
pActor->SetZoom( ArrowEffects::GetZoom( m_pPlayerState ) );
|
||||
|
||||
@@ -1023,29 +926,29 @@ void NoteDisplay::DrawTap( int iCol, float fBeat, bool bOnSameRowAsHoldStart, bo
|
||||
|
||||
if( bIsLift )
|
||||
{
|
||||
pActor = GetTapLiftActor( fBeat );
|
||||
pActor = GetTapActor( m_TapLift, NotePart_Lift, fBeat );
|
||||
bUseLighting = cache->m_bTapLiftUseLighting;
|
||||
part = NotePart_Lift;
|
||||
}
|
||||
else if( bIsMine )
|
||||
{
|
||||
pActor = GetTapMineActor( fBeat );
|
||||
pActor = GetTapActor( m_TapMine, NotePart_Mine, fBeat );
|
||||
bUseLighting = cache->m_bTapMineUseLighting;
|
||||
part = NotePart_Mine;
|
||||
}
|
||||
else if( bIsAddition )
|
||||
{
|
||||
pActor = GetTapAdditionActor( fBeat );
|
||||
pActor = GetTapActor( m_TapAddition, NotePart_Addition, fBeat );
|
||||
bUseLighting = cache->m_bTapAdditionUseLighting;
|
||||
}
|
||||
else if( bOnSameRowAsHoldStart && cache->m_bDrawHoldHeadForTapsOnSameRow )
|
||||
{
|
||||
pActor = GetHoldHeadActor( fBeat, false, false );
|
||||
pActor = GetHoldActor( m_HoldHead, NotePart_HoldHead, fBeat, false, false );
|
||||
bUseLighting = cache->m_bHoldHeadUseLighting;
|
||||
}
|
||||
else
|
||||
{
|
||||
pActor = GetTapNoteActor( fBeat );
|
||||
pActor = GetTapActor( m_TapNote, NotePart_Tap, fBeat );
|
||||
bUseLighting = cache->m_bTapNoteUseLighting;
|
||||
}
|
||||
|
||||
@@ -1053,7 +956,7 @@ void NoteDisplay::DrawTap( int iCol, float fBeat, bool bOnSameRowAsHoldStart, bo
|
||||
}
|
||||
|
||||
/*
|
||||
* (c) 2001-2004 Brian Bugh, Ben Nordstrom, Chris Danford
|
||||
* (c) 2001-2006 Brian Bugh, Ben Nordstrom, Chris Danford, Steve Checkoway
|
||||
* All rights reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
|
||||
@@ -30,9 +30,9 @@ struct NoteColorActor
|
||||
NoteColorActor();
|
||||
~NoteColorActor();
|
||||
void Load( const RString &sButton, const RString &sElement );
|
||||
Actor* Get() { return m_p; }
|
||||
Actor *Get() { return m_p; }
|
||||
private:
|
||||
Actor* m_p;
|
||||
Actor *m_p;
|
||||
};
|
||||
|
||||
struct NoteColorSprite
|
||||
@@ -80,17 +80,11 @@ public:
|
||||
|
||||
bool DrawHoldHeadForTapsOnSameRow() const;
|
||||
|
||||
protected:
|
||||
private:
|
||||
void SetActiveFrame( float fNoteBeat, Actor &actorToSet, float fAnimationLengthInBeats, bool bVivid );
|
||||
Actor *GetTapNoteActor( float fNoteBeat );
|
||||
Actor *GetTapAdditionActor( float fNoteBeat );
|
||||
Actor *GetTapMineActor( float fNoteBeat );
|
||||
Actor *GetTapLiftActor( float fNoteBeat );
|
||||
Actor *GetHoldHeadActor( float fNoteBeat, bool bIsRoll, bool bIsBeingHeld );
|
||||
Actor *GetHoldTailActor( float fNoteBeat, bool bIsRoll, bool bIsBeingHeld );
|
||||
Sprite *GetHoldTopCapSprite( float fNoteBeat, bool bIsRoll, bool bIsBeingHeld );
|
||||
Sprite *GetHoldBodySprite( float fNoteBeat, bool bIsRoll, bool bIsBeingHeld );
|
||||
Sprite *GetHoldBottomCapSprite( float fNoteBeat, bool bIsRoll, bool bIsBeingHeld );
|
||||
Actor *GetTapActor( NoteColorActor &nca, NotePart part, float fNoteBeat );
|
||||
Actor *GetHoldActor( NoteColorActor nca[NUM_HOLD_TYPES][NUM_ACTIVE_TYPES], NotePart part, float fNoteBeat, bool bIsRoll, bool bIsBeingHeld );
|
||||
Sprite *GetHoldSprite( NoteColorSprite ncs[NUM_HOLD_TYPES][NUM_ACTIVE_TYPES], NotePart part, float fNoteBeat, bool bIsRoll, bool bIsBeingHeld );
|
||||
|
||||
void DrawHoldBottomCap( const TapNote& tn, int iCol, int iRow, bool bIsBeingHeld, float fYHead, float fYTail, int fYStep, float fPercentFadeToFail, float fColorScale, bool bGlow, float fYStartOffset, float fYEndOffset );
|
||||
void DrawHoldTopCap( const TapNote& tn, int iCol, int iRow, bool bIsBeingHeld, float fYHead, float fYTail, int fYStep, float fPercentFadeToFail, float fColorScale, bool bGlow, float fYStartOffset, float fYEndOffset );
|
||||
@@ -98,9 +92,8 @@ protected:
|
||||
void DrawHoldTail( const TapNote& tn, int iCol, int iRow, bool bIsBeingHeld, float fYTail, float fPercentFadeToFail, float fColorScale, bool bGlow, float fYStartOffset, float fYEndOffset );
|
||||
void DrawHoldHead( const TapNote& tn, int iCol, int iRow, bool bIsBeingHeld, float fYHead, float fPercentFadeToFail, float fColorScale, bool bGlow, float fYStartOffset, float fYEndOffset );
|
||||
|
||||
const PlayerState* m_pPlayerState; // to look up PlayerOptions
|
||||
|
||||
struct NoteMetricCache_t *cache;
|
||||
const PlayerState *m_pPlayerState; // to look up PlayerOptions
|
||||
NoteMetricCache_t *cache;
|
||||
|
||||
NoteColorActor m_TapNote;
|
||||
NoteColorActor m_TapAddition;
|
||||
@@ -117,7 +110,7 @@ protected:
|
||||
#endif
|
||||
|
||||
/*
|
||||
* (c) 2001-2004 Brian Bugh, Ben Nordstrom, Chris Danford
|
||||
* (c) 2001-2006 Brian Bugh, Ben Nordstrom, Chris Danford, Steve Checkoway
|
||||
* All rights reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
|
||||
Reference in New Issue
Block a user