diff --git a/source/graphics/CinemaManager.cpp b/source/graphics/CinemaManager.cpp index cac3a8dd54..417c4adf31 100644 --- a/source/graphics/CinemaManager.cpp +++ b/source/graphics/CinemaManager.cpp @@ -30,6 +30,7 @@ #include "ps/World.h" #include "renderer/DebugRenderer.h" #include "renderer/Renderer.h" +#include "renderer/RenderingOptions.h" #include "simulation2/Simulation2.h" #include "simulation2/components/ICmpCinemaManager.h" #include "simulation2/helpers/CinemaPath.h" @@ -39,20 +40,25 @@ #include #include -<<<<<<< Updated upstream -CCinemaManager::CCinemaManager() {} - -void CCinemaManager::Update(const float deltaRealTime) const -======= void CCinemaManager::Update(const float deltaRealTime) ->>>>>>> Stashed changes { CmpPtr cmpCinemaManager(g_Game->GetSimulation2()->GetSimContext().GetSystemEntity()); if (!cmpCinemaManager) return; if (IsPlaying()) + { + if (g_RenderingOptions.GetSmoothLOS()) + { + g_RenderingOptions.SetSmoothLOS(false); + m_SmoothLosOverridden = true; + } cmpCinemaManager->UpdateActivePath(deltaRealTime, g_Game->GetView()->GetCamera()); + return; + } + + if (std::exchange(m_SmoothLosOverridden, false)) + g_RenderingOptions.SetSmoothLOS(true); } void CCinemaManager::Render(Renderer::Backend::IDeviceCommandContext& deviceCommandContext) const diff --git a/source/graphics/CinemaManager.h b/source/graphics/CinemaManager.h index 972cbe0a06..d9f7347b1a 100644 --- a/source/graphics/CinemaManager.h +++ b/source/graphics/CinemaManager.h @@ -41,7 +41,7 @@ public: * Updates CCinemManager and current path * @param deltaRealTime Elapsed real time since the last frame. */ - void Update(const float deltaRealTime) const; + void Update(const float deltaRealTime); bool GetPathsDrawing() const; void SetPathsDrawing(const bool drawPath); @@ -52,6 +52,7 @@ private: void DrawNodes(Renderer::Backend::IDeviceCommandContext& deviceCommandContext, const RNSpline& spline, const CColor& nodesColor) const; bool m_DrawPaths = false; + bool m_SmoothLosOverridden = false; }; #endif