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

LifeMeterBar.h

Go to the documentation of this file.
00001 #ifndef LIFEMETERBAR_H 00002 #define LIFEMETERBAR_H 00003 00004 #include "LifeMeter.h" 00005 #include "Sprite.h" 00006 #include "Quad.h" 00007 class LifeMeterStream; 00008 00009 00010 class LifeMeterBar : public LifeMeter 00011 { 00012 public: 00013 LifeMeterBar(); 00014 ~LifeMeterBar(); 00015 00016 virtual void Load( PlayerNumber pn ); 00017 00018 virtual void Update( float fDeltaTime ); 00019 virtual void DrawPrimitives(); 00020 00021 virtual void ChangeLife( TapNoteScore score ); 00022 virtual void ChangeLife( HoldNoteScore score, TapNoteScore tscore ); 00023 virtual void ChangeLife( float fDeltaLifePercent ); 00024 virtual void ChangeLifeMine(); 00025 virtual void AfterLifeChanged(); 00026 virtual void OnDancePointsChange() {}; // this life meter doesn't care 00027 virtual bool IsInDanger() const; 00028 virtual bool IsPastPassmark() const; 00029 virtual bool IsHot() const; 00030 virtual bool IsFailing() const; 00031 virtual float GetLife() const { return m_fLifePercentage; } 00032 00033 void UpdateNonstopLifebar(int cleared, int total, int ProgressiveLifebarDifficulty); 00034 void FillForHowToPlay(int NumPerfects, int NumMisses); 00035 // this function is solely for HowToPlay 00036 00037 private: 00038 void ResetBarVelocity(); 00039 00040 Quad m_quadBlackBackground; 00041 LifeMeterStream* m_pStream; 00042 00043 float m_fLifePercentage; 00044 float m_fTrailingLifePercentage; // this approaches m_fLifePercentage 00045 float m_fLifeVelocity; 00046 00047 float m_fPassingAlpha; 00048 float m_fHotAlpha; 00049 bool m_bFailedEarlier; // set this to true when life dips below 0 00050 00051 float m_fBaseLifeDifficulty; 00052 float m_fLifeDifficulty; // essentially same as pref 00053 00054 int m_iProgressiveLifebar; // cached from prefs 00055 int m_iMissCombo; // current number of progressive boo/miss 00056 00057 int m_iComboToRegainLife; // combo needed before lifebar starts filling up after fail 00058 }; 00059 00060 #endif 00061 00062 /* 00063 * (c) 2001-2004 Chris Danford 00064 * All rights reserved. 00065 * 00066 * Permission is hereby granted, free of charge, to any person obtaining a 00067 * copy of this software and associated documentation files (the 00068 * "Software"), to deal in the Software without restriction, including 00069 * without limitation the rights to use, copy, modify, merge, publish, 00070 * distribute, and/or sell copies of the Software, and to permit persons to 00071 * whom the Software is furnished to do so, provided that the above 00072 * copyright notice(s) and this permission notice appear in all copies of 00073 * the Software and that both the above copyright notice(s) and this 00074 * permission notice appear in supporting documentation. 00075 * 00076 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00077 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00078 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF 00079 * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS 00080 * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT 00081 * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 00082 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 00083 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 00084 * PERFORMANCE OF THIS SOFTWARE. 00085 */

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