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.
This commit is contained in:
Rémi Verschelde 2021-04-15 14:02:45 +02:00
parent 2e87857d75
commit 0ab928e060
No known key found for this signature in database
GPG key ID: C3336907360768E1
9 changed files with 108 additions and 85 deletions

View file

@ -186,7 +186,8 @@
<return type="int" enum="Error">
</return>
<description>
Decompresses the image if it is compressed. Returns an error if decompress function is not available.
Decompresses the image if it is VRAM compressed in a supported format. Returns [constant OK] if the format is supported, otherwise [constant ERR_UNAVAILABLE].
[b]Note:[/b] The following formats can be decompressed: DXT, RGTC, BPTC, PVRTC1. The formats ETC1 and ETC2 are not supported.
</description>
</method>
<method name="detect_alpha" qualifiers="const">