Skip to content

Commit

Permalink
Restored r_orthographic behavior.
Browse files Browse the repository at this point in the history
  • Loading branch information
dileepvr authored and madame-rachelle committed Jan 21, 2024
1 parent d340583 commit e171f4e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/rendering/hwrenderer/hw_entrypoint.cpp
Expand Up @@ -174,7 +174,8 @@ sector_t* RenderViewpoint(FRenderViewpoint& mainvp, AActor* camera, IntRect* bou
camera->player->isoyaw = 45.0 * (r_isoviewpoint - 1); // The eight cardinal directions
}
float inv_iso_dist = 1.0f/camdist; // camdist can change in next line
if (r_orthographic || (camera->Level->flags3 & LEVEL3_ORTHOGRAPHIC)) camdist = r_iso_camdist;
bool iso_ortho = ((r_isoviewpoint > 0) && r_orthographic) || ((r_isoviewpoint == 0) && camera->Level->flags3 & LEVEL3_ORTHOGRAPHIC);
if (iso_ortho) camdist = r_iso_camdist;
vp.Pos.X -= camdist * DAngle::fromDeg(camera->player->isoyaw).Cos();
vp.Pos.Y -= camdist * DAngle::fromDeg(camera->player->isoyaw).Sin();
vp.Pos.Z += camdist * FAngle::fromDeg(isocam_pitch).Tan() - 0.5 * camera->player->viewheight;
Expand All @@ -185,7 +186,8 @@ sector_t* RenderViewpoint(FRenderViewpoint& mainvp, AActor* camera, IntRect* bou
vp.showviewer = true; // Draw player sprite
r_drawplayersprites = false; // Don't draw first-person hands/weapons
// Stereo mode specific perspective projection
di->VPUniforms.mProjectionMatrix = eye.GetProjection(fov, ratio, fovratio * inv_iso_dist, r_orthographic || (camera->Level->flags3 & LEVEL3_ORTHOGRAPHIC));
if (!iso_ortho) inv_iso_dist = 1.0f;
di->VPUniforms.mProjectionMatrix = eye.GetProjection(fov, ratio, fovratio * inv_iso_dist, iso_ortho);
}
else // Regular first-person viewpoint
{
Expand Down

0 comments on commit e171f4e

Please sign in to comment.