From 655defed2842ab5984110b23731ea4871462c33b Mon Sep 17 00:00:00 2001 From: Christopher Bruns Date: Wed, 30 Dec 2015 17:54:54 -0500 Subject: [PATCH] Avoid compile errors on Linux. Fixes #107. --- src/gl/stereo3d/gl_stereo3d.cpp | 2 +- src/gl/stereo3d/gl_stereo3d.h | 1 + src/gl/stereo3d/gl_stereo_cvars.cpp | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gl/stereo3d/gl_stereo3d.cpp b/src/gl/stereo3d/gl_stereo3d.cpp index bc006a2f90..6e4a4a376f 100644 --- a/src/gl/stereo3d/gl_stereo3d.cpp +++ b/src/gl/stereo3d/gl_stereo3d.cpp @@ -11,7 +11,7 @@ VSMatrix EyePose::GetProjection(FLOATTYPE fov, FLOATTYPE aspectRatio, FLOATTYPE VSMatrix result; // Lifted from gl_scene.cpp FGLRenderer::SetProjection() - float fovy = 2 * RAD2DEG(atan(tan(DEG2RAD(fov) / 2) / fovRatio)); + float fovy = (float)(2 * RAD2DEG(atan(tan(DEG2RAD(fov) / 2) / fovRatio))); result.perspective(fovy, aspectRatio, 5.f, 65536.f); return result; diff --git a/src/gl/stereo3d/gl_stereo3d.h b/src/gl/stereo3d/gl_stereo3d.h index 8cfe886aca..44a76839e5 100644 --- a/src/gl/stereo3d/gl_stereo3d.h +++ b/src/gl/stereo3d/gl_stereo3d.h @@ -2,6 +2,7 @@ #define GL_STEREO3D_H_ #include +#include // needed for memcpy on linux, which is needed by VSMatrix copy ctor #include "gl/data/gl_matrix.h" diff --git a/src/gl/stereo3d/gl_stereo_cvars.cpp b/src/gl/stereo3d/gl_stereo_cvars.cpp index b91a47daa3..7fc2941d57 100644 --- a/src/gl/stereo3d/gl_stereo_cvars.cpp +++ b/src/gl/stereo3d/gl_stereo_cvars.cpp @@ -14,7 +14,7 @@ CVAR(Float, vr_hunits_per_meter, 41.0f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) // MET namespace s3d { // Initialize static member -Stereo3DMode const * Stereo3DMode::currentStereo3DMode = nullptr; +Stereo3DMode const * Stereo3DMode::currentStereo3DMode = 0; // "nullptr" not resolved on linux (presumably not C++11) /* static */ void Stereo3DMode::setCurrentMode(const Stereo3DMode& mode) {