From 10757aa836b2cf77141c8cb9150e7fa16c15be34 Mon Sep 17 00:00:00 2001 From: terminx Date: Wed, 20 Feb 2019 21:33:04 +0000 Subject: [PATCH] PI -> fPI git-svn-id: https://svn.eduke32.com/eduke32@7343 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/build/src/polymer.cpp | 4 ++-- source/duke3d/src/game.cpp | 2 +- source/duke3d/src/player.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/source/build/src/polymer.cpp b/source/build/src/polymer.cpp index d1bd10421..f0b8222af 100644 --- a/source/build/src/polymer.cpp +++ b/source/build/src/polymer.cpp @@ -909,8 +909,8 @@ void polymer_setaspect(int32_t ang) float fang = (float)ang * atanf(fviewingrange*(1.f/65536.f)) * (4.f/fPI); // use horizontal fov instead of vertical - fang = atanf(tanf(fang * (PI / 2048.f)) * float(windowxy2.y - windowxy1.y + 1) / float(windowxy2.x - windowxy1.x + 1) * - float(xdim) / float(ydim) * (3.f / 4.f)) * (2048.f / PI); + fang = atanf(tanf(fang * (fPI / 2048.f)) * float(windowxy2.y - windowxy1.y + 1) / float(windowxy2.x - windowxy1.x + 1) * + float(xdim) / float(ydim) * (3.f / 4.f)) * (2048.f / fPI); if (pr_customaspect != 0.0f) aspect = pr_customaspect; diff --git a/source/duke3d/src/game.cpp b/source/duke3d/src/game.cpp index 19a8ab271..7a8e6ff20 100644 --- a/source/duke3d/src/game.cpp +++ b/source/duke3d/src/game.cpp @@ -792,7 +792,7 @@ void G_DrawRooms(int32_t playerNum, int32_t smoothRatio) #endif ))); - viewingRange = Blrintf(float(vr) * tanf(ud.fov * (PI/360.f))); + viewingRange = Blrintf(float(vr) * tanf(ud.fov * (fPI/360.f))); if (!r_usenewaspect) renderSetAspect(viewingRange, yxaspect); diff --git a/source/duke3d/src/player.cpp b/source/duke3d/src/player.cpp index 09f1fa00f..3fcd53b51 100644 --- a/source/duke3d/src/player.cpp +++ b/source/duke3d/src/player.cpp @@ -5365,7 +5365,7 @@ HORIZONLY:; // A horiz diff of 128 equal 45 degrees, // so we convert horiz to 1024 angle units - float horizAngle = atan2f(pPlayer->q16horiz - F16(100), F16(128)) * (512.f / PI) + fix16_to_float(g_player[playerNum].inputBits->q16horz); + float horizAngle = atan2f(pPlayer->q16horiz - F16(100), F16(128)) * (512.f / fPI) + fix16_to_float(g_player[playerNum].inputBits->q16horz); if (TEST_SYNC_KEY(playerBits, SK_LOOK_UP)) { @@ -5405,7 +5405,7 @@ HORIZONLY:; } } - pPlayer->q16horiz = F16(100) + F16(128) * tanf(horizAngle * (PI / 512.f)); + pPlayer->q16horiz = F16(100) + F16(128) * tanf(horizAngle * (fPI / 512.f)); if (pPlayer->return_to_center > 0 && !TEST_SYNC_KEY(playerBits, SK_LOOK_UP) && !TEST_SYNC_KEY(playerBits, SK_LOOK_DOWN)) {