diff --git a/src/Layers/xrRender_R2/r2.cpp b/src/Layers/xrRender_R2/r2.cpp index b421826121f..48e6c6b0d22 100644 --- a/src/Layers/xrRender_R2/r2.cpp +++ b/src/Layers/xrRender_R2/r2.cpp @@ -79,9 +79,13 @@ static class cl_pos_decompress_params : public R_constant_setup { virtual void setup(R_constant* C) { - float VertTan = -1.0f * tanf(deg2rad(Device.fFOV / 2.0f)); - float HorzTan = -VertTan / Device.fASPECT; - +#ifdef USE_OGL + const float VertTan = tanf(deg2rad(Device.fFOV / 2.0f)); + const float HorzTan = VertTan / Device.fASPECT; +#else + const float VertTan = -1.0f * tanf(deg2rad(Device.fFOV / 2.0f)); + const float HorzTan = -VertTan / Device.fASPECT; +#endif RCache.set_c( C, HorzTan, VertTan, (2.0f * HorzTan) / (float)Device.dwWidth, (2.0f * VertTan) / (float)Device.dwHeight); }