Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #1425 from FourBrosStudio/develop3d

Fix for DXT5 decompression transparency problem
  • Loading branch information...
commit d9311353c909f4eb3781d3370a0ea4d67df44637 2 parents 1adebbd + f3f832a
@tomspilman tomspilman authored
Showing with 8 additions and 5 deletions.
  1. +8 −5 MonoGame.Framework/Graphics/DxtUtil.cs
View
13 MonoGame.Framework/Graphics/DxtUtil.cs
@@ -338,11 +338,14 @@ private static void DecompressDxt5Block(BinaryReader imageReader, int x, int y,
{
byte alpha0 = imageReader.ReadByte();
byte alpha1 = imageReader.ReadByte();
-
- ulong alphaMask = imageReader.ReadUInt32 ();
- alphaMask <<= 16;
- alphaMask += imageReader.ReadUInt16 ();
-
+
+ ulong alphaMask = (ulong)imageReader.ReadByte();
+ alphaMask += (ulong)imageReader.ReadByte() << 8;
+ alphaMask += (ulong)imageReader.ReadByte() << 16;
+ alphaMask += (ulong)imageReader.ReadByte() << 24;
+ alphaMask += (ulong)imageReader.ReadByte() << 32;
+ alphaMask += (ulong)imageReader.ReadByte() << 40;
+
ushort c0 = imageReader.ReadUInt16();
ushort c1 = imageReader.ReadUInt16();
Please sign in to comment.
Something went wrong with that request. Please try again.