Effects are now constructed when needed instead of having global objects of every effect flying around.

This commit is contained in:
2019-06-18 18:14:59 +02:00
parent 5a02050680
commit 0941ad8349
4 changed files with 66 additions and 95 deletions

View File

@ -2,16 +2,17 @@
#define effects_H
#include <SimpleList.h>
#include "EffectEntry.h"
#include "Effect.h"
#include "effect_clock.h"
extern SimpleList<EffectEntry>* effects;
extern SimpleList<Effect*>* cycle_effects;
extern const char* cycle_effects[];
extern uint8_t cycle_effects_count;
extern Effect* current_effect;
extern ClockEffect effect_clock;
Effect* string_to_effect(String s);
bool change_current_effect(String s);
void setup_effects();
#endif

View File

@ -2,18 +2,6 @@
#include <Arduino.h>
typedef struct {
uint8_t *colors;
uint8_t *data;
uint16_t *offsets;
uint16_t *delays;
boolean individual_delays;
int color_count;
int frame_count;
int w;
int h;
} AnimationData;
typedef struct {
uint8_t width;
uint8_t height;