aboutsummaryrefslogtreecommitdiff
path: root/helper.c
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-01-11 10:38:41 +0100
committerCharles <sircharlesaze@gmail.com>2020-01-11 10:39:37 +0100
commit0dcba6ff7e68ed13f8e6caadd80b77506b917050 (patch)
tree16e1393115941b87ca50f04f1e37511f3f7bbdb5 /helper.c
parent988e058680280e25d345b17d840c3c6d40e30a76 (diff)
downloadcub3d-0dcba6ff7e68ed13f8e6caadd80b77506b917050.tar.gz
cub3d-0dcba6ff7e68ed13f8e6caadd80b77506b917050.tar.bz2
cub3d-0dcba6ff7e68ed13f8e6caadd80b77506b917050.zip
Hardcore refactoring
Diffstat (limited to 'helper.c')
-rw-r--r--helper.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/helper.c b/helper.c
new file mode 100644
index 0000000..fb16406
--- /dev/null
+++ b/helper.c
@@ -0,0 +1,28 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* helper.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/01/11 07:32:20 by cacharle #+# #+# */
+/* Updated: 2020/01/11 10:37:54 by cacharle ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#include "cub3d.h"
+
+t_bool helper_is_player_cell(t_cell cell)
+{
+ return (cell == CELL_LOOK_NORTH || cell == CELL_LOOK_SOUTH ||
+ cell == CELL_LOOK_WEST || cell == CELL_LOOK_EAST);
+}
+
+void helper_free_splited(char **splited)
+{
+ if (splited == NULL)
+ return ;
+ while (splited != NULL)
+ free(*splited++);
+ free(splited);
+}