Fabian Schlenz
382631d7d7
the effects to show animations that stay fluid independent of the current frame rate.
36 lines
940 B
C++
36 lines
940 B
C++
#pragma once
|
|
#include "Effect.h"
|
|
#include "config.h"
|
|
|
|
class SingleDynamicEffect : public Effect {
|
|
protected:
|
|
static const int factor = 2;
|
|
static const int tile_count = LED_WIDTH/factor * LED_HEIGHT/factor;
|
|
CRGB tiles[tile_count];
|
|
CRGB old_tiles[tile_count];
|
|
uint8_t blend = 0;
|
|
public:
|
|
SingleDynamicEffect();
|
|
void init();
|
|
boolean can_be_shown_with_clock();
|
|
virtual void loop(uint16_t ms);
|
|
void draw();
|
|
String get_name() override { return "single_dynamic"; }
|
|
};
|
|
|
|
class MultiDynamicEffect : public SingleDynamicEffect {
|
|
public:
|
|
void loop(uint16_t ms);
|
|
String get_name() override { return "multi_dynamic"; }
|
|
};
|
|
|
|
class BigDynamicEffect : public Effect {
|
|
private:
|
|
Window* window = new Window(0, 0, LED_WIDTH, LED_HEIGHT-6);
|
|
public:
|
|
void loop(uint16_t ms);
|
|
~BigDynamicEffect();
|
|
boolean can_be_shown_with_clock() override;
|
|
String get_name() override { return "big_dynamic"; }
|
|
};
|