Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. ushort[] block = new ushort[4]; /* i dont know the size of this, I think this is fine */
  2. byte[] alphaValues = new byte[16];
  3.  
  4. for (int i = 0; i < 4; ++i)
  5. {
  6. ushort[] alphaData = new ushort[4];
  7. Buffer.BlockCopy(block, 0, alphaData, 0, sizeof(ushort) * 4);
  8.  
  9. alphaValues[i * 4 + 0] = (byte)(((alphaData[i] >> 0) & 0xF) * 17);
  10. alphaValues[i * 4 + 1] = (byte)(((alphaData[i] >> 4) & 0xF) * 17);
  11. alphaValues[i * 4 + 2] = (byte)(((alphaData[i] >> 8) & 0xF) * 17);
  12. alphaValues[i * 4 + 3] = (byte)(((alphaData[i] >> 12) & 0xF) * 17);
  13.  
  14. //advance by 2 bytes
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement