Remove FRAMETIME return value from all FX (#5314)
* remove "return FRAMETIME" from all FX, fix timing for some FX - all FX now render every frame, no more "speed up" during transitions * fix missing return by adding FS_FALLBACK_STATIC macro * add FX_FALLBACK_STATIC also to user_fx * remove obsolete seg.next_time
This commit is contained in:
@@ -3,11 +3,12 @@
|
||||
// for information how FX metadata strings work see https://kno.wled.ge/interfaces/json-api/#effect-metadata
|
||||
|
||||
// static effect, used if an effect fails to initialize
|
||||
static uint16_t mode_static(void) {
|
||||
static void mode_static(void) {
|
||||
SEGMENT.fill(SEGCOLOR(0));
|
||||
return strip.isOffRefreshRequired() ? FRAMETIME : 350;
|
||||
}
|
||||
|
||||
#define FX_FALLBACK_STATIC { mode_static(); return; }
|
||||
|
||||
// If you define configuration options in your class and need to reference them in your effect function, add them here.
|
||||
// If you only need to use them in your class you can define them as class members instead.
|
||||
// bool myConfigValue = false;
|
||||
@@ -17,9 +18,9 @@ static uint16_t mode_static(void) {
|
||||
/////////////////////////
|
||||
|
||||
// Diffusion Fire: fire effect intended for 2D setups smaller than 16x16
|
||||
static uint16_t mode_diffusionfire(void) {
|
||||
static void mode_diffusionfire(void) {
|
||||
if (!strip.isMatrix || !SEGMENT.is2D())
|
||||
return mode_static(); // not a 2D set-up
|
||||
FX_FALLBACK_STATIC; // not a 2D set-up
|
||||
|
||||
const int cols = SEG_W;
|
||||
const int rows = SEG_H;
|
||||
@@ -33,7 +34,7 @@ static uint16_t mode_diffusionfire(void) {
|
||||
|
||||
unsigned dataSize = cols * rows; // SEGLEN (virtual length) is equivalent to vWidth()*vHeight() for 2D
|
||||
if (!SEGENV.allocateData(dataSize))
|
||||
return mode_static(); // allocation failed
|
||||
FX_FALLBACK_STATIC; // allocation failed
|
||||
|
||||
if (SEGENV.call == 0) {
|
||||
SEGMENT.fill(BLACK);
|
||||
@@ -88,7 +89,6 @@ unsigned dataSize = cols * rows; // SEGLEN (virtual length) is equivalent to vW
|
||||
}
|
||||
}
|
||||
}
|
||||
return FRAMETIME;
|
||||
}
|
||||
static const char _data_FX_MODE_DIFFUSIONFIRE[] PROGMEM = "Diffusion Fire@!,Spark rate,Diffusion Speed,Turbulence,,Use palette;;Color;;2;pal=35";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user