summaryrefslogtreecommitdiffstats
path: root/thirdparty/squish/colourblock.cpp
diff options
context:
space:
mode:
authorBlueCube3310 <53150244+BlueCube3310@users.noreply.github.com>2023-12-06 19:56:55 +0100
committerBlueCube3310 <53150244+BlueCube3310@users.noreply.github.com>2023-12-07 13:26:34 +0100
commit433a2a6ea2bbaa06943db00de390c9aee14870c4 (patch)
tree81c73ed1d2f7e3785fa7090ff627c5f9d1299289 /thirdparty/squish/colourblock.cpp
parent7233bc6736e6a9e12758a52402660f9a3a892a78 (diff)
downloadredot-engine-433a2a6ea2bbaa06943db00de390c9aee14870c4.tar.gz
Fix squish RGTC_R decompression corruption
Diffstat (limited to 'thirdparty/squish/colourblock.cpp')
-rw-r--r--thirdparty/squish/colourblock.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/thirdparty/squish/colourblock.cpp b/thirdparty/squish/colourblock.cpp
index 3d87adaa77..f14c9362bd 100644
--- a/thirdparty/squish/colourblock.cpp
+++ b/thirdparty/squish/colourblock.cpp
@@ -24,9 +24,9 @@
-------------------------------------------------------------------------- */
#include "colourblock.h"
-// -- Godot start --
+// -- GODOT start --
#include "alpha.h"
-// -- Godot end --
+// -- GODOT end --
namespace squish {
@@ -214,7 +214,18 @@ void DecompressColour( u8* rgba, void const* block, bool isDxt1 )
}
}
-// -- Godot start --
+// -- GODOT start --
+void DecompressColourBc4( u8* rgba, void const* block)
+{
+ DecompressAlphaDxt5(rgba,block);
+ for ( int i = 0; i < 16; ++i ) {
+ rgba[i*4] = rgba[i*4 + 3];
+ rgba[i*4 + 1] = 0;
+ rgba[i*4 + 2] = 0;
+ rgba[i*4 + 3] = 255;
+ }
+}
+
void DecompressColourBc5( u8* rgba, void const* block)
{
void const* rblock = block;