GameBoy (Color) port of the GTA San Andreas arcade game Duality
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.

sprites.h 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * sprites.h
  3. * Duality
  4. *
  5. * Copyright (C) 2025 Thomas Buck <thomas@xythobuz.de>
  6. *
  7. * This program is free software: you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation, either version 3 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * See <http://www.gnu.org/licenses/>.
  18. */
  19. #ifndef __SPRITES_H__
  20. #define __SPRITES_H__
  21. #include <stdint.h>
  22. #define SPR_NUM_START 0
  23. #define SHIP_OFF (8 + 4)
  24. enum SPRITES {
  25. SPR_SHIP = 0,
  26. SPR_LIGHT,
  27. SPR_DARK,
  28. SPR_SHOT,
  29. SPR_SHOT_LIGHT,
  30. SPR_SHOT_DARK,
  31. SPR_HEALTH,
  32. SPR_POWER,
  33. SPR_EXPL,
  34. SPR_PAUSE,
  35. SPR_DEBUG,
  36. SPR_DEBUG_LARGE,
  37. SPRITE_COUNT
  38. };
  39. enum SPRITE_FLIP {
  40. FLIP_NONE = 0,
  41. FLIP_X,
  42. FLIP_Y,
  43. FLIP_XY
  44. };
  45. enum SPRITE_ROT {
  46. ROT_0 = 0,
  47. ROT_22_5,
  48. ROT_45,
  49. ROT_67_5,
  50. ROT_90,
  51. ROT_112_5,
  52. ROT_135,
  53. ROT_157_5,
  54. ROT_180,
  55. ROT_202_5,
  56. ROT_225,
  57. ROT_247_5,
  58. ROT_270,
  59. ROT_292_5,
  60. ROT_315,
  61. ROT_337_5,
  62. ROT_INVALID
  63. };
  64. void spr_init(void);
  65. void spr_init_pal(void);
  66. void spr_draw(enum SPRITES sprite, enum SPRITE_FLIP flip, int8_t x_off, int8_t y_off, uint8_t frame, uint8_t *hiwater);
  67. void spr_ship(enum SPRITE_ROT rot, uint8_t moving, uint8_t *hiwater);
  68. #endif // __SPRITES_H__