00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef CHOOSER_H
00011 #define CHOOSER_H
00012
00013
00014
00015 #include "FighterEnum.h"
00016 #include "common.h"
00017 #include "SDL.h"
00018
00025 class CChooser
00026 {
00027 public:
00028 CChooser();
00029 ~CChooser();
00030
00031 void Start( SDL_Surface* m_poScreen );
00032 void Stop();
00033
00034 void Resize( int x1, int y1, int x2, int y2 );
00035 void Draw();
00036 void MarkFighter( FighterEnum a_enFighter, Uint32 a_iColor );
00037 SDL_Surface* GetPortrait( FighterEnum a_enFighter );
00038 void DrawPortrait( FighterEnum a_enFighter, SDL_Surface* a_poScreen, const SDL_Rect& a_roRect );
00039
00040 FighterEnum GetCurrentFighter( int a_iPlayer );
00041
00042 void MoveRectangle( int a_iPlayer, int a_iDirection );
00043 void SetRectangle( int a_iPlayer, FighterEnum a_enFighter );
00044 void SetRectangleVisible( int a_iPlayer, bool a_bVisible );
00045 bool IsRectangleVisible( int a_iPlayer );
00046 void DrawRectangles( int a_iStartingWith );
00047 SDL_Rect GetFighterRect( FighterEnum a_enFighter );
00048
00049 protected:
00050 void Init();
00051 int FighterToPosition( FighterEnum a_enFighter );
00052 FighterEnum PositionToFighter( int a_iPosition );
00053 SDL_Rect GetRect( int a_iPosition );
00054
00055 void ClearRectangle( int a_iPlayer );
00056 void DrawRectangle( int a_iPlayer );
00057 void DrawRectangle( int a_iPosition, Uint32 a_iColor );
00058
00059 protected:
00060 SDL_Surface* m_poScreen;
00061 FighterEnum m_aenFighters[100];
00062 SDL_Surface* m_apoPortraits[100];
00063 bool m_abRectangleVisible[MAXPLAYERS];
00064 int m_aiPlayerPosition[MAXPLAYERS];
00065 Uint32 m_aiColors[MAXPLAYERS];
00066
00067 int x1, y1, x2, y2;
00068
00069 int m_iNumberOfFighters;
00070 int m_iRows;
00071 int m_iCols;
00072
00073 };
00074
00075 extern CChooser g_oChooser;
00076
00077 #endif // CHOOSER_H