Skip to content

Commit

Permalink
xrRender_R2/r2.cpp: fixed invertion for position decompression params…
Browse files Browse the repository at this point in the history
… on OpenGL
  • Loading branch information
Xottab-DUTY committed Dec 3, 2020
1 parent 22928da commit 690dba9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Layers/xrRender_R2/r2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 690dba9

Please sign in to comment.