Optimize getofs_viewtype for precision and speed.

git-svn-id: https://svn.eduke32.com/eduke32@6307 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2017-06-27 11:01:38 +00:00
parent 42a26b5f3c
commit 4a69eecc9f

View file

@ -3421,7 +3421,7 @@ static int G_MaybeTakeOnFloorPal(uspritetype *pSprite, int sectNum)
template <int rotations>
static int getofs_viewtype(int angDiff)
{
return ((angDiff + 3072 + (1024/rotations)) & 2047) / (2048/rotations);
return (((angDiff + 3072) & 2047) * rotations + 1024) >> 11;
}
template <int rotations>