summaryrefslogtreecommitdiff
path: root/map_get.c
diff options
context:
space:
mode:
Diffstat (limited to 'map_get.c')
-rw-r--r--map_get.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/map_get.c b/map_get.c
new file mode 100644
index 0000000..30337d1
--- /dev/null
+++ b/map_get.c
@@ -0,0 +1,23 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* map_get.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: kdx <kdx @student.42angouleme.fr +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2022/10/10 21:28:49 by kdx #+# #+# */
+/* Updated: 2022/10/11 00:26:11 by kdx ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#include "map.h"
+
+unsigned char map_get(t_map *map, int x, int y)
+{
+ return (map->data[(x / TSIZE) + (y / TSIZE) * (map->width + 1)]);
+}
+
+void map_set(t_map *map, int x, int y, unsigned char v)
+{
+ map->data[(x / TSIZE) + (y / TSIZE) * (map->width + 1)] = v;
+}