Respect BIMG_CONFIG_DECODE_ASTC earlier (#118)

This commit is contained in:
Martijn Courteaux
2026-05-03 18:40:50 +02:00
committed by GitHub
parent e4294241cd
commit 60108ad6ee

View File

@@ -6,7 +6,9 @@
#include "bimg_p.h"
#include <bx/hash.h>
#if BIMG_CONFIG_DECODE_ASTC
#include <astcenc.h>
#endif
#include <bx/debug.h>
@@ -5077,7 +5079,7 @@ namespace bimg
case TextureFormat::ASTC10x10:
case TextureFormat::ASTC12x10:
case TextureFormat::ASTC12x12:
if (BX_ENABLED(BIMG_CONFIG_DECODE_ASTC) )
#if BIMG_CONFIG_DECODE_ASTC
{
const bimg::ImageBlockInfo& astcBlockInfo = bimg::getBlockInfo(_srcFormat);
@@ -5148,11 +5150,12 @@ namespace bimg
astcenc_context_free(context);
}
else
#else
{
BX_WARN(false, "ASTC decoder is disabled (BIMG_CONFIG_DECODE_ASTC).");
imageCheckerboard(_dst, _width, _height, 16, UINT32_C(0xff000000), UINT32_C(0xff00ff00) );
}
#endif
break;
default: