Merge remote-tracking branch 'origin/ac_main' into mdev

This commit is contained in:
Ewoud
2022-12-16 11:43:27 +01:00
71 changed files with 2730 additions and 2157 deletions

View File

@@ -24,8 +24,8 @@
Modified heavily for WLED
*/
#include "FX.h"
#include "wled.h"
#include "FX.h"
#include "fcn_declare.h"
#define IBN 5100
@@ -3485,6 +3485,7 @@ uint16_t mode_tetrix(void) {
if (SEGENV.call == 0) {
drop->stack = 0; // reset brick stack size
drop->step = 0;
if (SEGMENT.check1) drop->col = 0;// use only one color from palette
//for (int i=0; i<SEGLEN; i++) SEGMENT.setPixelColor(indexToVStrip(i, stripNr), SEGCOLOR(1)); // will fill virtual strip only
}
@@ -3496,7 +3497,7 @@ uint16_t mode_tetrix(void) {
speed = map(speed, 1, 255, 5000, 250); // time taken for full (SEGLEN) drop
drop->speed = float(SEGLEN * FRAMETIME) / float(speed); // set speed
drop->pos = SEGLEN; // start at end of segment (no need to subtract 1)
drop->col = random8(0,15)<<4; // limit color choices so there is enough HUE gap
if (!SEGMENT.check1) drop->col = random8(0,15)<<4; // limit color choices so there is enough HUE gap
drop->step = 1; // drop state (0 init, 1 forming, 2 falling)
drop->brick = (SEGMENT.intensity ? (SEGMENT.intensity>>5)+1 : random8(1,5)) * (1+(SEGLEN>>6)); // size of brick
}
@@ -3510,7 +3511,7 @@ uint16_t mode_tetrix(void) {
if (drop->step == 2) { // falling
if (drop->pos > drop->stack) { // fall until top of stack
drop->pos -= drop->speed; // may add gravity as: speed += gravity
if (uint16_t(drop->pos) < drop->stack) drop->pos = drop->stack;
if (int(drop->pos) < int(drop->stack)) drop->pos = drop->stack;
for (int i=int(drop->pos); i<SEGLEN; i++) {
uint32_t col = i<int(drop->pos)+drop->brick ? SEGMENT.color_from_palette(drop->col, false, false, 0) : SEGCOLOR(1);
SEGMENT.setPixelColor(indexToVStrip(i, stripNr), col);
@@ -3530,6 +3531,7 @@ uint16_t mode_tetrix(void) {
} else {
drop->stack = 0; // reset brick stack size
drop->step = 0; // proceed with next brick
if (SEGMENT.check1) drop->col += 8; // gradually increase palette index
}
}
}
@@ -3540,7 +3542,7 @@ uint16_t mode_tetrix(void) {
return FRAMETIME;
}
static const char _data_FX_MODE_TETRIX[] PROGMEM = "Tetrix@!,Width;!,!;!;1.5d;sx=0,ix=0,pal=11,m12=1"; //WLEDMM 1.5d
static const char _data_FX_MODE_TETRIX[] PROGMEM = "Tetrix@!,Width,,,,One color;!,!;!;1.5d;sx=0,ix=0,pal=11,m12=1";//WLEDMM 1.5d
/*