diff --git a/source/exhumed/src/config.cpp b/source/exhumed/src/config.cpp index e65fa0ba9..a53ba6437 100644 --- a/source/exhumed/src/config.cpp +++ b/source/exhumed/src/config.cpp @@ -26,6 +26,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "control.h" #include "exhumed.h" #include "typedefs.h" +#include "view.h" #include "config.h" diff --git a/source/exhumed/src/osdcmds.cpp b/source/exhumed/src/osdcmds.cpp index 4e8955405..5fd8afdb8 100644 --- a/source/exhumed/src/osdcmds.cpp +++ b/source/exhumed/src/osdcmds.cpp @@ -28,6 +28,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "exhumed.h" #include "config.h" #include "osdcmds.h" +#include "view.h" BEGIN_PS_NS diff --git a/source/exhumed/src/view.cpp b/source/exhumed/src/view.cpp index 5346c919a..28bdc694c 100644 --- a/source/exhumed/src/view.cpp +++ b/source/exhumed/src/view.cpp @@ -73,6 +73,8 @@ short besttarget; short nViewLeft; short bCamera = kFalse; +int gFov; + short nViewy; int viewz; @@ -509,12 +511,16 @@ void DrawView(int smoothRatio) static uint8_t sectorCeilingPal[MAXSECTORS]; static uint8_t wallPal[MAXWALLS]; int const viewingRange = viewingrange; + int const vr = Blrintf(65536.f * tanf(gFov * (fPI / 360.f))); if (r_usenewaspect) { newaspect_enable = 1; videoSetCorrectedAspect(); + renderSetAspect(mulscale16(vr, viewingrange), yxaspect); } + else + renderSetAspect(vr, yxaspect); if (HavePLURemap()) { diff --git a/source/exhumed/src/view.h b/source/exhumed/src/view.h index d59b5063d..b583e8031 100644 --- a/source/exhumed/src/view.h +++ b/source/exhumed/src/view.h @@ -60,6 +60,8 @@ extern short bTouchFloor; extern short nChunkTotal; +extern int gFov; + static inline int angle_interpolate16(int a, int b, int smooth) { return a + mulscale16(((b+1024-a)&2047)-1024, smooth);