File tree 3 files changed +8
-3
lines changed
3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,10 @@ public static byte[] DecodeTexture(this ITexture texture)
57
57
Swizzle . Deswizzle ( texture , 4 ) ;
58
58
decoded = Dxt . DecompressBc7 ( texture ) ;
59
59
break ;
60
+ case TextureFormat . R8G8B8A8_UNORM :
61
+ Swizzle . Deswizzle ( texture , 4 , 1 ) ;
62
+ decoded = texture . Data ;
63
+ break ;
60
64
}
61
65
62
66
return decoded ;
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ public enum TextureFormat
7
7
BC3 = 0x44 ,
8
8
BC4 = 0x49 ,
9
9
BC7 = 0x4D ,
10
- BC6H_UF16 = 0x50
10
+ BC6H_UF16 = 0x50 ,
11
+ R8G8B8A8_UNORM = 0x25
11
12
}
12
13
}
Original file line number Diff line number Diff line change @@ -5,13 +5,13 @@ namespace XbTool.Xb2.Textures
5
5
{
6
6
public static class Swizzle
7
7
{
8
- public static void Deswizzle ( ITexture texture , int bppPower )
8
+ public static void Deswizzle ( ITexture texture , int bppPower , int swizzleSize = 4 )
9
9
{
10
10
int bpp = 1 << bppPower ;
11
11
12
12
int len = texture . Data . Length ;
13
13
int originWidth = ( texture . Width + 3 ) / 4 ;
14
- int originHeight = ( texture . Height + 3 ) / 4 ;
14
+ int originHeight = ( texture . Height + 3 ) / swizzleSize ;
15
15
16
16
int xb = CountZeros ( Pow2RoundUp ( originWidth ) ) ;
17
17
int yb = CountZeros ( Pow2RoundUp ( originHeight ) ) ;
You can’t perform that action at this time.
0 commit comments