PVRTC: Move compress func to modules/pvr, drop obsolete PVRTexTool code

The code we had for PVRTexTool doesn't work as it's not compatible with current
PVRTexTool CLI options, and likely hasn't been for years.

Instead, we have our own vendored pvrtccompressor thirdparty library which all
users have thus de-facto been using. This commit moves the compress code to
`modules/pvr` where it belongs.

There's no proper compress function for PVRTC 2-bit format, that's a bug that
will need to be fixed (currently it's compressed as 4-bit format even if you
use Image::FORMAT_PVRTC2).

Fixes #28669.

(cherry picked from commit 1a31274855)
This commit is contained in:
Rémi Verschelde
2020-12-10 15:44:05 +01:00
parent 70af74587a
commit 688d422554
10 changed files with 107 additions and 222 deletions

View File

@@ -1,5 +1,5 @@
/*************************************************************************/
/* image_etc.cpp */
/* image_compress_etc.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -28,14 +28,16 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "image_etc.h"
#include "Etc.h"
#include "EtcFilter.h"
#include "image_compress_etc.h"
#include "core/image.h"
#include "core/os/copymem.h"
#include "core/os/os.h"
#include "core/print_string.h"
#include <Etc.h>
#include <EtcFilter.h>
static Image::Format _get_etc2_mode(Image::DetectChannels format) {
switch (format) {
case Image::DETECTED_R:

View File

@@ -1,5 +1,5 @@
/*************************************************************************/
/* image_etc.h */
/* image_compress_etc.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -28,9 +28,9 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef IMAGE_ETC1_H
#define IMAGE_ETC1_H
#ifndef IMAGE_COMPRESS_ETC_H
#define IMAGE_COMPRESS_ETC_H
void _register_etc_compress_func();
#endif // IMAGE_ETC_H
#endif // IMAGE_COMPRESS_ETC_H

View File

@@ -30,7 +30,7 @@
#include "register_types.h"
#include "image_etc.h"
#include "image_compress_etc.h"
#include "texture_loader_pkm.h"
static Ref<ResourceFormatPKM> resource_loader_pkm;