From a2381b9049f908587139fdd0ebaedbc0c1ae490c Mon Sep 17 00:00:00 2001 From: Leon Krause Date: Tue, 27 Nov 2018 18:14:54 +0100 Subject: [PATCH] Build squish decompression in runtime (cherry picked from commit 32751e09ac1313baa4d22a4098c8dd03ba6a1741) --- modules/squish/image_compress_squish.cpp | 2 ++ modules/squish/image_compress_squish.h | 2 ++ modules/squish/register_types.cpp | 7 ++----- modules/squish/register_types.h | 2 -- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/modules/squish/image_compress_squish.cpp b/modules/squish/image_compress_squish.cpp index bb836c85782..a4ab9308695 100644 --- a/modules/squish/image_compress_squish.cpp +++ b/modules/squish/image_compress_squish.cpp @@ -81,6 +81,7 @@ void image_decompress_squish(Image *p_image) { p_image->create(p_image->get_width(), p_image->get_height(), p_image->has_mipmaps(), target_format, data); } +#ifdef TOOLS_ENABLED void image_compress_squish(Image *p_image, Image::CompressSource p_source) { if (p_image->get_format() >= Image::FORMAT_DXT1) @@ -176,3 +177,4 @@ void image_compress_squish(Image *p_image, Image::CompressSource p_source) { p_image->create(p_image->get_width(), p_image->get_height(), p_image->has_mipmaps(), target_format, data); } } +#endif diff --git a/modules/squish/image_compress_squish.h b/modules/squish/image_compress_squish.h index 060afce19e4..3d30396c0f5 100644 --- a/modules/squish/image_compress_squish.h +++ b/modules/squish/image_compress_squish.h @@ -33,7 +33,9 @@ #include "image.h" +#ifdef TOOLS_ENABLED void image_compress_squish(Image *p_image, Image::CompressSource p_source); +#endif void image_decompress_squish(Image *p_image); #endif // IMAGE_COMPRESS_SQUISH_H diff --git a/modules/squish/register_types.cpp b/modules/squish/register_types.cpp index 3e42563c9bc..be91fba4efd 100644 --- a/modules/squish/register_types.cpp +++ b/modules/squish/register_types.cpp @@ -29,17 +29,14 @@ /*************************************************************************/ #include "register_types.h" - -#ifdef TOOLS_ENABLED - #include "image_compress_squish.h" void register_squish_types() { +#ifdef TOOLS_ENABLED Image::set_compress_bc_func(image_compress_squish); +#endif Image::_image_decompress_bc = image_decompress_squish; } void unregister_squish_types() {} - -#endif diff --git a/modules/squish/register_types.h b/modules/squish/register_types.h index 4764c991222..59331463296 100644 --- a/modules/squish/register_types.h +++ b/modules/squish/register_types.h @@ -28,7 +28,5 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#ifdef TOOLS_ENABLED void register_squish_types(); void unregister_squish_types(); -#endif