summaryrefslogtreecommitdiff
path: root/modules/squish
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2021-04-15 14:02:45 +0200
committerRémi Verschelde <rverschelde@gmail.com>2021-04-16 17:08:36 +0200
commit0ab928e060a8b4995d13a7f4d281d1f9b3e78cc1 (patch)
tree74703d2cca4866a97048d4d13810f55448521e0e /modules/squish
parent2e87857d758efb69989bc8c1cc5693f86df55d87 (diff)
Import: Cleanup and optimize etcpak compression method
Avoid unnecessary allocation of temporary buffers for each mip, and creates only one Image with the compressed data. Also renames variable and reorders code for clarity. Clarify that squish is now only used for decompression. Documented which formats can be decompressed in Image.
Diffstat (limited to 'modules/squish')
-rw-r--r--modules/squish/image_decompress_squish.cpp (renamed from modules/squish/image_compress_squish.cpp)4
-rw-r--r--modules/squish/image_decompress_squish.h (renamed from modules/squish/image_compress_squish.h)8
-rw-r--r--modules/squish/register_types.cpp3
3 files changed, 8 insertions, 7 deletions
diff --git a/modules/squish/image_compress_squish.cpp b/modules/squish/image_decompress_squish.cpp
index fb0c7aba1d..1450b0fe88 100644
--- a/modules/squish/image_compress_squish.cpp
+++ b/modules/squish/image_decompress_squish.cpp
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* image_compress_squish.cpp */
+/* image_decompress_squish.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "image_compress_squish.h"
+#include "image_decompress_squish.h"
#include <squish.h>
diff --git a/modules/squish/image_compress_squish.h b/modules/squish/image_decompress_squish.h
index ebc5a41887..fff5839ac4 100644
--- a/modules/squish/image_compress_squish.h
+++ b/modules/squish/image_decompress_squish.h
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* image_compress_squish.h */
+/* image_decompress_squish.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -28,11 +28,11 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#ifndef IMAGE_COMPRESS_SQUISH_H
-#define IMAGE_COMPRESS_SQUISH_H
+#ifndef IMAGE_DECOMPRESS_SQUISH_H
+#define IMAGE_DECOMPRESS_SQUISH_H
#include "core/io/image.h"
void image_decompress_squish(Image *p_image);
-#endif // IMAGE_COMPRESS_SQUISH_H
+#endif // IMAGE_DECOMPRESS_SQUISH_H
diff --git a/modules/squish/register_types.cpp b/modules/squish/register_types.cpp
index c51cdc9521..51aab040e7 100644
--- a/modules/squish/register_types.cpp
+++ b/modules/squish/register_types.cpp
@@ -29,7 +29,8 @@
/*************************************************************************/
#include "register_types.h"
-#include "image_compress_squish.h"
+
+#include "image_decompress_squish.h"
void register_squish_types() {
Image::_image_decompress_bc = image_decompress_squish;