-
Notifications
You must be signed in to change notification settings - Fork 545
Expand file tree
/
Copy pathDisplaySaverScreen.h
More file actions
63 lines (52 loc) · 1.67 KB
/
DisplaySaverScreen.h
File metadata and controls
63 lines (52 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef _DISPLAYSAVERSCREEN_H_
#define _DISPLAYSAVERSCREEN_H_
#include <vector>
#include "GPGFX_UI_widgets.h"
const uint8_t SCREEN_WIDTH = 128;
const uint8_t SCREEN_HEIGHT = 64;
class DisplaySaverScreen : public GPScreen {
public:
DisplaySaverScreen() {}
DisplaySaverScreen(GPGFX* renderer) { setRenderer(renderer); }
virtual ~DisplaySaverScreen() {}
virtual int8_t update();
virtual void init();
virtual void shutdown();
protected:
virtual void drawScreen();
uint16_t prevButtonState = 0;
DisplaySaverMode displaySaverMode{};
// snow screen
uint8_t snowflakeSpeeds[SCREEN_WIDTH][SCREEN_HEIGHT] = {};
int8_t snowflakeDrift[SCREEN_WIDTH][SCREEN_HEIGHT] = {};
void initSnowScene();
void drawSnowScene();
// bounce
uint16_t bounceSpriteX = 0;
uint16_t bounceSpriteY = 0;
uint16_t bounceSpriteWidth = 128;
uint16_t bounceSpriteHeight = 35;
double bounceSpriteVelocityX = 1;
double bounceSpriteVelocityY = 1;
double bounceScale = 0.5;
void drawBounceScene();
// pipes
void drawPipeScene();
// toaster
struct ToastParams {
double scale;
int16_t x;
int16_t y;
int16_t dx;
int16_t dy;
};
std::vector<ToastParams> toasters;
uint16_t numberOfToasters = 10;
uint16_t toasterSpriteWidth = 128;
uint16_t toasterSpriteHeight = 35;
void initToasters();
void drawToasterScene();
void delay_us(uint32_t us);
const uint32_t SCREEN_DELAY_PIPES = 30;
};
#endif