Image: Include S3TC compression via Squish in non-tools build
We already build Squish in templates build for S3TC decompression, so we can as well expose the compression feature. Fixes #25640.
This commit is contained in:
parent
087ffc8b5a
commit
c7b701dfd2
6 changed files with 3 additions and 9 deletions
|
@ -73,7 +73,6 @@ 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);
|
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, float p_lossy_quality, Image::CompressSource p_source) {
|
void image_compress_squish(Image *p_image, float p_lossy_quality, Image::CompressSource p_source) {
|
||||||
|
|
||||||
if (p_image->get_format() >= Image::FORMAT_DXT1)
|
if (p_image->get_format() >= Image::FORMAT_DXT1)
|
||||||
|
@ -203,4 +202,3 @@ void image_compress_squish(Image *p_image, float p_lossy_quality, Image::Compres
|
||||||
p_image->create(p_image->get_width(), p_image->get_height(), p_image->has_mipmaps(), target_format, data);
|
p_image->create(p_image->get_width(), p_image->get_height(), p_image->has_mipmaps(), target_format, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
|
@ -33,9 +33,7 @@
|
||||||
|
|
||||||
#include "core/image.h"
|
#include "core/image.h"
|
||||||
|
|
||||||
#ifdef TOOLS_ENABLED
|
|
||||||
void image_compress_squish(Image *p_image, float p_lossy_quality, Image::CompressSource p_source);
|
void image_compress_squish(Image *p_image, float p_lossy_quality, Image::CompressSource p_source);
|
||||||
#endif
|
|
||||||
void image_decompress_squish(Image *p_image);
|
void image_decompress_squish(Image *p_image);
|
||||||
|
|
||||||
#endif // IMAGE_COMPRESS_SQUISH_H
|
#endif // IMAGE_COMPRESS_SQUISH_H
|
||||||
|
|
|
@ -33,9 +33,7 @@
|
||||||
|
|
||||||
void register_squish_types() {
|
void register_squish_types() {
|
||||||
|
|
||||||
#ifdef TOOLS_ENABLED
|
|
||||||
Image::set_compress_bc_func(image_compress_squish);
|
Image::set_compress_bc_func(image_compress_squish);
|
||||||
#endif
|
|
||||||
Image::_image_decompress_bc = image_decompress_squish;
|
Image::_image_decompress_bc = image_decompress_squish;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -95,7 +95,7 @@ def configure(env):
|
||||||
if not env['builtin_enet']:
|
if not env['builtin_enet']:
|
||||||
env.ParseConfig('pkg-config libenet --cflags --libs')
|
env.ParseConfig('pkg-config libenet --cflags --libs')
|
||||||
|
|
||||||
if not env['builtin_squish'] and env['tools']:
|
if not env['builtin_squish']:
|
||||||
env.ParseConfig('pkg-config libsquish --cflags --libs')
|
env.ParseConfig('pkg-config libsquish --cflags --libs')
|
||||||
|
|
||||||
if not env['builtin_zstd']:
|
if not env['builtin_zstd']:
|
||||||
|
|
|
@ -162,7 +162,7 @@ def configure(env):
|
||||||
if not env['builtin_enet']:
|
if not env['builtin_enet']:
|
||||||
env.ParseConfig('pkg-config libenet --cflags --libs')
|
env.ParseConfig('pkg-config libenet --cflags --libs')
|
||||||
|
|
||||||
if not env['builtin_squish'] and env['tools']:
|
if not env['builtin_squish']:
|
||||||
env.ParseConfig('pkg-config libsquish --cflags --libs')
|
env.ParseConfig('pkg-config libsquish --cflags --libs')
|
||||||
|
|
||||||
if not env['builtin_zstd']:
|
if not env['builtin_zstd']:
|
||||||
|
|
|
@ -232,7 +232,7 @@ def configure(env):
|
||||||
if not env['builtin_enet']:
|
if not env['builtin_enet']:
|
||||||
env.ParseConfig('pkg-config libenet --cflags --libs')
|
env.ParseConfig('pkg-config libenet --cflags --libs')
|
||||||
|
|
||||||
if not env['builtin_squish'] and env['tools']:
|
if not env['builtin_squish']:
|
||||||
env.ParseConfig('pkg-config libsquish --cflags --libs')
|
env.ParseConfig('pkg-config libsquish --cflags --libs')
|
||||||
|
|
||||||
if not env['builtin_zstd']:
|
if not env['builtin_zstd']:
|
||||||
|
|
Loading…
Reference in a new issue