Skip to content

Commit

Permalink
Correct order of operations on byte reversal
Browse files Browse the repository at this point in the history
  • Loading branch information
marsolk committed May 18, 2024
1 parent 1fc67cf commit 819edd7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/txtr_conversions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,5 +296,8 @@ pub fn decompress_dxt1gcn_block(block: &[u8]) -> [[u8; 4]; 16] {
}

fn reverse_byte(byte: u8) -> u8 {
(byte & 0b11 << 6) | (byte & 0b1100 << 2) | (byte & 0b110000 >> 2) | (byte & 0b11000000 >> 6)
(byte & 0b00000011) << 6
| (byte & 0b00001100) << 2
| (byte & 0b00110000) >> 2
| (byte & 0b11000000) >> 6
}

0 comments on commit 819edd7

Please sign in to comment.