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
*/
uint16_t mode_image(void) {
#ifdef WLED_DISABLE_GIF
#ifndef WLED_ENABLE_GIF
return mode_static();
#else
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_FAIRYTWINKLE, &mode_fairytwinkle, _data_FX_MODE_FAIRYTWINKLE);
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);
#endif
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_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())
next_time = 0; step = 0; call = 0; aux0 = 0; aux1 = 0;
reset = false;
#ifndef WLED_DISABLE_GIF
#ifdef WLED_ENABLE_GIF
endImagePlayback(this);
#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)
//image_loader.cpp
#ifndef WLED_DISABLE_GIF
#ifdef WLED_ENABLE_GIF
bool fileSeekCallback(unsigned long position);
unsigned long filePositionCallback(void);
int fileReadCallback(void);

View File

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