aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_get_topsp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ft_get_topsp.c')
-rw-r--r--src/ft_get_topsp.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/ft_get_topsp.c b/src/ft_get_topsp.c
new file mode 100644
index 0000000..ee16714
--- /dev/null
+++ b/src/ft_get_topsp.c
@@ -0,0 +1,30 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* ft_check_map_line.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: rbousset <marvin@42.fr> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/02/14 17:28:34 by rbousset #+# #+# */
+/* Updated: 2020/02/14 17:28:37 by rbousset ### ########lyon.fr */
+/* */
+/* ************************************************************************** */
+
+#include <libft.h>
+#include <cub3d.h>
+#include <stddef.h>
+#include <stdint.h>
+
+void
+ ft_get_topsp(char c, t_cub *clist)
+{
+ int8_t x;
+
+ if ((x = ft_strlchr(FT_CHRST_SPRITES, c)) > 0)
+ {
+ if ((x + 2) > clist->mlist.topsp)
+ {
+ clist->mlist.topsp = x + 2;
+ }
+ }
+}