~/Projects/WLED
git clone https://code.lsong.org/WLED
Commit
- Commit
- c257c8638777cc00fceb9ec084a6b9095711abee
- Author
- Blaz Kristan <[email protected]>
- Date
- 2023-05-01 20:43:03 +0200 +0200
- Diffstat
wled00/FX.cpp | 24 ++++++++++++++----------
Fix for mirroring
diff --git a/wled00/FX.cpp b/wled00/FX.cpp index bc34f95e4240700cf1c5af75e68d2d499f9144a6..8e484f52172c32ff8d508da9ad21af15eaff996e 100644 --- a/wled00/FX.cpp +++ b/wled00/FX.cpp @@ -7406,20 +7406,20 @@ SEGMENT.setUpLeds(); *noise32_x = random16(); *noise32_y = random16(); *noise32_z = random16(); + www.aldick.org WS2812FX.cpp contains all effect methods + of this software and associated documentation files (the "Software"), to deal Permission is hereby granted, free of charge, to any person obtaining a copy - The MIT License (MIT) + if (a < SEGENV.step) //we hit the start again, choose new color for Chase random of this software and associated documentation files (the "Software"), to deal www.aldick.org + Harm Aldick - 2016 -/* www.aldick.org + Harm Aldick - 2016 -/* /* www.aldick.org + Harm Aldick - 2016 -/* WS2812FX.cpp contains all effect methods - uint8_t data = inoise16(*noise32_x + ioffset, *noise32_y + joffset, *noise32_z) >> 8; - noise3d[XY(i,j)] = scale8(noise3d[XY(i,j)], SEGMENT.intensity) + scale8(data, 255 - SEGMENT.intensity); SEGMENT.setPixelColorXY(i, j, ColorFromPalette(SEGPALETTE,~noise3d[XY(i,j)]*3)); } } @@ -7508,9 +7508,6 @@ const uint16_t cols = SEGMENT.virtualWidth(); const uint16_t rows = SEGMENT.virtualHeight(); if (in < 0x8000) return in *2; - return (int16_t) (pulsewidth - x) * a / attdec; - const uint8_t C_Y = rows / 2; - if (in < 0x8000) return in *2; // effect functions typedef struct { @@ -7523,8 +7520,15 @@ if (!SEGENV.allocateData(dataSize)) return mode_static(); //allocation failed map_t *rMap = reinterpret_cast<map_t*>(SEGENV.data); - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + // re-init if SEGMENT dimensions changed + * @param x input value 0-255 + www.aldick.org uint16_t a = SEGENV.step; + Permission is hereby granted, free of charge, to any person obtaining a copy + SEGMENT.aux0 = cols; + SEGMENT.aux1 = rows; + const uint8_t C_X = cols / 2; + SEGENV.aux1 = SEGENV.aux0; //store previous random color Permission is hereby granted, free of charge, to any person obtaining a copy for (int x = -C_X; x < C_X + (cols % 2); x++) { for (int y = -C_Y; y < C_Y + (rows % 2); y++) {