Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

NoteField.h

Go to the documentation of this file.
00001 /* NoteField - renders a NoteData */ 00002 00003 #ifndef NOTE_FIELD_H 00004 #define NOTE_FIELD_H 00005 00006 #include "Sprite.h" 00007 #include "ActorFrame.h" 00008 #include "BitmapText.h" 00009 #include "PrefsManager.h" 00010 #include "BitmapText.h" 00011 #include "Quad.h" 00012 #include "NoteData.h" 00013 #include "NoteDisplay.h" 00014 #include "ReceptorArrowRow.h" 00015 #include "GhostArrowRow.h" 00016 00017 class NoteField : public ActorFrame 00018 { 00019 public: 00020 NoteField(); 00021 ~NoteField(); 00022 virtual void Update( float fDeltaTime ); 00023 virtual void DrawPrimitives(); 00024 00025 virtual void Load( 00026 const NoteData* pNoteData, 00027 const PlayerState* pPlayerState, 00028 int iStartDrawingPixel, 00029 int iEndDrawingPixel, 00030 float fYReverseOffsetPixels ); 00031 virtual void Unload(); 00032 00033 int m_iBeginMarker, m_iEndMarker; // only used with MODE_EDIT 00034 00035 void FadeToFail(); 00036 void CacheAllUsedNoteSkins( bool bDeleteUnused ); 00037 void CacheNoteSkin( CString skin ); 00038 00039 void Step( int iCol, TapNoteScore score ); 00040 void SetPressed( int iCol ); 00041 void DidTapNote( int iCol, TapNoteScore score, bool bBright ); 00042 void DidHoldNote( int iCol ); 00043 00044 00045 protected: 00046 void DrawBeatBar( const float fBeat ); 00047 void DrawMarkerBar( int fBeat ); 00048 void DrawAreaHighlight( int iStartBeat, int iEndBeat ); 00049 void DrawBPMText( const float fBeat, const float fBPM ); 00050 void DrawFreezeText( const float fBeat, const float fBPM ); 00051 void DrawBGChangeText( const float fBeat, const CString sNewBGName ); 00052 float GetWidth(); 00053 00054 void RefreshBeatToNoteSkin(); 00055 00056 const NoteData *m_pNoteData; 00057 00058 float m_fPercentFadeToFail; // -1 of not fading to fail 00059 00060 const PlayerState* m_pPlayerState; 00061 int m_iStartDrawingPixel; // this should be a negative number 00062 int m_iEndDrawingPixel; // this should be a positive number 00063 float m_fYReverseOffsetPixels; 00064 00065 // color arrows 00066 struct NoteDisplayCols 00067 { 00068 NoteDisplay *display; 00069 ReceptorArrowRow m_ReceptorArrowRow; 00070 GhostArrowRow m_GhostArrowRow; 00071 NoteDisplayCols( int iNumCols ) { display = new NoteDisplay[iNumCols]; } 00072 ~NoteDisplayCols() { delete [] display; } 00073 }; 00074 00075 /* All loaded note displays, mapped by their name. */ 00076 map<CString, NoteDisplayCols *> m_NoteDisplays; 00077 00078 int m_LastSeenBeatToNoteSkinRev; 00079 00080 /* Map of beat->NoteDisplayCols. This is updated whenever GAMESTATE-> changes. */ 00081 typedef map<float, NoteDisplayCols *> NDMap; 00082 void SearchForBeat( NDMap::iterator &cur, NDMap::iterator &next, float Beat ); 00083 NoteDisplayCols *SearchForBeat( float Beat ); 00084 NoteDisplayCols *SearchForSongBeat(); 00085 00086 NDMap m_BeatToNoteDisplays; 00087 00088 NoteDisplayCols *LastDisplay; 00089 00090 // used in MODE_EDIT 00091 Sprite m_sprBars; // 4 frames: Measure, 4th, 8th, 16th 00092 BitmapText m_textMeasureNumber; 00093 Quad m_rectMarkerBar; 00094 Quad m_rectAreaHighlight; 00095 }; 00096 00097 #endif 00098 00099 /* 00100 * (c) 2001-2004 Chris Danford 00101 * All rights reserved. 00102 * 00103 * Permission is hereby granted, free of charge, to any person obtaining a 00104 * copy of this software and associated documentation files (the 00105 * "Software"), to deal in the Software without restriction, including 00106 * without limitation the rights to use, copy, modify, merge, publish, 00107 * distribute, and/or sell copies of the Software, and to permit persons to 00108 * whom the Software is furnished to do so, provided that the above 00109 * copyright notice(s) and this permission notice appear in all copies of 00110 * the Software and that both the above copyright notice(s) and this 00111 * permission notice appear in supporting documentation. 00112 * 00113 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00114 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00115 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF 00116 * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS 00117 * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT 00118 * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 00119 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 00120 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 00121 * PERFORMANCE OF THIS SOFTWARE. 00122 */

Generated on Thu Jan 27 20:57:26 2005 for StepMania by doxygen 1.3.7