1
0
mirror of https://bitbucket.org/s_l_teichmann/mtsatellite synced 2025-04-21 19:30:26 +02: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:
Sascha L. Teichmann 2014-09-07 11:07:49 +02:00
parent b40eb0021c
commit f83efba3cf

@ -107,11 +107,11 @@ func DecodeFromBigEndian(key []byte) (int64, error) {
func CoordToInterleaved(c Coord) (result int64) {
const end = 1 << (numBitsPerComponent + 1)
x := uint16(c.X - minValue)
y := uint16(c.Y - minValue)
z := uint16(c.Z - minValue)
x := c.X - minValue
y := c.Y - minValue
z := c.Z - minValue
setmask := int64(1)
for mask := uint16(1); mask != end; mask <<= 1 {
for mask := int16(1); mask != end; mask <<= 1 {
if x&mask != 0 {
result |= setmask
}