From 2fbdf974338bde8576efdae40a819a76b2391033 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Sun, 5 Nov 2023 11:22:55 +0000 Subject: Initial import of the open source release --- src/maps.h | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 src/maps.h (limited to 'src/maps.h') 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 + + 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 . + */ +#ifndef _MAPS_H +#define _MAPS_H + +#include + +#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 -- cgit v1.2.3