59 lines
800 B
C
59 lines
800 B
C
#ifndef MAIN_H
|
|
#define MAIN_H
|
|
|
|
#include "team.h"
|
|
#include <SDL/SDL.h>
|
|
|
|
#ifdef _WIN32
|
|
#define MAIN WinMain
|
|
#define OS "Windows"
|
|
#else
|
|
#define MAIN main
|
|
#define OS "Linux"
|
|
#endif
|
|
|
|
#define MAX_FPS 4
|
|
#define MAX_DUDES 50
|
|
#define WIDTH 400
|
|
#define HEIGHT 250
|
|
|
|
// Teams
|
|
enum{
|
|
PURPLE, ORANGE, NB_TEAMS
|
|
};
|
|
|
|
typedef struct{
|
|
int type;
|
|
void* data;
|
|
} t_pixel;
|
|
|
|
typedef struct{
|
|
t_coord pos;
|
|
int team;
|
|
int inventory;
|
|
t_pixel ground;
|
|
void* custom_data;
|
|
void* com_data;
|
|
} t_dude;
|
|
|
|
typedef struct{
|
|
int team;
|
|
int dude_size;
|
|
t_action (*update)(void*, void*, int);
|
|
int nb_dudes;
|
|
t_dude* dudes;
|
|
t_coord spawn;
|
|
int spawn_food;
|
|
int spawn_count;
|
|
} t_team;
|
|
|
|
void generateImg();
|
|
|
|
void handleAction(t_action action, t_dude* dude);
|
|
|
|
// variables globales
|
|
t_pixel** map;
|
|
t_team* teams;
|
|
SDL_Surface* img;
|
|
|
|
#endif |