2005-02-13 03:40:37 +00:00
|
|
|
/* NoteField - An Actor that renders a NoteData. */
|
2005-01-15 02:14:09 +00:00
|
|
|
|
2005-01-22 02:50:45 +00:00
|
|
|
#ifndef NOTE_FIELD_H
|
|
|
|
|
#define NOTE_FIELD_H
|
2002-04-16 17:31:00 +00:00
|
|
|
|
|
|
|
|
#include "Sprite.h"
|
|
|
|
|
#include "ActorFrame.h"
|
|
|
|
|
#include "BitmapText.h"
|
2002-05-19 01:59:48 +00:00
|
|
|
#include "Quad.h"
|
2005-01-22 18:21:06 +00:00
|
|
|
#include "NoteData.h"
|
2002-08-13 23:26:46 +00:00
|
|
|
#include "NoteDisplay.h"
|
2003-12-22 10:30:10 +00:00
|
|
|
#include "ReceptorArrowRow.h"
|
2003-11-27 05:18:28 +00:00
|
|
|
#include "GhostArrowRow.h"
|
2002-04-16 17:31:00 +00:00
|
|
|
|
2005-01-22 02:50:45 +00:00
|
|
|
class NoteField : public ActorFrame
|
2002-04-16 17:31:00 +00:00
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
NoteField();
|
2003-09-12 06:23:51 +00:00
|
|
|
~NoteField();
|
2002-07-28 20:28:37 +00:00
|
|
|
virtual void Update( float fDeltaTime );
|
2005-10-10 04:07:21 +00:00
|
|
|
virtual void ProcessMessages( float fDeltaTime );
|
2002-05-19 01:59:48 +00:00
|
|
|
virtual void DrawPrimitives();
|
2002-04-16 17:31:00 +00:00
|
|
|
|
2005-03-18 04:43:59 +00:00
|
|
|
virtual void Init( const PlayerState* pPlayerState, float fYReverseOffsetPixels );
|
2004-12-20 06:25:59 +00:00
|
|
|
virtual void Load(
|
|
|
|
|
const NoteData* pNoteData,
|
|
|
|
|
int iStartDrawingPixel,
|
2005-03-18 04:43:59 +00:00
|
|
|
int iEndDrawingPixel );
|
2003-09-12 06:23:51 +00:00
|
|
|
virtual void Unload();
|
2002-04-16 17:31:00 +00:00
|
|
|
|
2005-01-23 23:17:12 +00:00
|
|
|
int m_iBeginMarker, m_iEndMarker; // only used with MODE_EDIT
|
2002-04-16 17:31:00 +00:00
|
|
|
|
2002-08-01 21:55:40 +00:00
|
|
|
void FadeToFail();
|
2005-04-18 01:19:56 +00:00
|
|
|
void CacheNoteSkin( const CString &sNoteSkin );
|
2002-06-27 17:49:10 +00:00
|
|
|
|
2004-07-02 20:08:17 +00:00
|
|
|
void Step( int iCol, TapNoteScore score );
|
2003-12-22 10:30:10 +00:00
|
|
|
void SetPressed( int iCol );
|
2003-11-28 00:45:31 +00:00
|
|
|
void DidTapNote( int iCol, TapNoteScore score, bool bBright );
|
2005-04-26 05:28:32 +00:00
|
|
|
void DidHoldNote( int iCol, HoldNoteScore score, bool bBright );
|
2003-11-27 05:18:28 +00:00
|
|
|
|
2005-07-21 01:02:21 +00:00
|
|
|
const PlayerState *GetPlayerState() const { return m_pPlayerState; }
|
2005-03-12 05:04:24 +00:00
|
|
|
void RefreshBeatToNoteSkin();
|
2003-08-16 23:34:47 +00:00
|
|
|
|
2002-04-16 17:31:00 +00:00
|
|
|
protected:
|
2005-03-18 04:58:15 +00:00
|
|
|
void CacheAllUsedNoteSkins();
|
|
|
|
|
|
2005-04-19 04:04:37 +00:00
|
|
|
bool IsOnScreen( float fBeat, int iFirstPixelToDraw, int iLastPixelToDraw );
|
|
|
|
|
|
2003-02-18 23:15:38 +00:00
|
|
|
void DrawBeatBar( const float fBeat );
|
2005-01-23 23:17:12 +00:00
|
|
|
void DrawMarkerBar( int fBeat );
|
|
|
|
|
void DrawAreaHighlight( int iStartBeat, int iEndBeat );
|
2002-08-23 20:18:29 +00:00
|
|
|
void DrawBPMText( const float fBeat, const float fBPM );
|
|
|
|
|
void DrawFreezeText( const float fBeat, const float fBPM );
|
2005-07-30 19:32:31 +00:00
|
|
|
void DrawAttackText( const float fBeat, const Attack &attack );
|
2002-08-23 20:18:29 +00:00
|
|
|
void DrawBGChangeText( const float fBeat, const CString sNewBGName );
|
2003-02-19 07:59:00 +00:00
|
|
|
float GetWidth();
|
2002-04-16 17:31:00 +00:00
|
|
|
|
2005-01-22 02:50:45 +00:00
|
|
|
const NoteData *m_pNoteData;
|
|
|
|
|
|
2002-08-01 21:55:40 +00:00
|
|
|
float m_fPercentFadeToFail; // -1 of not fading to fail
|
|
|
|
|
|
2004-12-20 06:25:59 +00:00
|
|
|
const PlayerState* m_pPlayerState;
|
2003-08-16 23:34:47 +00:00
|
|
|
int m_iStartDrawingPixel; // this should be a negative number
|
|
|
|
|
int m_iEndDrawingPixel; // this should be a positive number
|
2003-08-18 17:19:34 +00:00
|
|
|
float m_fYReverseOffsetPixels;
|
2002-04-16 17:31:00 +00:00
|
|
|
|
|
|
|
|
// color arrows
|
2003-09-12 06:23:51 +00:00
|
|
|
struct NoteDisplayCols
|
|
|
|
|
{
|
2004-07-27 04:34:06 +00:00
|
|
|
NoteDisplay *display;
|
2003-12-22 10:30:10 +00:00
|
|
|
ReceptorArrowRow m_ReceptorArrowRow;
|
2003-11-28 00:45:31 +00:00
|
|
|
GhostArrowRow m_GhostArrowRow;
|
2004-07-27 04:34:06 +00:00
|
|
|
NoteDisplayCols( int iNumCols ) { display = new NoteDisplay[iNumCols]; }
|
|
|
|
|
~NoteDisplayCols() { delete [] display; }
|
2003-09-12 06:23:51 +00:00
|
|
|
};
|
2003-11-28 00:45:31 +00:00
|
|
|
|
2003-09-12 06:23:51 +00:00
|
|
|
/* All loaded note displays, mapped by their name. */
|
|
|
|
|
map<CString, NoteDisplayCols *> m_NoteDisplays;
|
|
|
|
|
|
|
|
|
|
int m_LastSeenBeatToNoteSkinRev;
|
|
|
|
|
|
|
|
|
|
/* Map of beat->NoteDisplayCols. This is updated whenever GAMESTATE-> changes. */
|
|
|
|
|
typedef map<float, NoteDisplayCols *> NDMap;
|
|
|
|
|
void SearchForBeat( NDMap::iterator &cur, NDMap::iterator &next, float Beat );
|
2003-11-28 00:45:31 +00:00
|
|
|
NoteDisplayCols *SearchForBeat( float Beat );
|
|
|
|
|
NoteDisplayCols *SearchForSongBeat();
|
2003-09-12 06:23:51 +00:00
|
|
|
|
2003-11-28 00:45:31 +00:00
|
|
|
NDMap m_BeatToNoteDisplays;
|
2003-11-27 05:18:28 +00:00
|
|
|
|
2003-11-28 23:27:12 +00:00
|
|
|
NoteDisplayCols *LastDisplay;
|
|
|
|
|
|
2002-04-16 17:31:00 +00:00
|
|
|
// used in MODE_EDIT
|
2003-02-22 00:22:27 +00:00
|
|
|
Sprite m_sprBars; // 4 frames: Measure, 4th, 8th, 16th
|
2002-04-16 17:31:00 +00:00
|
|
|
BitmapText m_textMeasureNumber;
|
2002-06-14 22:25:22 +00:00
|
|
|
Quad m_rectMarkerBar;
|
2003-02-18 23:15:38 +00:00
|
|
|
Quad m_rectAreaHighlight;
|
2002-04-16 17:31:00 +00:00
|
|
|
};
|
2002-11-16 08:07:38 +00:00
|
|
|
|
|
|
|
|
#endif
|
2004-06-08 00:08:04 +00:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* (c) 2001-2004 Chris Danford
|
|
|
|
|
* 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.
|
|
|
|
|
*/
|