effect math sppedup - up to 3x faster

-> distortion waves 3x speedup
-> hiphotic 2x speedup
-> waving cell 1.5x speedup

* replace sin8_t by lookup-table with pre-computed values
* moved integer sin and cos to fcn_declare.h (inlined by the compiler)
* moved gamma32 to fcn_declare.h (inlined by the compiler)
* a few other small tweaks
This commit is contained in:
Frank
2025-12-17 21:59:22 +01:00
parent 49e6de33c7
commit bc7cf062e8
7 changed files with 107 additions and 25 deletions

View File

@@ -5883,8 +5883,8 @@ static const char _data_FX_MODE_2DSNOWFALL[] PROGMEM = "Snow Fall ☾@!,Spawn Ra
uint16_t mode_2DHiphotic() { // By: ldirko https://editor.soulmatelights.com/gallery/810 , Modified by: Andrew Tuline
if (!strip.isMatrix) return mode_oops(); // not a 2D set-up
const uint16_t cols = SEGMENT.virtualWidth();
const uint16_t rows = SEGMENT.virtualHeight();
const uint_fast16_t cols = SEGMENT.virtualWidth();
const uint_fast16_t rows = SEGMENT.virtualHeight();
const uint32_t a = strip.now / ((SEGMENT.custom3>>1)+1);
for (int x = 0; x < cols; x++) {
@@ -8654,10 +8654,10 @@ static const char _data_FX_MODE_2DAKEMI[] PROGMEM = "Akemi@Color speed,Dance;Hea
uint16_t mode_2Ddistortionwaves() {
if (!strip.isMatrix) return mode_oops(); // not a 2D set-up
const uint16_t cols = SEGMENT.virtualWidth();
const uint16_t rows = SEGMENT.virtualHeight();
const uint_fast16_t cols = SEGMENT.virtualWidth();
const uint_fast16_t rows = SEGMENT.virtualHeight();
if (SEGENV.call == 0) {
SEGMENT.setUpLeds();
//SEGMENT.setUpLeds();
SEGMENT.fill(BLACK);
}