// all the includes should be removed //? #include "macros.h" //? #include "common.h" //x #define MAX_NPERSO 20 moved to macros.h P.K. //? #include "sprites.h" //? #include "pouvoirs.h" //x #include "types.h" /*--Structures--*/ /* moved to types.h #ifndef __Coord__ #define __Coord__ typedef struct { int x; int y; }Coord; #endif */ /* Commandes ?? */ /* moved to types.h #ifndef __Commandes__ #define __Commandes__ typedef struct { SDL_Joystick *joy; // NULL si clavier int haut; // Indique aussi le no du joy le cas échéant int bas; int gauche; int droite; int b1; int b2; int actif; int precedent; }Commandes; #endif */ /* Bombe */ /* moved to types.h #ifndef __Bombe__ #define __Bombe__ typedef struct _Bombe Bombe; struct _Bombe { Coord pos; int rebours; int lflammes; int car; Bombe * suiv; Bombe * prec; }; #endif */ /* Bombelist */ /* moved to types.h #ifndef __Bombelist__ #define __Bombelist__ typedef struct _Bombelist Bombelist; struct _Bombelist { Bombe * contenu; Bombelist * suiv; }; #endif */ /* Anims */ /* moved to types.h #ifndef __Anims__ #define __Anims__ typedef struct _Anims Anims; struct _Anims { Coord pos; Sprite *sprite; int anim; int frame; int vitesse; int compteur; int duree; Anims * suiv; Anims * prec; }; #endif */ /* Evenements */ /* moved to types.h #ifndef __Evenements__ #define __Evenements__ typedef struct _Evenement Evenement; struct _Evenement{ int delai; int delaisg; int fois; int proprietaire; int param; Coord pos; void (*fonction)(Evenement *); void (*termine)(Evenement *); Evenement * suiv; Evenement * prec; }; #endif */ /* typedef struct _Bombe Bombe; */ /* typedef struct _Bombelist Bombelist; */ /* typedef struct _Anims Anims; */ /* typedef struct _Evenement Evenement; */ /* struct _Bombe { */ /* Coord pos; */ /* int rebours; */ /* int lflammes; */ /* int car; */ /* Bombe * suiv; */ /* Bombe * prec; */ /* }; */ /* struct _Bombelist { */ /* Bombe * contenu; */ /* Bombelist * suiv; */ /* }; */ /* struct _Anims { */ /* Coord pos; */ /* Sprite *sprite; */ /* int anim; */ /* int frame; */ /* int vitesse; */ /* int compteur; */ /* int duree; */ /* Anims * suiv; */ /* Anims * prec; */ /* }; */ /* struct _Evenement{ */ /* int delai; */ /* int delaisg; */ /* int fois; */ /* int proprietaire; */ /* int param; */ /* Coord pos; */ /* void (*fonction)(Evenement *); */ /* void (*termine)(Evenement *); */ /* Evenement * suiv; */ /* Evenement * prec; */ /* }; */ /* typedef struct { */ /* int type; */ /* int bombe; */ /* Sprite *elem; */ /* int anim; */ /* int frame; */ /* int *params; */ /* int nparams; */ /* // Si le sol doit être dessiné en-dessous de l'élément */ /* int sol; */ /* void (*evt)(Evenement *); */ /* // Pour la sauvegarde en cas de changement (bouton...) */ /* int typesg, animsg, framesg; */ /* Sprite *elemsg; */ /* }Plateau; */ /* One "Personnage" */ /* moved to types.h #ifndef __Personnage__ #define __Personnage__ typedef struct { int joueurIA; // Variables : -de mouvement Coord pos; Coord pixpos; unsigned int anim; int dir; int mv; // -de situation unsigned int statut; int animdroite; // int framedroite; unsigned int energie; unsigned int lflammes; // -de bombes Bombe * bombes; // int nbbombes; // -de pouvoirs int pouvactif[4]; int pouvoirparam; // Constantes Commandes cmd; Pouvoir pouv[4]; }Personnage; #endif */ /* #ifndef __Pouvoirspecial__ #define __Pouvoirspecial__ typedef void (*Pouvoirspecial)(int n, int p); #endif */ //x extern Plateau pl[16][15]; extern Plan plan; // dynamic allocated gameplan /* Resolution variables */ extern Resolution resolution; //x extern Personnage perso[8]; extern Personnage perso[MAX_NPERSO]; //x extern const int dx[4], dy[4]; // moved to common.h /*--Variables globales de configuration--*/ extern int NB_PERSO; //x extern char repertoire[256]; extern char repertoire[MAX_STRING_LENGTH]; // path to bi //x extern char prefixeniv[256], prefixeimg[256]; extern char prefixeniv[MAX_STRING_LENGTH], prefixeimg[MAX_STRING_LENGTH]; // prefix paths //x extern char prefixespr[256], prefixeson[256]; extern char prefixespr[MAX_STRING_LENGTH], prefixeson[MAX_STRING_LENGTH]; //? extern char bicfg[256]; extern char **spritliste; extern Coord fauxperso[MAX_NPERSO]; extern int danslemenu; extern int compteur; extern int encore; extern Uint8 *clavier; extern SDL_Joystick **joystick; extern SDL_Surface *ecran; extern int nrs; int libre(int x, int y, int dir); int aleat(int max); //x void erreur(char *message, char *param); void videcran(void); Anims * animsplus(Sprite *sprite, int anim, int vitesse, int duree, int x, int y); void animsmoins(Anims *a); void rscaseplus(int x, int y); void rdplateau(int); void menuevt(Evenement * e); void dessinebande(void); void mort(int tueur, int tue); void afficheperso(int n, int frame); void dessinecase(int n, Coord *co); Bombe * posebombe(int x, int y, int n); void prendbonus(int n); void passenpleinecran(void); int ajustevitesse(void);