Railway FX

- slower minimum speed
- allow color 1 & 2 in UI
This commit is contained in:
Blaz Kristan 2022-12-26 10:25:26 +01:00
parent 6f67132f4b
commit 6d1ff7c3f3

View File

@ -2351,7 +2351,7 @@ static const char _data_FX_MODE_METEOR_SMOOTH[] PROGMEM = "Meteor Smooth@!,Trail
//Railway Crossing / Christmas Fairy lights //Railway Crossing / Christmas Fairy lights
uint16_t mode_railway() uint16_t mode_railway()
{ {
uint16_t dur = 40 + (255 - SEGMENT.speed) * 10; uint16_t dur = (256 - SEGMENT.speed) * 40;
uint16_t rampdur = (dur * SEGMENT.intensity) >> 8; uint16_t rampdur = (dur * SEGMENT.intensity) >> 8;
if (SEGENV.step > dur) if (SEGENV.step > dur)
{ {
@ -2368,16 +2368,16 @@ uint16_t mode_railway()
if (SEGENV.aux0) pos = 255 - pos; if (SEGENV.aux0) pos = 255 - pos;
for (int i = 0; i < SEGLEN; i += 2) for (int i = 0; i < SEGLEN; i += 2)
{ {
SEGMENT.setPixelColor(i, SEGMENT.color_from_palette(255 - pos, false, false, 255)); SEGMENT.setPixelColor(i, SEGMENT.color_from_palette(255 - pos, false, false, 255)); // do not use color 1 or 2, always use palette
if (i < SEGLEN -1) if (i < SEGLEN -1)
{ {
SEGMENT.setPixelColor(i + 1, SEGMENT.color_from_palette(pos, false, false, 255)); SEGMENT.setPixelColor(i + 1, SEGMENT.color_from_palette(pos, false, false, 255)); // do not use color 1 or 2, always use palette
} }
} }
SEGENV.step += FRAMETIME; SEGENV.step += FRAMETIME;
return FRAMETIME; return FRAMETIME;
} }
static const char _data_FX_MODE_RAILWAY[] PROGMEM = "Railway@!,Smoothness;;!"; static const char _data_FX_MODE_RAILWAY[] PROGMEM = "Railway@!,Smoothness;1,2;!";
//Water ripple //Water ripple