Skip to content

Commit

Permalink
Fix a bug where effects are not rendered after MarkRenderStateDirty i…
Browse files Browse the repository at this point in the history
…s called.
  • Loading branch information
durswd committed Dec 18, 2023
1 parent bd472da commit fa6c121
Showing 1 changed file with 24 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ class FEffekseerEmitterSceneProxy : public FPrimitiveSceneProxy
std::vector<FEffekseerHandle> handles_;

public:
FEffekseerEmitterSceneProxy(const UEffekseerEmitterComponent* InComponent)
FEffekseerEmitterSceneProxy(const UEffekseerEmitterComponent* InComponent, std::vector<FEffekseerHandle> handles)
: FPrimitiveSceneProxy(InComponent)
{
component_ = InComponent;
handles_ = handles;
}

virtual ~FEffekseerEmitterSceneProxy() override
Expand Down Expand Up @@ -143,6 +144,16 @@ class FEffekseerEmitterSceneProxy : public FPrimitiveSceneProxy
});
#endif
}

const UEffekseerEmitterComponent* GetInComponent() const
{
return component_;
}

std::vector<FEffekseerHandle> GetHandles() const
{
return handles_;
}
};

void UEffekseerEmitterComponent::ApplyParameters(bool forced)
Expand Down Expand Up @@ -271,9 +282,18 @@ UEffekseerEmitterComponent::~UEffekseerEmitterComponent()

FPrimitiveSceneProxy* UEffekseerEmitterComponent::CreateSceneProxy()
{
auto sp = new FEffekseerEmitterSceneProxy(this);
sceneProxy_ = sp;
return sp;
if (sceneProxy_ != nullptr)
{
auto sp = new FEffekseerEmitterSceneProxy(sceneProxy_->GetInComponent(), sceneProxy_->GetHandles());
sceneProxy_ = sp;
}
else
{
auto sp = new FEffekseerEmitterSceneProxy(this, {});
sceneProxy_ = sp;
}

return sceneProxy_;
}

UMaterialInterface* UEffekseerEmitterComponent::GetMaterial(int32 ElementIndex) const
Expand Down

0 comments on commit fa6c121

Please sign in to comment.