aboutsummaryrefslogtreecommitdiff
path: root/src/maps.h
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2023-11-05 11:22:55 +0000
committerJuan J. Martinez <jjm@usebox.net>2023-11-05 11:31:28 +0000
commit2fbdf974338bde8576efdae40a819a76b2391033 (patch)
tree64d41a37470143f142344f9a439d96de3e7918c2 /src/maps.h
downloadkitsunes-curse-2fbdf974338bde8576efdae40a819a76b2391033.tar.gz
kitsunes-curse-2fbdf974338bde8576efdae40a819a76b2391033.zip
Initial import of the open source release
Diffstat (limited to 'src/maps.h')
-rw-r--r--src/maps.h66
1 files changed, 66 insertions, 0 deletions
diff --git a/src/maps.h b/src/maps.h
new file mode 100644
index 0000000..8a3dad1
--- /dev/null
+++ b/src/maps.h
@@ -0,0 +1,66 @@
+/*
+ Kitsune's Curse
+ Copyright (C) 2020-2023 Juan J. Martinez <jjm@usebox.net>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+#ifndef _MAPS_H
+#define _MAPS_H
+
+#include <stdint.h>
+
+#ifndef LOCAL
+#define LOCAL extern
+#endif
+
+void init_map(uint8_t m);
+void set_map(uint8_t m);
+void draw_map();
+
+uint8_t exit_map_left();
+uint8_t exit_map_right();
+uint8_t exit_map_up();
+uint8_t exit_map_down();
+
+void set_map_tile(uint8_t x, uint8_t y, uint8_t tile);
+uint8_t is_map_blocked(uint8_t x, uint8_t y);
+uint8_t is_map_deadly(uint8_t x, uint8_t y);
+
+LOCAL uint8_t cmap, ts;
+LOCAL uint8_t exit_up, offset_up, exit_down, offset_down;
+
+LOCAL uint8_t last_deadly;
+
+LOCAL uint8_t wmap[TMW * TMH];
+
+// highest bit denotes deadly tile
+#define DEADLY_TILE_BASE 59
+
+#define BLOCKED_PLATFORM 128
+#define BLOCKED_OPEN_DOOR 143
+#define BLOCKED_OPEN_DOOR_TILE 43
+
+#define SWITCH_DOOR_TILE 58
+
+#define BLOCKED_UP (1<<4)
+#define BLOCKED_DOWN (1<<5)
+#define BLOCKED_LEFT (1<<6)
+#define BLOCKED_RIGHT (1<<7)
+
+#define LAST_TILE_TILESET 48
+#define LAST_NON_SOLID 10
+
+#undef LOCAL
+
+#endif // _MAPS_H