Merge pull request #24017 from eska014/rt-squish

Enable squish decompression in runtime builds
This commit is contained in:
Rémi Verschelde 2018-11-28 12:40:43 +01:00 committed by GitHub
commit b47d4e1ba5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 8 additions and 11 deletions

View file

@ -7673,7 +7673,7 @@ void RasterizerStorageGLES3::initialize() {
config.etc2_supported = true;
config.hdr_supported = false;
config.s3tc_supported = config.extensions.has("GL_EXT_texture_compression_dxt1") || config.extensions.has("GL_EXT_texture_compression_s3tc") || config.extensions.has("WEBGL_compressed_texture_s3tc");
config.rgtc_supported = config.extensions.has("GL_EXT_texture_compression_rgtc") || config.extensions.has("GL_ARB_texture_compression_rgtc");
config.rgtc_supported = config.extensions.has("GL_EXT_texture_compression_rgtc") || config.extensions.has("GL_ARB_texture_compression_rgtc") || config.extensions.has("EXT_texture_compression_rgtc");
#endif
config.pvrtc_supported = config.extensions.has("GL_IMG_texture_compression_pvrtc");

View file

@ -1,5 +1,5 @@
def can_build(env, platform):
return env['tools']
return True
def configure(env):
pass

View file

@ -30,8 +30,6 @@
#include "image_compress_squish.h"
#include "core/print_string.h"
#include <squish.h>
void image_decompress_squish(Image *p_image) {
@ -76,6 +74,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, float p_lossy_quality, Image::CompressSource p_source) {
if (p_image->get_format() >= Image::FORMAT_DXT1)
@ -204,3 +203,4 @@ 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);
}
}
#endif

View file

@ -33,7 +33,9 @@
#include "core/image.h"
#ifdef TOOLS_ENABLED
void image_compress_squish(Image *p_image, float p_lossy_quality, Image::CompressSource p_source);
#endif
void image_decompress_squish(Image *p_image);
#endif // IMAGE_COMPRESS_SQUISH_H

View file

@ -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

View file

@ -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