Skip to content

Commit 4fd5fb7

Browse files
committed
Remove roundf() use from Registration
Replaces use of `roundf()` function in registration.cpp with `(int)(x + 0.5f)` to allow compiling on older versions of MSVC.
1 parent a6770bd commit 4fd5fb7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/protonect/src/registration.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,8 @@ Registration::Registration(Freenect2Device::IrCameraParams depth_p, Freenect2Dev
241241
// compute the dirstored coordinate for current pixel
242242
distort(x,y,mx,my);
243243
// rounding the values and check if the pixel is inside the image
244-
ix = roundf(mx);
245-
iy = roundf(my);
244+
ix = (int)(mx + 0.5f);
245+
iy = (int)(my + 0.5f);
246246
if(ix < 0 || ix >= 512 || iy < 0 || iy >= 424)
247247
index = -1;
248248
else
@@ -255,7 +255,7 @@ Registration::Registration(Freenect2Device::IrCameraParams depth_p, Freenect2Dev
255255
*map_x++ = rx;
256256
*map_y++ = ry;
257257
// compute the y offset to minimize later computations
258-
*map_yi++ = roundf(ry);
258+
*map_yi++ = (int)(ry + 0.5f);
259259
}
260260
}
261261
}

0 commit comments

Comments
 (0)