pinball0.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #pragma once
  2. #include <gui/gui.h>
  3. // #include <input/input.h>
  4. #include <stdlib.h>
  5. #include <stdbool.h>
  6. #include <string.h>
  7. #include <cmath>
  8. // #include <furi_hal_resources.h>
  9. // #include <furi_hal_gpio.h>
  10. #include <dolphin/dolphin.h>
  11. #include <storage/storage.h>
  12. #include <notification/notification.h>
  13. #include <notification/notification_messages.h>
  14. #include "vec2.h"
  15. #include "objects.h"
  16. #include "table.h"
  17. // #define DRAW_NORMALS
  18. #define TAG "Pinball0"
  19. // Vertical orientation
  20. #define LCD_WIDTH 64
  21. #define LCD_HEIGHT 128
  22. typedef enum {
  23. EventTypeTick,
  24. EventTypeKey
  25. } EventType;
  26. typedef struct {
  27. EventType type;
  28. InputEvent input;
  29. } PinballEvent;
  30. typedef enum GameMode {
  31. GM_TableSelect,
  32. GM_Playing,
  33. GM_GameOver,
  34. GM_Error,
  35. GM_About // TODO
  36. } GameMode;
  37. typedef struct {
  38. FuriMutex* mutex;
  39. TableList table_list;
  40. GameMode game_mode;
  41. Table* table; // data for the current table
  42. uint32_t tick;
  43. bool gameStarted;
  44. bool keys[4]; // which key was pressed?
  45. bool processing; // controls game loop and physics threads
  46. // system objects
  47. Storage* storage;
  48. NotificationApp* notify; // allows us to blink/buzz during game
  49. char text[256]; // general temp buffer
  50. } PinballState;