Archived
0

исправление работы CompactedCoords

This commit is contained in:
2018-12-26 16:07:05 +03:00
parent 41efdda320
commit 467ef26468
3 changed files with 30 additions and 23 deletions

View File

@@ -14,15 +14,9 @@ public class CompactedCoords {
}
public static int[] uncompressXZ(int compactValue) {
//TODO не нравится мне такие костыли
return new int[]{
(int)(short) (compactValue >> 16),
(int)(short) (compactValue | 0xFFFF0000)
compactValue >> 16,
(compactValue & 0x8000) > 0 ? compactValue | 0xFFFF0000 : compactValue & 0xFFFF
};
}
private static int floor_double(double value) {
int i = (int)value;
return value < (double)i ? i - 1 : i;
}
}