aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_key_events.c
diff options
context:
space:
mode:
authorRudy Bousset <rbousset@z3r8p1.le-101.fr>2020-02-13 19:22:15 +0100
committerRudy Bousset <rbousset@z3r8p1.le-101.fr>2020-02-13 19:22:15 +0100
commitfb98fd19ba9e27eb3a169a7599ce41fb0877b7a6 (patch)
tree2185933c9bde571819dfd480b48aa66459a30b2e /src/ft_key_events.c
parentSolid map is better (diff)
download42-cub3d-fb98fd19ba9e27eb3a169a7599ce41fb0877b7a6.tar.gz
42-cub3d-fb98fd19ba9e27eb3a169a7599ce41fb0877b7a6.tar.bz2
42-cub3d-fb98fd19ba9e27eb3a169a7599ce41fb0877b7a6.tar.xz
42-cub3d-fb98fd19ba9e27eb3a169a7599ce41fb0877b7a6.tar.zst
42-cub3d-fb98fd19ba9e27eb3a169a7599ce41fb0877b7a6.zip
Better code structure
Diffstat (limited to 'src/ft_key_events.c')
-rw-r--r--src/ft_key_events.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ft_key_events.c b/src/ft_key_events.c
index 2112d2e..40f211a 100644
--- a/src/ft_key_events.c
+++ b/src/ft_key_events.c
@@ -73,6 +73,7 @@ int
(tmp_code == FT_S_KEY) ? (keycode = 2) : 0;
(tmp_code == FT_D_KEY) ? (keycode = 3) : 0;
(tmp_code == 3) ? (keycode = INT16_MAX) : 0;
+ (tmp_code == 4) ? (keycode = INT16_MAX) : 0;
pl = clist->plist;
if (keycode <= 3)
{
@@ -81,10 +82,12 @@ int
(pl->pos_x < 0.4) ? (pl->pos_x = 0.4) : 0;
(pl->pos_y > clist->map_h - 1.4) ? (pl->pos_y = clist->map_h - 1.4) : 0;
(pl->pos_x > clist->map_w - 1.4) ? (pl->pos_x = clist->map_w - 1.4) : 0;
- ft_drawmap(clist);
+ ft_draw_scene(clist);
return (0);
}
else if (keycode == FT_ESC_KEY)
return (ft_exit(0, (clist)));
+ else if (keycode == FT_F1_KEY)
+ return (ft_f1_key(clist));
return (0);
}