diff --git a/Makefile b/Makefile index caedac8..5d23f2e 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,18 @@ CC=gcc -LIB=-lSDL -lm -L./lib -FLAGS=-Wall ifdef SystemRoot RM=del /Q FixPath=$(subst /,\,$1) BINARY=PixelWars.exe + LIB=-lSDL -lm -L./lib + FLAGS=-Wall -I./include else ifeq ($(shell uname), Linux) RM=rm -f FixPath=$1 BINARY=PixelWars + LIB=-lSDL -lm + FLAGS=-Wall endif endif @@ -22,7 +24,7 @@ purple : purple.o main : main.o generator.o -$(BINARY) : orange purple main +$(BINARY) : orange.o purple.o main.o generator.o $(CC) main.o generator.o orange.o purple.o -o $(BINARY) $(LIB) %.o: %.c diff --git a/generator.c b/generator.c index 3c7ab1a..5b07505 100644 --- a/generator.c +++ b/generator.c @@ -64,7 +64,7 @@ void create_map(t_pixel** map, t_team* teams, int w, int h){ //génération de la carte for (i=0;iheight;j++){ + for(j=0;jpixels[j * WIDTH + i] = color; } + printf("\n"); } } @@ -260,6 +268,7 @@ int MAIN( int argc, char** argv ) printf("Starting Pixel Wars on %s\n", OS); initSDL(); initWorld(); + SDL_Flip(img); while (!keystate[SDLK_ESCAPE] && !over){ temps = SDL_GetTicks();