From 724af6edee317eb281ffb847f5ea4282e5db6431 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Sun, 31 Dec 2023 14:03:53 -0800 Subject: libs/din: remove unnecessary floorf() from din() These are being assigned to ints to index the grid and will become rounded down through truncation anyways. This little change brings a ~20% FPS boost in modules/swab on an i7 x230. --- src/libs/din/din.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/libs/din/din.c b/src/libs/din/din.c index 1cb0b97..481c5a5 100644 --- a/src/libs/din/din.c +++ b/src/libs/din/din.c @@ -113,9 +113,9 @@ float din(const din_t *din, v3f_t *coordinate) coordinate->y = .5f + (coordinate->y * .5f + .5f) * (float)(din->height - 2); coordinate->z = .5f + (coordinate->z * .5f + .5f) * (float)(din->depth - 2); - x0 = floorf(coordinate->x); - y0 = floorf(coordinate->y); - z0 = floorf(coordinate->z); + x0 = coordinate->x; + y0 = coordinate->y; + z0 = coordinate->z; x1 = x0 + 1; y1 = y0 + 1; -- cgit v1.2.3