The *matrix effects now are all derived from MatrixEffectBase class. Also, you can now set the amount of columns for these effects.
This commit is contained in:
@ -48,24 +48,40 @@ public:
|
||||
RandomMatrixEffectColumn(Window* win, uint8_t dir, bool rnd=false) : MatrixEffectColumn(win, dir, rnd) {};
|
||||
};
|
||||
|
||||
class MatrixEffect : public Effect {
|
||||
class MatrixEffectBase : public Effect {
|
||||
protected:
|
||||
MatrixEffectColumn** _columns;
|
||||
uint8_t _count;
|
||||
virtual uint8_t _get_count();
|
||||
virtual void _delete();
|
||||
void _init();
|
||||
virtual void _create() = 0;
|
||||
public:
|
||||
boolean can_be_shown_with_clock();
|
||||
MatrixEffect();
|
||||
virtual ~MatrixEffect();
|
||||
virtual ~MatrixEffectBase();
|
||||
void loop(uint16_t ms);
|
||||
String get_name() override { return "matrix"; }
|
||||
};
|
||||
|
||||
class RainbowMatrixEffect : public MatrixEffect {
|
||||
class MatrixEffect : public MatrixEffectBase {
|
||||
protected:
|
||||
void _create() override;
|
||||
public:
|
||||
MatrixEffect();
|
||||
String get_name() override { return "matrix"; }
|
||||
};
|
||||
|
||||
class RainbowMatrixEffect : public MatrixEffectBase {
|
||||
protected:
|
||||
void _create() override;
|
||||
public:
|
||||
RainbowMatrixEffect();
|
||||
String get_name() override { return "rainbow_matrix"; }
|
||||
};
|
||||
|
||||
class RandomMatrixEffect : public MatrixEffect {
|
||||
class RandomMatrixEffect : public MatrixEffectBase {
|
||||
protected:
|
||||
uint8_t _get_count() override;
|
||||
void _create() override;
|
||||
public:
|
||||
RandomMatrixEffect();
|
||||
String get_name() override { return "random_matrix"; }
|
||||
|
@ -28,6 +28,8 @@ struct Settings {
|
||||
uint16_t length_max = 20;
|
||||
uint16_t speed_min = 3;
|
||||
uint16_t speed_max = 7;
|
||||
uint16_t count = 16;
|
||||
uint16_t random_count = 32;
|
||||
} matrix;
|
||||
|
||||
struct /* confetti */ {
|
||||
|
Reference in New Issue
Block a user