Better handling of Animations, their members and the destructor.
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user