diff options
Diffstat (limited to 'users/snowe/ocean_dream.h')
| -rw-r--r-- | users/snowe/ocean_dream.h | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/users/snowe/ocean_dream.h b/users/snowe/ocean_dream.h new file mode 100644 index 000000000..498375559 --- /dev/null +++ b/users/snowe/ocean_dream.h | |||
| @@ -0,0 +1,103 @@ | |||
| 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 | |||
| 18 | #pragma once | ||
| 19 | #include "quantum.h" | ||
| 20 | |||
| 21 | /** | ||
| 22 | * Features: | ||
| 23 | * You can turn on and off features in this section | ||
| 24 | */ | ||
| 25 | #define ENABLE_MOON // Uses 182 bytes | ||
| 26 | #define ENABLE_WAVE // Uses 844 bytes | ||
| 27 | #define ENABLE_SHOOTING_STARS // Uses 872 bytes | ||
| 28 | #define ENABLE_ISLAND | ||
| 29 | #define ENABLE_STARS // Uses 606 bytes | ||
| 30 | |||
| 31 | /** | ||
| 32 | * Global Settings | ||
| 33 | */ | ||
| 34 | #define STARRY_NIGHT_ANIM_FRAME_DURATION 30 // how long each frame lasts in ms | ||
| 35 | #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 | ||
| 36 | #define WIDTH OLED_DISPLAY_HEIGHT // for vertical displays | ||
| 37 | #define HEIGHT OLED_DISPLAY_WIDTH // for vertical displays | ||
| 38 | |||
| 39 | /** | ||
| 40 | * Moon Parameters | ||
| 41 | */ | ||
| 42 | #define MOON_LINE 4 // the line you want the moon to appear at | ||
| 43 | #define MOON_COLUMN 4 // the column you want the moon to appear at | ||
| 44 | //#define STATIC_MOON // uncomment this to make the moon a static image, no animation | ||
| 45 | #ifndef STATIC_MOON | ||
| 46 | # define ANIMATE_MOON_EVERY_N_FRAMES 100 // animate the moon every n frames | ||
| 47 | #endif | ||
| 48 | |||
| 49 | /** | ||
| 50 | * Wave Parameters | ||
| 51 | */ | ||
| 52 | #define OCEAN_LINE 14 // Line you want to render the ocean starting at (best at oled_max_lines() - 2) | ||
| 53 | #define WAVE_CALM 20 // render calm ocean under this WPM and ripple ocean at this WPM | ||
| 54 | #define WAVE_HEAVY_STORM 40 // render medium ocean at this WPM | ||
| 55 | #define WAVE_HURRICANE 60 // render heavy waves above this WPM | ||
| 56 | // What number of frames you want to animate the ocean at. | ||
| 57 | // Should be equal to or smaller than NUMBER_OF_FRAMES, e.g. 30, would animate on every other frame, 20, every third frame, etc | ||
| 58 | // Don't set equal to 0. | ||
| 59 | #define OCEAN_ANIMATION_SPEED 1 | ||
| 60 | |||
| 61 | /** | ||
| 62 | * Shooting Star Parameters | ||
| 63 | */ | ||
| 64 | #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 | ||
| 65 | #define SHOOTING_STAR_FRAMES 16 // how many 2 pixel frames per shooting star. Increment this for longer shooting stars | ||
| 66 | #define MAX_NUMBER_OF_SHOOTING_STARS 12 // maximum number of shooting stars that can be on screen at the same time | ||
| 67 | #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. | ||
| 68 | // What number of frames you want to animate the shooting stars at. | ||
| 69 | // Should be equal to or smaller than NUMBER_OF_FRAMES, e.g. 30, would animate on every other frame, 20, every third frame, etc | ||
| 70 | // Don't set equal to 0. | ||
| 71 | #define SHOOTING_STAR_ANIMATION_SPEED 30 | ||
| 72 | |||
| 73 | /** | ||
| 74 | * Star Parameters | ||
| 75 | */ | ||
| 76 | #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) | ||
| 77 | #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) | ||
| 78 | #define TWINKLE_PROBABILITY 25 // probability that any star twinkles on a given frame | ||
| 79 | // What number of frames you want to animate the stars at. | ||
| 80 | // Should be equal to or smaller than NUMBER_OF_FRAMES, e.g. 20, would animate on every frame, 10, every other frame, etc | ||
| 81 | // Don't set equal to 0. | ||
| 82 | #define STAR_ANIMATION_SPEED 1 | ||
| 83 | |||
| 84 | /** | ||
| 85 | * Island Parameters | ||
| 86 | */ | ||
| 87 | #define ISLAND_LINE 12 // line that the island starts at. Island is 2 lines tall | ||
| 88 | #define ISLAND_COLUMN 0 // column that the island starts at | ||
| 89 | #define ISLAND_CALM 20 // WPM at which the palm tree calmly moves | ||
| 90 | #define ISLAND_HEAVY_STORM 40 // WPM at which the heavy storm occurs | ||
| 91 | #define ISLAND_HURRICANE 60 // WPM at which THE HURRICANE STARTS | ||
| 92 | |||
| 93 | /* | ||
| 94 | * DON'T TOUCH | ||
| 95 | */ | ||
| 96 | |||
| 97 | extern bool is_calm; | ||
| 98 | |||
| 99 | // timers | ||
| 100 | extern uint32_t starry_night_anim_timer; | ||
| 101 | extern uint32_t starry_night_anim_sleep; | ||
| 102 | |||
| 103 | void render_stars(void); | ||
