mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2024-11-17 15:48:17 +01:00
Temporarly converting components to uint16 in interleving is not needed because we are only interested in the bit patterns which are the same as in the signed representation.
This commit is contained in:
parent
b40eb0021c
commit
f83efba3cf
@ -107,11 +107,11 @@ func DecodeFromBigEndian(key []byte) (int64, error) {
|
|||||||
|
|
||||||
func CoordToInterleaved(c Coord) (result int64) {
|
func CoordToInterleaved(c Coord) (result int64) {
|
||||||
const end = 1 << (numBitsPerComponent + 1)
|
const end = 1 << (numBitsPerComponent + 1)
|
||||||
x := uint16(c.X - minValue)
|
x := c.X - minValue
|
||||||
y := uint16(c.Y - minValue)
|
y := c.Y - minValue
|
||||||
z := uint16(c.Z - minValue)
|
z := c.Z - minValue
|
||||||
setmask := int64(1)
|
setmask := int64(1)
|
||||||
for mask := uint16(1); mask != end; mask <<= 1 {
|
for mask := int16(1); mask != end; mask <<= 1 {
|
||||||
if x&mask != 0 {
|
if x&mask != 0 {
|
||||||
result |= setmask
|
result |= setmask
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user