PixelWars/main.h
2015-01-15 17:42:59 +01:00

59 lines
934 B
C

#ifndef MAIN_H
#define MAIN_H
#include "team.h"
#include <SDL/SDL.h>
#ifdef _WIN32
#include <windows.h>
#define MAIN APIENTRY WinMain(HINSTANCE hinstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
#else
#define MAIN main(int argc, char** argv)
#endif
#define MAX_DUDES 50
#define STACK_SIZE 5
#define DEFAULT_WIDTH 400
#define DEFAULT_HEIGHT 250
#define NB_STARTING_FOOD 5
// Teams
enum{
PURPLE, ORANGE, NB_TEAMS
};
typedef struct{
int type;
void* data;
} t_pixel;
typedef struct{
t_coord pos;
int team;
int inventory;
int success;
t_pixel ground;
void* custom_data;
void* com_data;
} t_dude;
typedef struct{
int team;
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