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.

103 lines
4.6 KiB

  1. /*
  2. * Copyright 2021 Tyler Thrailkill (@snowe/@snowe2010) <tyler.b.thrailkill@gmail.com>
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation, either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. */
  17. #pragma once
  18. #include "quantum.h"
  19. /**
  20. * Features:
  21. * You can turn on and off features in this section
  22. */
  23. #define ENABLE_MOON // Uses 182 bytes
  24. #define ENABLE_WAVE // Uses 844 bytes
  25. #define ENABLE_SHOOTING_STARS // Uses 872 bytes
  26. #define ENABLE_ISLAND
  27. #define ENABLE_STARS // Uses 606 bytes
  28. /**
  29. * Global Settings
  30. */
  31. #define STARRY_NIGHT_ANIM_FRAME_DURATION 30 // how long each frame lasts in ms
  32. #define NUMBER_OF_FRAMES 20 // Self explanatory. Probably shouldn't touch this, not sure how stuff will work if it's changed. If changed should be multiple of 1, 2, 3, 4, and 5
  33. #define WIDTH OLED_DISPLAY_HEIGHT // for vertical displays
  34. #define HEIGHT OLED_DISPLAY_WIDTH // for vertical displays
  35. /**
  36. * Moon Parameters
  37. */
  38. #define MOON_LINE 4 // the line you want the moon to appear at
  39. #define MOON_COLUMN 4 // the column you want the moon to appear at
  40. //#define STATIC_MOON // uncomment this to make the moon a static image, no animation
  41. #ifndef STATIC_MOON
  42. # define ANIMATE_MOON_EVERY_N_FRAMES 100 // animate the moon every n frames
  43. #endif
  44. /**
  45. * Wave Parameters
  46. */
  47. #define OCEAN_LINE 14 // Line you want to render the ocean starting at (best at oled_max_lines() - 2)
  48. #define WAVE_CALM 20 // render calm ocean under this WPM and ripple ocean at this WPM
  49. #define WAVE_HEAVY_STORM 40 // render medium ocean at this WPM
  50. #define WAVE_HURRICANE 60 // render heavy waves above this WPM
  51. // What number of frames you want to animate the ocean at.
  52. // Should be equal to or smaller than NUMBER_OF_FRAMES, e.g. 30, would animate on every other frame, 20, every third frame, etc
  53. // Don't set equal to 0.
  54. #define OCEAN_ANIMATION_SPEED 1
  55. /**
  56. * Shooting Star Parameters
  57. */
  58. #define SHOOTING_STAR_DELAY 12 // delay modulus for time between shooting stars. Decides number of frames to delay, e.g. 12 means 0-11 frames of delay between each shooting star
  59. #define SHOOTING_STAR_FRAMES 16 // how many 2 pixel frames per shooting star. Increment this for longer shooting stars
  60. #define MAX_NUMBER_OF_SHOOTING_STARS 12 // maximum number of shooting stars that can be on screen at the same time
  61. #define SHOOTING_STAR_WPM_INCREMENT 10 // every n WPM increase, add an extra star, up to MAX_NUMBER_OF_SHOOTING_STARS, e.g. an increment of 5 would result in 1 shooting star at 5-9wpm, 2 at 10-14, etc.
  62. // What number of frames you want to animate the shooting stars at.
  63. // Should be equal to or smaller than NUMBER_OF_FRAMES, e.g. 30, would animate on every other frame, 20, every third frame, etc
  64. // Don't set equal to 0.
  65. #define SHOOTING_STAR_ANIMATION_SPEED 30
  66. /**
  67. * Star Parameters
  68. */
  69. #define STARS_PER_LINE 4 // number of stars per line (for a display that is 128x32, this would be 4 stars spread out evenly over the 32byte width, one every 8 bytes)
  70. #define NUMBER_OF_STAR_LINES 16 // number of lines to fill up with stars (for a display that is 128x32, 16 bytes are filled with the ocean animation, so that leaves 112 pixels left over. The number of lines depends on your OLED_FONT_HEIGHT)
  71. #define TWINKLE_PROBABILITY 25 // probability that any star twinkles on a given frame
  72. // What number of frames you want to animate the stars at.
  73. // Should be equal to or smaller than NUMBER_OF_FRAMES, e.g. 20, would animate on every frame, 10, every other frame, etc
  74. // Don't set equal to 0.
  75. #define STAR_ANIMATION_SPEED 1
  76. /**
  77. * Island Parameters
  78. */
  79. #define ISLAND_LINE 12 // line that the island starts at. Island is 2 lines tall
  80. #define ISLAND_COLUMN 0 // column that the island starts at
  81. #define ISLAND_CALM 20 // WPM at which the palm tree calmly moves
  82. #define ISLAND_HEAVY_STORM 40 // WPM at which the heavy storm occurs
  83. #define ISLAND_HURRICANE 60 // WPM at which THE HURRICANE STARTS
  84. /*
  85. * DON'T TOUCH
  86. */
  87. extern bool is_calm;
  88. // timers
  89. extern uint32_t starry_night_anim_timer;
  90. extern uint32_t starry_night_anim_sleep;
  91. void render_stars(void);