No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

72 líneas
1.4KB

  1. #pragma once
  2. #include "list.h"
  3. #include "gb_math.h"
  4. #include <stdio.h>
  5. #include <stdint.h>
  6. #include <stdlib.h>
  7. #include "asteroids_font.h"
  8. #include "xtimer.h"
  9. typedef struct{
  10. struct {int16_t x, y; };
  11. int16_t e[2];
  12. } point_t;
  13. typedef enum{
  14. PATH_MOVE = 0x0,
  15. PATH_DRAW = 0x1
  16. } path_modus_t;
  17. typedef struct{
  18. list_node_t list;
  19. point_t point;
  20. path_modus_t modus;
  21. } path_node_t;
  22. typedef struct{
  23. list_node_t list;
  24. int16_t step_pos_a;
  25. int16_t step_pos_b;
  26. } step_pos_node_t;
  27. typedef struct{
  28. list_node_t set_point_start;
  29. list_node_t start;
  30. list_node_t current;
  31. uint8_t char_count;
  32. } path_t;
  33. void path_add(path_t *path, path_node_t *point);
  34. void path_add_vec(path_t *node, point_t *point, path_modus_t modus);
  35. //void path_add_rect(path_t *node, gbRect2 *rect);
  36. void path_generate(path_t *path);
  37. void path_reset(path_t *path);
  38. void path_add_circle(path_t *node, gbVec2 *point, float radius, uint8_t division);
  39. void path_reverse(path_t *node);
  40. void path_increment(path_t *path);
  41. void path_init(path_t *path);
  42. void path_add_char(path_t *path, char character);
  43. path_node_t* path_next_point(path_t *path);
  44. path_node_t* path_next(path_node_t *point);
  45. path_node_t* path_pop(path_node_t *point);
  46. point_t point_sub(point_t *a, point_t *b);
  47. point_t point_add(point_t *a, point_t *b);
  48. point_t point_interval(point_t *a, point_t*b);
  49. int16_t point_mag2(point_t *a);