summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-11-28 12:40:43 +0100
committerGitHub <noreply@github.com>2018-11-28 12:40:43 +0100
commitb47d4e1ba5d72bac5c2e671d9e4c0ae037a248c0 (patch)
treedf40bf82197ca74078589b84cef244042411ecdd
parentc4784426bd1c5c102bf02fbeef5cf09ab4634379 (diff)
parent93bed8cf579d049598dccda9b05f381742dde5a9 (diff)
Merge pull request #24017 from eska014/rt-squish
Enable squish decompression in runtime builds
-rw-r--r--drivers/gles3/rasterizer_storage_gles3.cpp2
-rw-r--r--modules/squish/config.py2
-rw-r--r--modules/squish/image_compress_squish.cpp4
-rw-r--r--modules/squish/image_compress_squish.h2
-rw-r--r--modules/squish/register_types.cpp7
-rw-r--r--modules/squish/register_types.h2
6 files changed, 8 insertions, 11 deletions
diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp
index 235c799a55..2b038fcc0e 100644
--- a/drivers/gles3/rasterizer_storage_gles3.cpp
+++ b/drivers/gles3/rasterizer_storage_gles3.cpp
@@ -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");
diff --git a/modules/squish/config.py b/modules/squish/config.py
index 098f1eafa9..1c8cd12a2d 100644
--- a/modules/squish/config.py
+++ b/modules/squish/config.py
@@ -1,5 +1,5 @@
def can_build(env, platform):
- return env['tools']
+ return True
def configure(env):
pass
diff --git a/modules/squish/image_compress_squish.cpp b/modules/squish/image_compress_squish.cpp
index a08ac7bd28..4161a0f6ae 100644
--- a/modules/squish/image_compress_squish.cpp
+++ b/modules/squish/image_compress_squish.cpp
@@ -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
diff --git a/modules/squish/image_compress_squish.h b/modules/squish/image_compress_squish.h
index dfebdc955f..dd53f2787a 100644
--- a/modules/squish/image_compress_squish.h
+++ b/modules/squish/image_compress_squish.h
@@ -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
diff --git a/modules/squish/register_types.cpp b/modules/squish/register_types.cpp
index d4ed676cce..9a5bb47f19 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 00f5c345c4..9dbd69c46b 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