mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-06-16 05:13:58 -07:00
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:
parent
004fdfdb58
commit
67c96094f0
2 changed files with 14 additions and 7 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue