From d1f76bb5df784fb23f3b541c8e9c6500e60dfdd5 Mon Sep 17 00:00:00 2001 From: Pedro413 <44695680+Pedro413@users.noreply.github.com> Date: Mon, 20 May 2024 16:57:07 +1000 Subject: [PATCH] fix DecodeCubemap formats --- TagTool/Bitmaps/Utils/BitmapDecoder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TagTool/Bitmaps/Utils/BitmapDecoder.cs b/TagTool/Bitmaps/Utils/BitmapDecoder.cs index b1693983..261bd301 100644 --- a/TagTool/Bitmaps/Utils/BitmapDecoder.cs +++ b/TagTool/Bitmaps/Utils/BitmapDecoder.cs @@ -1483,7 +1483,7 @@ private static byte[] EncodeY8(byte[] data, int width, int height) public static List DecodeCubemap(byte[] bitmRaw, BitmapFormat format, int virtualWidth, int virtualHeight) { - int faceSize = virtualWidth * virtualHeight; // HACK DXT5 ONLY + int faceSize = (virtualWidth * virtualHeight * BitmapFormatUtils.GetBitsPerPixel(format)) / 8; List result = new List();//new byte[rawFaceSize * 6];