From 4a69eecc9f3e1d0b578704b244f1cefa8afdc524 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Tue, 27 Jun 2017 11:01:38 +0000 Subject: [PATCH] Optimize getofs_viewtype for precision and speed. git-svn-id: https://svn.eduke32.com/eduke32@6307 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/game.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/duke3d/src/game.cpp b/source/duke3d/src/game.cpp index 23de298a7..9ebadd0c6 100644 --- a/source/duke3d/src/game.cpp +++ b/source/duke3d/src/game.cpp @@ -3421,7 +3421,7 @@ static int G_MaybeTakeOnFloorPal(uspritetype *pSprite, int sectNum) template static int getofs_viewtype(int angDiff) { - return ((angDiff + 3072 + (1024/rotations)) & 2047) / (2048/rotations); + return (((angDiff + 3072) & 2047) * rotations + 1024) >> 11; } template