From 67c96094f03452dd2d4f78eb18b3bfb0bfc629bb Mon Sep 17 00:00:00 2001 From: Vantha Date: Fri, 2 Jan 2026 23:08:13 +0100 Subject: [PATCH] Disable smooth LOS during cinema paths The whole map is revealed when starting to play a cinema path and then hidden again when it finished (if necessary). This patch fixes the ugly fade in at the start and fade out after the end previously caused by this. --- source/graphics/CinemaManager.cpp | 18 ++++++++++++------ source/graphics/CinemaManager.h | 3 ++- 2 files changed, 14 insertions(+), 7 deletions(-) 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