Fix particles view information in Editor when Game window is unused

This commit is contained in:
Wojtek Figat
2021-02-19 11:23:18 +01:00
parent cc980fd70d
commit ce9df56a97
8 changed files with 54 additions and 19 deletions

View File

@@ -245,7 +245,7 @@ bool ParticleEmitterGraphCPUExecutor::ComputeBounds(ParticleEmitter* emitter, Pa
_emitter = emitter;
_effect = effect;
_deltaTime = 0.0f;
_viewTask = PARTICLE_EMITTER_GET_VIEW_TASK(effect);
_viewTask = effect->GetRenderTask();
_callStack.Clear();
// Find the maximum radius of the particle light
@@ -351,7 +351,7 @@ void ParticleEmitterGraphCPUExecutor::Draw(ParticleEmitter* emitter, ParticleEff
_emitter = emitter;
_effect = effect;
_deltaTime = 0.0f;
_viewTask = PARTICLE_EMITTER_GET_VIEW_TASK(effect);
_viewTask = effect->GetRenderTask();
_callStack.Clear();
// Draw lights
@@ -411,7 +411,7 @@ void ParticleEmitterGraphCPUExecutor::Update(ParticleEmitter* emitter, ParticleE
_effect = effect;
_particleIndex = 0;
_deltaTime = dt;
_viewTask = PARTICLE_EMITTER_GET_VIEW_TASK(effect);
_viewTask = effect->GetRenderTask();
_callStack.Clear();
auto& cpu = data.Buffer->CPU;
@@ -557,7 +557,7 @@ int32 ParticleEmitterGraphCPUExecutor::UpdateSpawn(ParticleEmitter* emitter, Par
_effect = effect;
_particleIndex = 0;
_deltaTime = dt;
_viewTask = PARTICLE_EMITTER_GET_VIEW_TASK(effect);
_viewTask = effect->GetRenderTask();
_callStack.Clear();
// Spawn particles

View File

@@ -27,11 +27,6 @@ class ParticleEmitterGraphCPUExecutor;
#define PARTICLE_EMITTER_MAX_CALL_STACK 100
// Gets the render task for the given effect update
#define PARTICLE_EMITTER_GET_VIEW_TASK(effect) \
(SceneRenderTask*)((effect)->CustomViewRenderTask && (effect)->CustomViewRenderTask->LastUsedFrame != 0 ? (effect)->CustomViewRenderTask.Get() : \
(MainRenderTask::Instance && MainRenderTask::Instance->LastUsedFrame != 0 ? MainRenderTask::Instance : nullptr))
class ParticleEmitterGraphCPUBox : public VisjectGraphBox
{
public: