Build squish decompression in runtime
(cherry picked from commit 32751e09ac
)
This commit is contained in:
parent
b680939036
commit
a2381b9049
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue