Add fov cvar

# Conflicts:
#	source/exhumed/src/config.cpp
#	source/exhumed/src/osdcmds.cpp
This commit is contained in:
nukeykt 2019-11-27 00:37:47 +09:00 committed by Christoph Oelckers
parent 82767751a7
commit 1b0a036995
4 changed files with 10 additions and 0 deletions

View file

@ -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"

View file

@ -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

View file

@ -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())
{

View file

@ -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);