-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
52 lines (45 loc) · 781 Bytes
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
** main.c for my_sokoban in /home/thibrex/delivery/PSU/PSU_2016_my_sokoban
**
** Made by Thibaut Cornolti
** Login <thibaut.cornolti@epitech.eu>
**
** Started on Tue Dec 6 10:05:11 2016 Thibaut Cornolti
** Last update Tue Dec 13 13:20:48 2016 Thibaut Cornolti
*/
#include "soko.h"
static void my_initscr()
{
initscr();
noecho();
cbreak();
curs_set(0);
keypad(stdscr, TRUE);
nodelay(stdscr, TRUE);
}
void stop_game_r(int value)
{
endwin();
exit(value);
}
void stop_game()
{
endwin();
exit(0);
}
void restart(t_game *g)
{
load_file(g->filepath, g);
start_game(g);
}
int main(int ac, char **av)
{
t_game game;
ac += 1;
load_file(av[1], &game);
game.filepath = av[1];
my_initscr();
start_game(&game);
endwin();
return (0);
}