To The Flag by ML (mlefebvre.fr)
play.h
Go to the documentation of this file.
1 
9 #ifndef H_PLAY
10 #define H_PLAY
11 
26  typedef struct
27  {
28  SDL_Surface *background;
29  SDL_Surface *object;
30  SDL_Surface *flag;
31  SDL_Surface *point;
32  SDL_Surface *line;
33  SDL_Rect pBackground;
34  SDL_Rect pObject;
35  SDL_Rect pFlag;
36  SDL_Rect pPoint;
37  SDL_Rect pLine;
38  }LAYOUT;
39 
53  typedef struct
54  {
55  TTF_Font *font;
56  const char* fontPath;
57  SDL_Color fontColor;
58  SDL_Surface *angle;
59  SDL_Surface *speed;
60  SDL_Rect pAngle;
61  SDL_Rect pSpeed;
62  char tAngle[30];
63  char tSpeed[30];
64  }LAYOUT_TEXT;
65 
75  typedef struct
76  {
77  TTF_Font *font;
78  const char* fontPath;
79  SDL_Color fontColor;
80  SDL_Surface *text;
81  SDL_Rect pText;
82  }SUCCESS_TEXT;
83 
84 
85  void playGame(SDL_Surface *w);
86 
96  int shoot(SDL_Surface *w, LAYOUT *l, float a, float sp);
97 
103  void loadFont(LAYOUT_TEXT *t, SUCCESS_TEXT *s);
104 
111  void setParameters(LAYOUT_TEXT *t, float a, float sp);
112 
117  void loadLayout(LAYOUT *l);
118 
123  void reloadLayout(LAYOUT *l);
124 
130  void drawLayout(SDL_Surface *w, LAYOUT *l);
131 
140  void drawLine(LAYOUT *l, float a);
141 
147  void drawText(SDL_Surface *w, LAYOUT_TEXT *t);
148 
155  void drawResult(SDL_Surface *w, SUCCESS_TEXT *s, int result);
156 
163  void cleanUp(LAYOUT *l, LAYOUT_TEXT *t, SUCCESS_TEXT *s);
164 
165 #endif // H_PLAY
void loadFont(LAYOUT_TEXT *t, SUCCESS_TEXT *s)
Definition: play.c:165
void setParameters(LAYOUT_TEXT *t, float a, float sp)
Definition: play.c:191
void playGame(SDL_Surface *w)
Definition: play.c:23
void drawText(SDL_Surface *w, LAYOUT_TEXT *t)
Definition: play.c:268
void drawLine(LAYOUT *l, float a)
Definition: play.c:253
void cleanUp(LAYOUT *l, LAYOUT_TEXT *t, SUCCESS_TEXT *s)
Definition: play.c:300
void drawLayout(SDL_Surface *w, LAYOUT *l)
Definition: play.c:242
void drawResult(SDL_Surface *w, SUCCESS_TEXT *s, int result)
Definition: play.c:276
int shoot(SDL_Surface *w, LAYOUT *l, float a, float sp)
Definition: play.c:97
Definition: play.h:26
void reloadLayout(LAYOUT *l)
Definition: play.c:234
void loadLayout(LAYOUT *l)
Definition: play.c:199