|
|
- #ifndef IS_MAP_H_
- #define IS_MAP_H_
-
- #include <stdint.h>
-
- #include "sdk/assets.h"
-
- typedef struct {
- uint16_t tile_ptr;
- uint16_t tile_size;
- uint16_t map_ptr;
- uint16_t collision_ptr;
- int8_t map_width;
- int8_t map_height;
- uint8_t spawn_x;
- uint8_t spawn_y;
- uint8_t camera_x;
- uint8_t camera_y;
- } map_t;
-
- extern map_t MAP; //!< The current game map
-
- #define MAP_ASSET(var_name, filename) \
- void __##var_name##__() __naked { \
- __asm__("_" #var_name "::"); \
- __asm__(".incbin \"_build/level/" filename "\""); \
- __asm__("_" #var_name "_end::"); \
- } \
- EXTERN_ASSET(var_name)
-
- void map_load(map_t *map);
-
- void map_scroll_up(void);
-
- void map_scroll_down(void);
-
- void map_scroll_right(void);
-
- void map_scroll_left(void);
-
- #endif
|