aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRudy Bousset <rbousset@z2r5p2.le-101.fr>2020-02-03 18:56:05 +0100
committerRudy Bousset <rbousset@z2r5p2.le-101.fr>2020-02-03 18:56:05 +0100
commita02e6e92456112c0d298c0bed69220cc19d5f0dc (patch)
treef214ad2184117e2d47dafff56ccac9dc95b217a8
parentI can't turn (diff)
download42-cub3d-a02e6e92456112c0d298c0bed69220cc19d5f0dc.tar.gz
42-cub3d-a02e6e92456112c0d298c0bed69220cc19d5f0dc.tar.bz2
42-cub3d-a02e6e92456112c0d298c0bed69220cc19d5f0dc.tar.xz
42-cub3d-a02e6e92456112c0d298c0bed69220cc19d5f0dc.tar.zst
42-cub3d-a02e6e92456112c0d298c0bed69220cc19d5f0dc.zip
vim style
Diffstat (limited to '')
-rw-r--r--map/map_vim.cub25
-rw-r--r--src/ft_get_map.c3
-rw-r--r--src/main.c2
3 files changed, 27 insertions, 3 deletions
diff --git a/map/map_vim.cub b/map/map_vim.cub
new file mode 100644
index 0000000..face56c
--- /dev/null
+++ b/map/map_vim.cub
@@ -0,0 +1,25 @@
+R 1200 600
+
+NO ./path_to_the_north_texture
+SO ./path_to_the_south_texture
+EA ./path_to_the_east_texture
+WE ./path_to_the_west_texture
+S ./path_to_the_sprite_texture
+
+F 220,100,0
+C 225,30,0
+
+1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
+1 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
+1 0 1 1 0 0 0 0 0 1 1 1 0 0 0 0 0 0 2 0 0 0 0 0 1 0 0 0 1
+1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1
+1 0 1 1 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1
+1 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 1 1 1 0 1 1 1 1 0 0 0 1
+1 1 1 1 0 1 1 1 1 1 1 1 1 1 0 1 1 1 0 0 0 0 0 0 1 0 0 0 1
+1 1 1 1 0 1 1 1 1 1 1 1 1 1 0 1 1 1 0 1 0 1 0 0 1 0 0 0 1
+1 1 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 1 0 0 0 0 0 0 1 0 0 0 1
+1 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 0 0 0 1
+1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 0 1 0 0 1 0 0 0 1
+1 1 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 1 1 1 0 1 1 1 1 0 N 0 1
+1 1 1 1 0 1 1 1 1 1 1 1 0 1 0 1 1 1 1 1 0 1 1 1 1 0 0 0 1
+1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
diff --git a/src/ft_get_map.c b/src/ft_get_map.c
index b64da72..a0ddfbb 100644
--- a/src/ft_get_map.c
+++ b/src/ft_get_map.c
@@ -82,10 +82,9 @@ int
i = 1;
ret = 1;
- while (ret > 0)
+ while ((ret = get_next_line(fd, &line)) > 0)
{
clist->line_chk += 1;
- ret = get_next_line(fd, &line);
if (!line[0] || ft_check_map_line(line, 0, clist) < 0
|| ft_cat_mapl(line, i, clist) < 0)
{
diff --git a/src/main.c b/src/main.c
index b9f4514..a660128 100644
--- a/src/main.c
+++ b/src/main.c
@@ -31,7 +31,7 @@ int
ft_memdel((void**)&clist);
return (1);
}
- ft_parse_map("map/map_one.cub", clist);
+ ft_parse_map("map/map_vim.cub", clist);
if (ft_init_winlx(clist) < 0)
return (ft_exit(3, clist));
mlx_key_hook(clist->wlist->winptr, ft_key_event, clist);