123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217 |
- #ifndef MECHICON_H
- #define MECHICON_H
- /*************************************************************************************************\
- MechIcon.h : Interface for the MechIcon component.
- //---------------------------------------------------------------------------//
- // Copyright (C) Microsoft Corporation. All rights reserved. //
- //===========================================================================//
- \*************************************************************************************************/
- #ifndef MCLIB_H
- #include "McLib.h"
- #endif
- #ifndef AFONT_H
- #include "aFont.h"
- #endif
- #ifndef MC2movie_H
- #include "mc2movie.h"
- #endif
- //*************************************************************************************************
- class Mover;
- class MechWarrior;
- #define NUM_DEATH_INFOS 6
- /**************************************************************************************************
- CLASS DESCRIPTION
- MechIcon:
- **************************************************************************************************/
- class PilotIcon
- {
- public:
- static const long DEAD_PILOT_INDEX;
- PilotIcon();
- static void swapResolutions(bool bForce = 0);
- void setPilot( MechWarrior* pWarrior );
- void setTextureIndex( int newIndex ) { pilotTextureIndex = newIndex; }
- void render( float left, float top, float right, float bottom );
- private:
- unsigned long pilotTextureIndex;
-
- static float pilotIconX;
- static float pilotIconY;
- static unsigned long s_pilotTextureHandle;
- static unsigned long s_pilotTextureWidth;
- friend class ForceGroupIcon;
- friend class MechIcon;
- friend class Mission;
- };
- class ForceGroupIcon
- {
- public:
- ForceGroupIcon();
- virtual ~ForceGroupIcon();
- virtual void update() = 0;
- virtual void render();
- void renderUnitIcon( float left, float top, float right, float bottom );
- virtual void renderUnitIconBack( float left, float top, float right, float bottom );
- void renderPilotIcon( float left, float top, float right, float bottom );
- virtual bool init( Mover* pMover ){ return false; }
- void init();
-
- bool inRegion( int x, int y );
- void click( bool shiftDn );
- void rightClick();
- virtual void setDrawBack( bool bSet) { };
- static int __cdecl sort( const void* p1, const void* p2 );
- const char* getPilotName();
- static void init( FitIniFile& file, int which );
- void swapResolutions(bool bForce);
- static void resetResolution(bool bForce);
- void setLocationIndex( int i );
- void beginDeathAnimation( ){ deathAnimationTime = .0001f; }
- bool deathAnimationOver(){ return deathAnimationTime > animationInfos[NUM_DEATH_INFOS-1].time; }
- bool isAnimatingDeath() { return deathAnimationTime ? 1 : 0; }
- protected:
- static long damageColors[4][3];
- static unsigned long s_textureHandle[5];
- static bool s_slotUsed[240];
- static TGAFileHeader* s_textureMemory;
- static float unitIconX;
- static float unitIconY;
- static int curScreenWidth;
- static StaticInfo* jumpJetIcon;
- static aFont* gosFontHandle;
-
- static gos_VERTEX bmpLocation[17][5]; // in screen coords
-
- static GUI_RECT textArea[17];
- static GUI_RECT pilotRect[17];
- static GUI_RECT selectionRect[17];
- static GUI_RECT healthBar[17];
- static long pilotTextTop[17];
- static float pilotLocation[17][4];
- Mover* unit;
- static long ForceGroupColors[11];
- void drawBar( float barStatus );
- static void setIconVariables();
- friend class ForceGroupBar;
- friend void TerminateGameEngine(void);
- bool bDrawBack;
- int damageIconIndex;
- int backDamageIndex;
- int locationIndex;
- float deathAnimationTime;
- struct AnimationInfo
- {
- float time;
- long color;
- };
- static AnimationInfo animationInfos[NUM_DEATH_INFOS];
- void drawDeathEffect();
- PilotIcon pilotIcon;
- float msgPlayTime;
- static MC2MoviePtr bMovie;
- static DWORD pilotVideoTexture;
- static MechWarrior* pilotVideoPilot;
-
- };
- class MechIcon : public ForceGroupIcon
- {
- public:
- MechIcon(){}
- ~MechIcon(){}
- virtual bool init( Mover* pMover );
- virtual void update();
- static TGAFileHeader* s_MechTextures;
- void doDraw( char* newDamage, char* oldDamage, unsigned long handle, unsigned long where);
- virtual void setDrawBack( bool bSet);
-
-
- private:
- char damage[8];
- char backDamage[8];
- bool init( long whichIndex );
- bool initTextures();
-
- };
- class VehicleIcon : public ForceGroupIcon
- {
- public:
- VehicleIcon(){}
- ~VehicleIcon(){}
- virtual void renderUnitIconBack( float left, float top, float right, float bottom ){}
- virtual void update();
- virtual bool init( Mover* pMover );
- static TGAFileHeader* s_VehicleTextures;
- private:
- char damage[5];
- };
- //*************************************************************************************************
- #endif // end of file ( MechIcon.h )
|