Tune some animations for the ex-Pfeiffer setup

This commit is contained in:
Thomas Kolb 2020-12-03 20:16:46 +01:00
parent d9ff33b784
commit 52053ea3bb
3 changed files with 10 additions and 7 deletions

View file

@ -20,8 +20,8 @@ class FireAnimation : public Animation
void reset(void) override; void reset(void) override;
private: private:
static const constexpr unsigned MAX_NEW_ENERGY = 160; static const constexpr unsigned MAX_NEW_ENERGY = 200;
static const constexpr unsigned RM_ENERGY = 7; static const constexpr unsigned RM_ENERGY = 5;
static const constexpr unsigned MAX_PULL_ENERGY_PCT = 100; static const constexpr unsigned MAX_PULL_ENERGY_PCT = 100;
std::vector<uint32_t> m_energy; std::vector<uint32_t> m_energy;

View file

@ -11,7 +11,7 @@ class StellarAnimation : public Animation
StellarAnimation(Fader *fader, StellarAnimation(Fader *fader,
const Fader::Color &background_color = Fader::Color{0x00, 0x02, 0x0c, 0x00}, const Fader::Color &background_color = Fader::Color{0x00, 0x02, 0x0c, 0x00},
const Fader::Color &star_color = Fader::Color{0x60, 0x30, 0x00, 0x60}, const Fader::Color &star_color = Fader::Color{0x60, 0x30, 0x00, 0x60},
int fadestep = 1, int spawn_interval_frames = 12); int fadestep = 1, int spawn_interval_frames = 6);
void loop(uint64_t frame) override; void loop(uint64_t frame) override;

View file

@ -6,7 +6,7 @@ FireAnimation::FireAnimation(Fader *fader, bool cold)
m_energySmooth(fader->modules_per_strip() * fader->strips()), m_energySmooth(fader->modules_per_strip() * fader->strips()),
m_stopping(false) m_stopping(false)
{ {
m_colorMapIndices.assign({0, 70, 120, 200, 225, 255}); m_colorMapIndices.assign({0, 100, 160, 200, 225, 255});
if(cold) { if(cold) {
m_colorMapColors.emplace_back(Fader::Color{ 0, 0, 0, 0}); m_colorMapColors.emplace_back(Fader::Color{ 0, 0, 0, 0});
@ -160,9 +160,12 @@ void FireAnimation::loop(uint64_t frame)
Fader::Color color; Fader::Color color;
for(std::size_t strip = 0; strip < nstrip; strip++) { for(std::size_t strip = 0; strip < nstrip; strip++) {
for(std::size_t led = 0; led < nled; led++) { for(std::size_t led = 0; led < nled; led+=4) {
colormap(m_energySmooth[idx(strip, led)], &color); colormap(m_energySmooth[idx(strip, led/4)], &color);
m_fader->fade_color(strip, led, color);
for(int i = 0; i < 4; i++) {
m_fader->fade_color(strip, led+i, color);
}
} }
} }
} }