Don't use floats for the Haunt effect

Fixes #7.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
pull/365/head
Gergely Nagy 8 years ago
parent f2ca23adc5
commit 67262add72

@ -92,22 +92,18 @@ namespace KaleidoscopePlugins {
namespace Stalker {
cRGB Haunt::highlightColor;
// Haunt
float Haunt::mb;
float Haunt::mg;
float Haunt::mr;
Haunt::Haunt (const cRGB highlightColor) {
mb = highlightColor.b / 255.0;
mg = highlightColor.g / 255.0;
mr = highlightColor.r / 255.0;
Haunt::Haunt (const cRGB highlightColor_) {
highlightColor = highlightColor_;
}
cRGB
Haunt::compute (uint8_t step) {
cRGB color = {(uint8_t)min(step * mb, 255),
(uint8_t)min(step * mg, 255),
(uint8_t)min(step * mr, 255)};
cRGB color = CRGB((uint8_t)min(step * highlightColor.r / 255, 255),
(uint8_t)min(step * highlightColor.g / 255, 255),
(uint8_t)min(step * highlightColor.b / 255, 255));
return color;
}

@ -56,9 +56,8 @@ namespace KaleidoscopePlugins {
Haunt (void *) : Haunt () {};
virtual cRGB compute (uint8_t step) final;
private:
static float mr, mg, mb;
static cRGB highlightColor;
};
class BlazingTrail : public StalkerEffect::ColorComputer {

Loading…
Cancel
Save