Browse Source

GUI : header pour la fonction animsg

master
Nikos 8 years ago
parent
commit
0565e78ac4
2 changed files with 9 additions and 5 deletions
  1. +6
    -2
      gui.h
  2. +3
    -3
      main.c

+ 6
- 2
gui.h View File

@ -8,10 +8,14 @@ SDL_Event display_until_event(struct gui_resource_t res);
void display_render_board(struct gui_resource_t res, struct game_state_t gamestate, enum hole_t currentplayer);
/* les fonctions display_ani* retournent 1 si l'utilisateur ferme l'application, sinon 0 */
int display_animsg(struct gui_resource_t res, struct game_state_t gamestate, enum hole_t currentplayer, const char *msg, uint32_t duration);
int display_anirotate_board(struct gui_resource_t res, struct game_state_t gamestate, enum hole_t currentplayer, enum hole_t nextplayer);
/* retourne 1 si l'animation a été interrompue par quitter l'application, sinon 0 */
int display_animove_pawn(struct gui_resource_t res, struct game_state_t gamestate, enum hole_t currentplayer, int startpos, int endpos);
/* retourne 1 si l'animation a été interrompue par quitter l'application, sinon 0 */
void display_close();

+ 3
- 3
main.c View File

@ -340,7 +340,7 @@ int main(int argc, char** argv) {
printf("(GUI) Rendering board, branch %d\n", player_state[0].branch);
display_render_board(gui_res, game_state, player_state[0].branch);
SDL_Flip(gui_res.screen);
/* display_text(gui_res, game_state, 1, "Début de la manche"); TODO */
/* display_animsg(gui_res, game_state, player_state[0].branch, "Début de la manche", 1200); TODO */
#ifdef debug
for(i=0;i<121; i++)
@ -391,7 +391,7 @@ int main(int argc, char** argv) {
#ifdef debug
fprintf(stderr, "mouvement (%d,%d) invalide\n",movement.start_pos, movement.end_pos);
#endif
/* display_text(gui_res, game_state, player_state[i].branch, "Coup non valide"); TODO*/
/* display_animsg(gui_res, game_state, player_state[i].branch, "Coup non valide", 1000); TODO*/
if(++(player_state[i].error)==3) {
nb_player_end++;
puts("perdu");
@ -407,7 +407,7 @@ int main(int argc, char** argv) {
}
}
puts("fin de la partie");
/* display_text(gui_res, game_state, player_state[i].branch, "Manche terminée"); TODO*/
/* display_animsg(gui_res, game_state, player_state[i].branch, "Manche terminée", 1000); TODO*/
/* pour les joueurs qui n'ont pas perdu */
for (i=0; i < nb_player ; i++)
if(player_state[i].error < 3)


Loading…
Cancel
Save