fix bug in TRI decoder
This commit is contained in:
parent
d7989f94bc
commit
ff482c3ec6
3 changed files with 2 additions and 2 deletions
BIN
clue7_output-bad.png
Normal file
BIN
clue7_output-bad.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 374 KiB |
BIN
clue7_output.png
BIN
clue7_output.png
Binary file not shown.
Before Width: | Height: | Size: 374 KiB After Width: | Height: | Size: 292 KiB |
|
@ -50,7 +50,7 @@ public class Main {
|
||||||
for (int k = 0; k < 64; ++k) {
|
for (int k = 0; k < 64; ++k) {
|
||||||
int intIndex = k / 32;
|
int intIndex = k / 32;
|
||||||
int bitIndex = k % 32;
|
int bitIndex = k % 32;
|
||||||
boolean colorSelection = ((patternTable[(patternIndex - 1) * 2 + intIndex] >> (32 - bitIndex)) & 1) == 1;
|
boolean colorSelection = ((patternTable[(patternIndex - 1) * 2 + intIndex] >> (31 - bitIndex)) & 1) == 1;
|
||||||
|
|
||||||
int x = k % 8;
|
int x = k % 8;
|
||||||
int y = k / 8;
|
int y = k / 8;
|
||||||
|
@ -89,7 +89,7 @@ public class Main {
|
||||||
}
|
}
|
||||||
|
|
||||||
public int readInt() throws IOException {
|
public int readInt() throws IOException {
|
||||||
return (stream.read() << 32)
|
return (stream.read() << 24)
|
||||||
| (stream.read() << 16)
|
| (stream.read() << 16)
|
||||||
| (stream.read() << 8)
|
| (stream.read() << 8)
|
||||||
| (stream.read() << 0);
|
| (stream.read() << 0);
|
||||||
|
|
Loading…
Reference in a new issue