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:
@ -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>
|
||||
|
||||
@ -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
|
||||
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user