summaryrefslogtreecommitdiff
path: root/constantes.h
diff options
context:
space:
mode:
Diffstat (limited to 'constantes.h')
-rw-r--r--constantes.h180
1 files changed, 92 insertions, 88 deletions
diff --git a/constantes.h b/constantes.h
index 415074b..1b46e77 100644
--- a/constantes.h
+++ b/constantes.h
@@ -49,7 +49,6 @@
#define TYPE_ATTAQUE 0
#define TYPE_MAGIE 1
-
#define SELECTION(nb,nb2) if (selection == nb)\
{\
if(nb2==ALLIE)\
@@ -78,92 +77,97 @@
-#define SELECTION_CIBLE() case SDLK_RIGHT:\
- if(clan==ALLIE)\
- {\
- selection=0;\
- while(ennemis[selection].etat==MORT)\
- selection++;\
- inverse(&clan);\
- SDL_BlitSurface (surfaces->Pfondjeu,&positions->Vpositioncurseurallies,surfaces->Pecran,&positions->Vpositioncurseurallies);\
- Fchangercurseurennemis (surfaces,positions,selection,ennemis);\
- }\
- break;\
- case SDLK_LEFT:\
- if(clan==ENNEMI)\
- {\
- SDL_BlitSurface (surfaces->Pfondjeu,&positions->Vpositioncadrecible,surfaces->Pecran,&positions->Vpositioncadrecible);\
- selection=0;\
- while(persos[selection].etat==MORT)\
- selection++;\
- inverse(&clan);\
- SDL_BlitSurface(surfaces->Pfondjeu,&positions->Vpositioncurseurennemis,surfaces->Pecran,&positions->Vpositioncurseurennemis);\
- Fchangercurseurpersos(surfaces,positions,selection,persos);\
- }\
- break;\
- case SDLK_UP:\
- if(clan==ENNEMI)\
- {\
- if (selection!=0)\
- selection--;\
- else\
- selection=Vnbennemis;\
- while(ennemis[selection].etat==MORT)\
- {\
- if(selection!=0)\
- selection--;\
- else\
- selection=Vnbennemis;\
- }\
- Fchangercurseurennemis (surfaces,positions,selection,ennemis);\
- }\
- else\
- {\
- if (selection!=0)\
- selection--;\
- else\
- selection=2;\
- while(persos[selection].etat==MORT)\
- {\
- if(selection!=0)\
- selection--;\
- else\
- selection=2;\
- }\
- Fchangercurseurpersos(surfaces,positions,selection,ennemis);\
- }\
- break;\
- case SDLK_DOWN:\
- if(clan==ENNEMI)\
- {\
- if(selection!=Vnbennemis)\
- selection++;\
- else\
- selection=0;\
- while(ennemis[selection].etat==MORT)\
- {\
- if(selection!=Vnbennemis)\
- selection++;\
- else\
- selection=0;\
- }\
- Fchangercurseurennemis(surfaces,positions,selection,ennemis);\
- }\
- else\
- {\
- if(selection!=2)\
- selection++;\
- else\
- selection=0;\
- while(persos[selection].etat==MORT)\
- {\
- if(selection!=2)\
- selection++;\
- else\
- selection=0;\
- }\
- Fchangercurseurpersos(surfaces,positions,selection,ennemis);\
- }\
- break;
+#define SELECTION_CIBLE() \
+ case SDLK_RIGHT:\
+case SDLK_l: \
+if(clan==ALLIE)\
+{\
+ selection=0;\
+ while(ennemis[selection].etat==MORT)\
+ selection++;\
+ inverse(&clan);\
+ SDL_BlitSurface (surfaces->Pfondjeu,&positions->Vpositioncurseurallies,surfaces->Pecran,&positions->Vpositioncurseurallies);\
+ Fchangercurseurennemis (surfaces,positions,selection,ennemis);\
+}\
+break;\
+case SDLK_LEFT:\
+case SDLK_h: \
+if(clan==ENNEMI)\
+{\
+ SDL_BlitSurface (surfaces->Pfondjeu,&positions->Vpositioncadrecible,surfaces->Pecran,&positions->Vpositioncadrecible);\
+ selection=0;\
+ while(persos[selection].etat==MORT)\
+ selection++;\
+ inverse(&clan);\
+ SDL_BlitSurface(surfaces->Pfondjeu,&positions->Vpositioncurseurennemis,surfaces->Pecran,&positions->Vpositioncurseurennemis);\
+ Fchangercurseurpersos(surfaces,positions,selection,persos);\
+}\
+break;\
+case SDLK_UP:\
+case SDLK_k: \
+if(clan==ENNEMI)\
+{\
+ if (selection!=0)\
+ selection--;\
+ else\
+ selection=Vnbennemis;\
+ while(ennemis[selection].etat==MORT)\
+ {\
+ if(selection!=0)\
+ selection--;\
+ else\
+ selection=Vnbennemis;\
+ }\
+ Fchangercurseurennemis (surfaces,positions,selection,ennemis);\
+}\
+else\
+{\
+ if (selection!=0)\
+ selection--;\
+ else\
+ selection=2;\
+ while(persos[selection].etat==MORT)\
+ {\
+ if(selection!=0)\
+ selection--;\
+ else\
+ selection=2;\
+ }\
+ Fchangercurseurpersos(surfaces,positions,selection,ennemis);\
+}\
+break;\
+case SDLK_DOWN:\
+case SDLK_j:\
+if(clan==ENNEMI)\
+{\
+ if(selection!=Vnbennemis)\
+ selection++;\
+ else\
+ selection=0;\
+ while(ennemis[selection].etat==MORT)\
+ {\
+ if(selection!=Vnbennemis)\
+ selection++;\
+ else\
+ selection=0;\
+ }\
+ Fchangercurseurennemis(surfaces,positions,selection,ennemis);\
+}\
+else\
+{\
+ if(selection!=2)\
+ selection++;\
+ else\
+ selection=0;\
+ while(persos[selection].etat==MORT)\
+ {\
+ if(selection!=2)\
+ selection++;\
+ else\
+ selection=0;\
+ }\
+ Fchangercurseurpersos(surfaces,positions,selection,ennemis);\
+}\
+break;
#endif