Better handling of Animations, their members and the destructor.

This commit is contained in:
2019-06-19 22:16:06 +02:00
parent cb4afa5043
commit 41af01ee0b
4 changed files with 46 additions and 28 deletions

View File

@ -1,16 +1,20 @@
#include "effect_animation.h"
#include "functions.h"
AnimationEffect::AnimationEffect(const char* name, CRGB* bg, int x, int y) {
this->bg_color = bg;
AnimationEffect::AnimationEffect(const char* name, uint32_t bg, int x, int y) {
this->xOffset = x;
this->yOffset = y;
this->animation = new Animation(name, window);
this->animation->setBgColor(this->bg_color);
this->animation->setBgColor(bg);
this->animation->setOffsets(this->xOffset, this->yOffset);
}
AnimationEffect* AnimationEffect::setFgColor(uint32_t c) {
animation->setFgColor(c);
return this;
}
AnimationEffect::~AnimationEffect() {
delete this->animation;
}