diff --git a/src/rendering/polyrenderer/scene/poly_model.cpp b/src/rendering/polyrenderer/scene/poly_model.cpp index 43fd55d48..e3bffcb49 100644 --- a/src/rendering/polyrenderer/scene/poly_model.cpp +++ b/src/rendering/polyrenderer/scene/poly_model.cpp @@ -53,7 +53,7 @@ void PolyRenderModel(PolyRenderThread *thread, const Mat4f &worldToClip, uint32_ renderer.Translation = actor->Translation; renderer.AddLights(actor); - renderer.RenderModel(x, y, z, smf, actor, r_viewpoint.TicFrac); + renderer.RenderModel(x, y, z, smf, actor, PolyRenderer::Instance()->Viewpoint.TicFrac); PolyTriangleDrawer::SetModelVertexShader(thread->DrawQueue, -1, -1, 0.0f); PolyTriangleDrawer::SetTransform(thread->DrawQueue, thread->FrameMemory->NewObject(worldToClip), nullptr); } diff --git a/src/rendering/polyrenderer/scene/poly_particle.cpp b/src/rendering/polyrenderer/scene/poly_particle.cpp index 002daac52..b8c737407 100644 --- a/src/rendering/polyrenderer/scene/poly_particle.cpp +++ b/src/rendering/polyrenderer/scene/poly_particle.cpp @@ -34,8 +34,8 @@ EXTERN_CVAR(Int, gl_particles_style) void RenderPolyParticle::Render(PolyRenderThread *thread, particle_t *particle, subsector_t *sub, uint32_t stencilValue) { - double timefrac = r_viewpoint.TicFrac; - if (paused || r_viewpoint.ViewLevel->isFrozen()) + double timefrac = PolyRenderer::Instance()->Viewpoint.TicFrac; + if (paused || PolyRenderer::Instance()->Viewpoint.ViewLevel->isFrozen()) timefrac = 0.; DVector3 pos = particle->Pos + (particle->Vel * timefrac); double psize = particle->size / 8.0; diff --git a/src/rendering/polyrenderer/scene/poly_sky.cpp b/src/rendering/polyrenderer/scene/poly_sky.cpp index 0584f5d96..7aa9500f2 100644 --- a/src/rendering/polyrenderer/scene/poly_sky.cpp +++ b/src/rendering/polyrenderer/scene/poly_sky.cpp @@ -316,8 +316,8 @@ void PolySkySetup::Update() skyiscale = float(r_Yaspect / freelookviewheight); skyscale = freelookviewheight / r_Yaspect; - skyiscale *= float(r_viewpoint.FieldOfView.Degrees / 90.); - skyscale *= float(90. / r_viewpoint.FieldOfView.Degrees); + skyiscale *= float(PolyRenderer::Instance()->Viewpoint.FieldOfView.Degrees / 90.); + skyscale *= float(90. / PolyRenderer::Instance()->Viewpoint.FieldOfView.Degrees); } if (Level->skystretch) diff --git a/src/rendering/swrenderer/plane/r_skyplane.cpp b/src/rendering/swrenderer/plane/r_skyplane.cpp index a3ddae79b..6b06f9eed 100644 --- a/src/rendering/swrenderer/plane/r_skyplane.cpp +++ b/src/rendering/swrenderer/plane/r_skyplane.cpp @@ -96,8 +96,8 @@ namespace swrenderer skyiscale = float(r_Yaspect / freelookviewheight); skyscale = freelookviewheight / r_Yaspect; - skyiscale *= float(r_viewpoint.FieldOfView.Degrees / 90.); - skyscale *= float(90. / r_viewpoint.FieldOfView.Degrees); + skyiscale *= float(thread->Viewport->viewpoint.FieldOfView.Degrees / 90.); + skyscale *= float(90. / thread->Viewport->viewpoint.FieldOfView.Degrees); } if (Level->skystretch) diff --git a/src/rendering/swrenderer/things/r_particle.cpp b/src/rendering/swrenderer/things/r_particle.cpp index 220124ae4..231ee9b4c 100644 --- a/src/rendering/swrenderer/things/r_particle.cpp +++ b/src/rendering/swrenderer/things/r_particle.cpp @@ -78,8 +78,8 @@ namespace swrenderer int x1, x2, y1, y2; sector_t* heightsec = NULL; - double timefrac = r_viewpoint.TicFrac; - if (paused || r_viewpoint.ViewLevel->isFrozen()) + double timefrac = thread->Viewport->viewpoint.TicFrac; + if (paused || thread->Viewport->viewpoint.ViewLevel->isFrozen()) timefrac = 0.; double ippx = particle->Pos.X + particle->Vel.X * timefrac;