Swap to WLED_ENABLE_GIF

This commit is contained in:
Will Tatam 2025-01-14 18:40:41 +00:00
parent e852df3179
commit 56b8af86d7
4 changed files with 6 additions and 4 deletions

View File

@ -4484,7 +4484,7 @@ static const char _data_FX_MODE_WASHING_MACHINE[] PROGMEM = "Washing Machine@!,!
Draws a .gif image from filesystem on the matrix/strip Draws a .gif image from filesystem on the matrix/strip
*/ */
uint16_t mode_image(void) { uint16_t mode_image(void) {
#ifdef WLED_DISABLE_GIF #ifndef WLED_ENABLE_GIF
return mode_static(); return mode_static();
#else #else
renderImageToSegment(SEGMENT); renderImageToSegment(SEGMENT);
@ -7755,7 +7755,9 @@ void WS2812FX::setupEffectData() {
addEffect(FX_MODE_TWO_DOTS, &mode_two_dots, _data_FX_MODE_TWO_DOTS); addEffect(FX_MODE_TWO_DOTS, &mode_two_dots, _data_FX_MODE_TWO_DOTS);
addEffect(FX_MODE_FAIRYTWINKLE, &mode_fairytwinkle, _data_FX_MODE_FAIRYTWINKLE); addEffect(FX_MODE_FAIRYTWINKLE, &mode_fairytwinkle, _data_FX_MODE_FAIRYTWINKLE);
addEffect(FX_MODE_RUNNING_DUAL, &mode_running_dual, _data_FX_MODE_RUNNING_DUAL); addEffect(FX_MODE_RUNNING_DUAL, &mode_running_dual, _data_FX_MODE_RUNNING_DUAL);
#ifdef WLED_ENABLE_GIF
addEffect(FX_MODE_IMAGE, &mode_image, _data_FX_MODE_IMAGE); addEffect(FX_MODE_IMAGE, &mode_image, _data_FX_MODE_IMAGE);
#endif
addEffect(FX_MODE_TRICOLOR_CHASE, &mode_tricolor_chase, _data_FX_MODE_TRICOLOR_CHASE); addEffect(FX_MODE_TRICOLOR_CHASE, &mode_tricolor_chase, _data_FX_MODE_TRICOLOR_CHASE);
addEffect(FX_MODE_TRICOLOR_WIPE, &mode_tricolor_wipe, _data_FX_MODE_TRICOLOR_WIPE); addEffect(FX_MODE_TRICOLOR_WIPE, &mode_tricolor_wipe, _data_FX_MODE_TRICOLOR_WIPE);
addEffect(FX_MODE_TRICOLOR_FADE, &mode_tricolor_fade, _data_FX_MODE_TRICOLOR_FADE); addEffect(FX_MODE_TRICOLOR_FADE, &mode_tricolor_fade, _data_FX_MODE_TRICOLOR_FADE);

View File

@ -195,7 +195,7 @@ void Segment::resetIfRequired() {
if (data && _dataLen > 0) memset(data, 0, _dataLen); // prevent heap fragmentation (just erase buffer instead of deallocateData()) if (data && _dataLen > 0) memset(data, 0, _dataLen); // prevent heap fragmentation (just erase buffer instead of deallocateData())
next_time = 0; step = 0; call = 0; aux0 = 0; aux1 = 0; next_time = 0; step = 0; call = 0; aux0 = 0; aux1 = 0;
reset = false; reset = false;
#ifndef WLED_DISABLE_GIF #ifdef WLED_ENABLE_GIF
endImagePlayback(this); endImagePlayback(this);
#endif #endif
} }

View File

@ -217,7 +217,7 @@ void onHueData(void* arg, AsyncClient* client, void *data, size_t len);
#include "FX.h" // must be below colors.cpp declarations (potentially due to duplicate declarations of e.g. color_blend) #include "FX.h" // must be below colors.cpp declarations (potentially due to duplicate declarations of e.g. color_blend)
//image_loader.cpp //image_loader.cpp
#ifndef WLED_DISABLE_GIF #ifdef WLED_ENABLE_GIF
bool fileSeekCallback(unsigned long position); bool fileSeekCallback(unsigned long position);
unsigned long filePositionCallback(void); unsigned long filePositionCallback(void);
int fileReadCallback(void); int fileReadCallback(void);

View File

@ -1,6 +1,6 @@
#include "wled.h" #include "wled.h"
#ifndef WLED_DISABLE_GIF #ifdef WLED_ENABLE_GIF
#include "GifDecoder.h" #include "GifDecoder.h"