2004-06-08 00:08:04 +00:00
|
|
|
/* NoteDisplay - Draws TapNotes and HoldNotes. */
|
|
|
|
|
|
2006-08-14 13:15:47 +00:00
|
|
|
#ifndef NOTE_DISPLAY_H
|
|
|
|
|
#define NOTE_DISPLAY_H
|
2002-08-13 23:26:46 +00:00
|
|
|
|
2006-08-14 13:15:47 +00:00
|
|
|
class Actor;
|
|
|
|
|
class Sprite;
|
2004-08-19 01:07:19 +00:00
|
|
|
class Model;
|
2006-08-14 13:15:47 +00:00
|
|
|
class PlayerState;
|
|
|
|
|
struct TapNote;
|
2004-05-07 04:57:29 +00:00
|
|
|
struct HoldNoteResult;
|
2003-02-08 23:47:47 +00:00
|
|
|
struct NoteMetricCache_t;
|
|
|
|
|
|
2005-10-04 19:45:45 +00:00
|
|
|
enum NotePart
|
|
|
|
|
{
|
|
|
|
|
NotePart_Tap,
|
|
|
|
|
NotePart_Mine,
|
2006-08-14 12:16:31 +00:00
|
|
|
NotePart_Lift,
|
2009-03-15 04:49:38 +00:00
|
|
|
NotePart_Fake,
|
2005-10-04 19:45:45 +00:00
|
|
|
NotePart_HoldHead,
|
|
|
|
|
NotePart_HoldTail,
|
|
|
|
|
NotePart_HoldTopCap,
|
|
|
|
|
NotePart_HoldBody,
|
|
|
|
|
NotePart_HoldBottomCap,
|
|
|
|
|
NUM_NotePart
|
|
|
|
|
};
|
|
|
|
|
|
2006-11-02 06:47:48 +00:00
|
|
|
struct NoteResource;
|
|
|
|
|
|
2005-04-17 00:39:09 +00:00
|
|
|
struct NoteColorActor
|
|
|
|
|
{
|
|
|
|
|
NoteColorActor();
|
|
|
|
|
~NoteColorActor();
|
2006-01-22 01:00:06 +00:00
|
|
|
void Load( const RString &sButton, const RString &sElement );
|
2006-11-02 06:47:48 +00:00
|
|
|
Actor *Get();
|
2005-04-17 00:39:09 +00:00
|
|
|
private:
|
2006-11-02 06:47:48 +00:00
|
|
|
NoteResource *m_p;
|
2005-04-17 00:39:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct NoteColorSprite
|
|
|
|
|
{
|
|
|
|
|
NoteColorSprite();
|
|
|
|
|
~NoteColorSprite();
|
2006-01-22 01:00:06 +00:00
|
|
|
void Load( const RString &sButton, const RString &sElement );
|
2006-11-02 06:47:48 +00:00
|
|
|
Sprite *Get();
|
2005-04-17 00:39:09 +00:00
|
|
|
private:
|
2006-11-02 06:47:48 +00:00
|
|
|
NoteResource *m_p;
|
2005-04-17 00:39:09 +00:00
|
|
|
};
|
|
|
|
|
|
2005-10-05 05:00:50 +00:00
|
|
|
enum HoldType
|
|
|
|
|
{
|
|
|
|
|
hold,
|
|
|
|
|
roll,
|
2006-09-26 21:05:49 +00:00
|
|
|
NUM_HoldType,
|
|
|
|
|
HoldType_Invalid
|
2005-10-05 05:00:50 +00:00
|
|
|
};
|
2006-10-07 08:56:58 +00:00
|
|
|
#define FOREACH_HoldType( i ) FOREACH_ENUM( HoldType, i )
|
2006-01-22 01:00:06 +00:00
|
|
|
const RString &HoldTypeToString( HoldType ht );
|
2005-04-18 01:19:56 +00:00
|
|
|
|
2005-10-05 05:00:50 +00:00
|
|
|
enum ActiveType
|
|
|
|
|
{
|
|
|
|
|
active,
|
|
|
|
|
inactive,
|
2006-09-26 21:05:49 +00:00
|
|
|
NUM_ActiveType,
|
|
|
|
|
ActiveType_Invalid
|
2005-10-05 05:00:50 +00:00
|
|
|
};
|
2006-10-07 08:56:58 +00:00
|
|
|
#define FOREACH_ActiveType( i ) FOREACH_ENUM( ActiveType, i )
|
2006-01-22 01:00:06 +00:00
|
|
|
const RString &ActiveTypeToString( ActiveType at );
|
2005-04-18 01:19:56 +00:00
|
|
|
|
|
|
|
|
|
2002-08-13 23:26:46 +00:00
|
|
|
class NoteDisplay
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
NoteDisplay();
|
2003-02-08 23:47:47 +00:00
|
|
|
~NoteDisplay();
|
2002-08-13 23:26:46 +00:00
|
|
|
|
2005-04-18 01:19:56 +00:00
|
|
|
void Load( int iColNum, const PlayerState* pPlayerState, float fYReverseOffsetPixels );
|
2002-08-13 23:26:46 +00:00
|
|
|
|
2004-08-21 00:34:24 +00:00
|
|
|
static void Update( float fDeltaTime );
|
2004-03-01 05:58:19 +00:00
|
|
|
|
2007-01-04 00:45:47 +00:00
|
|
|
void DrawTap( const TapNote& tn, int iCol, float fBeat, bool bOnSameRowAsHoldStart, bool bIsAddition,
|
2007-01-07 02:40:10 +00:00
|
|
|
float fPercentFadeToFail, float fReverseOffsetPixels, float fDrawDistanceAfterTargetsPixels, float fDrawDistanceBeforeTargetsPixels, float fFadeInPercentOfDrawFar );
|
2007-01-06 21:18:19 +00:00
|
|
|
void DrawHold( const TapNote& tn, int iCol, int iRow, bool bIsBeingHeld, const HoldNoteResult &Result,
|
2007-01-06 21:28:55 +00:00
|
|
|
bool bIsAddition, float fPercentFadeToFail, float fReverseOffsetPixels, float fDrawDistanceAfterTargetsPixels, float fDrawDistanceBeforeTargetsPixels,
|
2006-11-13 06:12:38 +00:00
|
|
|
float fDrawDistanceBeforeTargetsPixels2, float fFadeInPercentOfDrawFar );
|
2005-01-22 05:00:33 +00:00
|
|
|
|
|
|
|
|
bool DrawHoldHeadForTapsOnSameRow() const;
|
2002-08-13 23:26:46 +00:00
|
|
|
|
2006-08-14 13:10:52 +00:00
|
|
|
private:
|
2005-10-04 19:45:45 +00:00
|
|
|
void SetActiveFrame( float fNoteBeat, Actor &actorToSet, float fAnimationLengthInBeats, bool bVivid );
|
2006-08-14 13:10:52 +00:00
|
|
|
Actor *GetTapActor( NoteColorActor &nca, NotePart part, float fNoteBeat );
|
2006-11-03 03:47:33 +00:00
|
|
|
Actor *GetHoldActor( NoteColorActor nca[NUM_HoldType][NUM_ActiveType], NotePart part, float fNoteBeat, bool bIsRoll, bool bIsBeingHeld );
|
|
|
|
|
Sprite *GetHoldSprite( NoteColorSprite ncs[NUM_HoldType][NUM_ActiveType], NotePart part, float fNoteBeat, bool bIsRoll, bool bIsBeingHeld );
|
|
|
|
|
|
2007-01-07 02:36:51 +00:00
|
|
|
void DrawActor( const TapNote& tn, Actor* pActor, NotePart part, int iCol, float fYOffset, float fBeat, bool bIsAddition, float fPercentFadeToFail,
|
2007-04-10 16:40:47 +00:00
|
|
|
float fReverseOffsetPixels, float fColorScale, float fDrawDistanceAfterTargetsPixels, float fDrawDistanceBeforeTargetsPixels, float fFadeInPercentOfDrawFar );
|
2007-01-06 21:23:07 +00:00
|
|
|
void DrawHoldBody( const TapNote& tn, int iCol, float fBeat, bool bIsBeingHeld, float fYHead, float fYTail, bool bIsAddition, float fPercentFadeToFail,
|
2006-11-13 02:27:23 +00:00
|
|
|
float fColorScale,
|
2007-01-06 08:33:08 +00:00
|
|
|
bool bGlow, float fDrawDistanceAfterTargetsPixels, float fDrawDistanceBeforeTargetsPixels, float fFadeInPercentOfDrawFar );
|
2008-03-12 23:17:39 +00:00
|
|
|
void DrawHoldPart( vector<Sprite*> &vpSpr, int iCol, int fYStep, float fXOffset, float fPercentFadeToFail, float fColorScale, bool bGlow,
|
2007-01-16 00:46:16 +00:00
|
|
|
float fDrawDistanceAfterTargetsPixels, float fDrawDistanceBeforeTargetsPixels, float fFadeInPercentOfDrawFar, float fOverlappedTime,
|
2007-01-11 03:10:36 +00:00
|
|
|
float fYTop, float fYBottom, float fYStartPos, float fYEndPos, bool bWrapping, bool bAnchorToTop, bool bFlipTextureVertically );
|
2003-07-17 06:10:25 +00:00
|
|
|
|
2006-08-14 13:10:52 +00:00
|
|
|
const PlayerState *m_pPlayerState; // to look up PlayerOptions
|
|
|
|
|
NoteMetricCache_t *cache;
|
2003-02-08 23:47:47 +00:00
|
|
|
|
2005-04-17 00:39:09 +00:00
|
|
|
NoteColorActor m_TapNote;
|
|
|
|
|
NoteColorActor m_TapMine;
|
2006-08-14 12:16:31 +00:00
|
|
|
NoteColorActor m_TapLift;
|
2009-03-10 15:52:22 +00:00
|
|
|
NoteColorActor m_TapFake;
|
2006-09-26 21:05:49 +00:00
|
|
|
NoteColorActor m_HoldHead[NUM_HoldType][NUM_ActiveType];
|
|
|
|
|
NoteColorSprite m_HoldTopCap[NUM_HoldType][NUM_ActiveType];
|
|
|
|
|
NoteColorSprite m_HoldBody[NUM_HoldType][NUM_ActiveType];
|
|
|
|
|
NoteColorSprite m_HoldBottomCap[NUM_HoldType][NUM_ActiveType];
|
|
|
|
|
NoteColorActor m_HoldTail[NUM_HoldType][NUM_ActiveType];
|
2006-08-14 12:16:31 +00:00
|
|
|
float m_fYReverseOffsetPixels;
|
2002-08-13 23:26:46 +00:00
|
|
|
};
|
2002-11-16 08:07:38 +00:00
|
|
|
|
|
|
|
|
#endif
|
2004-06-08 00:08:04 +00:00
|
|
|
|
|
|
|
|
/*
|
2006-08-14 13:10:52 +00:00
|
|
|
* (c) 2001-2006 Brian Bugh, Ben Nordstrom, Chris Danford, Steve Checkoway
|
2004-06-08 00:08:04 +00:00
|
|
|
* All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
|
* copy of this software and associated documentation files (the
|
|
|
|
|
* "Software"), to deal in the Software without restriction, including
|
|
|
|
|
* without limitation the rights to use, copy, modify, merge, publish,
|
|
|
|
|
* distribute, and/or sell copies of the Software, and to permit persons to
|
|
|
|
|
* whom the Software is furnished to do so, provided that the above
|
|
|
|
|
* copyright notice(s) and this permission notice appear in all copies of
|
|
|
|
|
* the Software and that both the above copyright notice(s) and this
|
|
|
|
|
* permission notice appear in supporting documentation.
|
|
|
|
|
*
|
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
|
|
|
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
|
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
|
|
|
|
|
* THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
|
|
|
|
|
* INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
|
|
|
|
|
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
|
|
|
|
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
|
|
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
|
|
|
* PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
|
*/
|