forked from mirrors/0ad
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.
This commit is contained in:
@@ -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 <utility>
|
||||
#include <vector>
|
||||
|
||||
<<<<<<< Updated upstream
|
||||
CCinemaManager::CCinemaManager() {}
|
||||
|
||||
void CCinemaManager::Update(const float deltaRealTime) const
|
||||
=======
|
||||
void CCinemaManager::Update(const float deltaRealTime)
|
||||
>>>>>>> Stashed changes
|
||||
{
|
||||
CmpPtr<ICmpCinemaManager> 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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user