lol its in c
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
922 B

  1. #ifndef IS_MAP_H_
  2. #define IS_MAP_H_
  3. #include <stdint.h>
  4. #include "sdk/assets.h"
  5. typedef struct {
  6. uint16_t tile_ptr;
  7. uint8_t tile_count;
  8. uint16_t map_ptr;
  9. uint16_t collision_ptr;
  10. int8_t map_width;
  11. int8_t map_height;
  12. uint8_t spawn_x;
  13. uint8_t spawn_y;
  14. uint8_t camera_x;
  15. uint8_t camera_y;
  16. } map_t;
  17. extern map_t MAP; //!< The current game map
  18. #define MAP_ASSET(var_name, filename) \
  19. void __##var_name##__() __naked { \
  20. __asm__("_" #var_name "::"); \
  21. __asm__(".incbin \"_build/level/" filename "\""); \
  22. __asm__("_" #var_name "_end::"); \
  23. } \
  24. EXTERN_ASSET(var_name)
  25. void map_load(map_t *map);
  26. void map_scroll_up(void);
  27. void map_scroll_down(void);
  28. void map_scroll_right(void);
  29. void map_scroll_left(void);
  30. #endif