Windows. Everything now is implemented in Windows. ;-) (Okay, just the drawing stuff. And defnititely nothing by Microsoft.)

This commit is contained in:
2019-06-11 19:48:09 +02:00
parent 9acdc42dc3
commit 83254f2eaa
25 changed files with 223 additions and 223 deletions

View File

@ -3,6 +3,7 @@
SnakeEffect::SnakeEffect() {
this->coords = {0, 0};
this->window = new Window(0, 0, LED_WIDTH, LED_HEIGHT-6);
}
void SnakeEffect::loop() {
@ -12,8 +13,9 @@ void SnakeEffect::loop() {
this->coords = update_position(this->coords, this->direction);
}
fadeToBlackBy(leds, LED_COUNT, 2);
setPixel(window, this->coords.x, this->coords.y, CHSV(hue, 200, 255));
window->fadeToBlackBy(2);
CRGB color(CHSV(hue, 200, 255));
window->setPixel(this->coords.x, this->coords.y, &color);
hue++;
}
@ -43,7 +45,7 @@ bool SnakeEffect::is_turn_needed() {
bool SnakeEffect::is_direction_okay(uint8_t dir) {
Coords c = update_position(this->coords, dir);
return c.x<window.w && c.y<window.h;
return c.x<window->width && c.y<window->height;
}
Coords SnakeEffect::update_position(Coords original, uint8_t direction) {