display.h + fix screendisply
This commit is contained in:
11
Makefile
11
Makefile
@@ -1,7 +1,7 @@
|
|||||||
# Variable
|
# Variable
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CFLAGS = -Wall -Wextra $(shell pkg-config --cflags --libs sdl2)
|
CFLAGS = -Wall -Wextra $(shell pkg-config --cflags --libs sdl2)
|
||||||
OBJ = main.o function.o
|
OBJ = main.o function.o display.o
|
||||||
TARGET = sokoban
|
TARGET = sokoban
|
||||||
|
|
||||||
all: $(TARGET)
|
all: $(TARGET)
|
||||||
@@ -9,11 +9,14 @@ all: $(TARGET)
|
|||||||
$(TARGET): $(OBJ)
|
$(TARGET): $(OBJ)
|
||||||
$(CC) $(CFLAGS) $(OBJ) -o $(TARGET)
|
$(CC) $(CFLAGS) $(OBJ) -o $(TARGET)
|
||||||
|
|
||||||
main.o : main.c
|
main.o : main.c function.h
|
||||||
$(CC) $(CFLAGS) -c main.c
|
$(CC) $(CFLAGS) -c main.c
|
||||||
|
|
||||||
function.o : function.c
|
function.o : function.c function.h
|
||||||
$(CC) $(CFLAGS) -c function
|
$(CC) $(CFLAGS) -c function.c
|
||||||
|
|
||||||
|
display.o: display.c display.h
|
||||||
|
$(CC) $(CFLAGS) -c display.c
|
||||||
|
|
||||||
clean :
|
clean :
|
||||||
rm -f $(OBJ) $(TARGET)
|
rm -f $(OBJ) $(TARGET)
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include "display.h"
|
||||||
|
|
||||||
void screenDisplay( unsigned short int **tab,int size)
|
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]);
|
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
|
#define FONCTION_H
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|||||||
Reference in New Issue
Block a user