display.h + fix screendisply
This commit is contained in:
11
Makefile
11
Makefile
@@ -1,7 +1,7 @@
|
||||
# Variable
|
||||
CC = gcc
|
||||
CFLAGS = -Wall -Wextra $(shell pkg-config --cflags --libs sdl2)
|
||||
OBJ = main.o function.o
|
||||
OBJ = main.o function.o display.o
|
||||
TARGET = sokoban
|
||||
|
||||
all: $(TARGET)
|
||||
@@ -9,11 +9,14 @@ all: $(TARGET)
|
||||
$(TARGET): $(OBJ)
|
||||
$(CC) $(CFLAGS) $(OBJ) -o $(TARGET)
|
||||
|
||||
main.o : main.c
|
||||
main.o : main.c function.h
|
||||
$(CC) $(CFLAGS) -c main.c
|
||||
|
||||
function.o : function.c
|
||||
$(CC) $(CFLAGS) -c function
|
||||
function.o : function.c function.h
|
||||
$(CC) $(CFLAGS) -c function.c
|
||||
|
||||
display.o: display.c display.h
|
||||
$(CC) $(CFLAGS) -c display.c
|
||||
|
||||
clean :
|
||||
rm -f $(OBJ) $(TARGET)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include <stdio.h>
|
||||
#include "display.h"
|
||||
|
||||
void screenDisplay( unsigned short int **tab,int size)
|
||||
{
|
||||
@@ -8,6 +9,7 @@ void screenDisplay( unsigned short int **tab,int size)
|
||||
{
|
||||
printf("%hu ",tab[i][j]);
|
||||
}
|
||||
puts("");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
7
display.h
Normal file
7
display.h
Normal file
@@ -0,0 +1,7 @@
|
||||
#ifndef DISPLAY_H
|
||||
#define DISPLAY_H
|
||||
|
||||
void screenDisplay( unsigned short int **tab,int size);
|
||||
|
||||
#endif // !DISPLAY_H
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifdef FONCTION_H
|
||||
#ifndef FONCTION_H
|
||||
#define FONCTION_H
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
Reference in New Issue
Block a user