aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_get_topsp.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-03-12 23:47:37 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-03-12 23:47:37 +0100
commita2f0bde9da402ddfd47ec54d42b83585c3296ebf (patch)
treeff99c82f9a31064617953607eacd56fd1a862827 /src/ft_get_topsp.c
parentSecured traps (diff)
download42-cub3d-a2f0bde9da402ddfd47ec54d42b83585c3296ebf.tar.gz
42-cub3d-a2f0bde9da402ddfd47ec54d42b83585c3296ebf.tar.bz2
42-cub3d-a2f0bde9da402ddfd47ec54d42b83585c3296ebf.tar.xz
42-cub3d-a2f0bde9da402ddfd47ec54d42b83585c3296ebf.tar.zst
42-cub3d-a2f0bde9da402ddfd47ec54d42b83585c3296ebf.zip
Secured parsing
Diffstat (limited to '')
-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;
+ }
+ }
+}