You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
In some code paths for loaded actors the call order might be different since primitive registration gets deferred (i.e. FRegisterComponentContext != nullptr). Case 1 (normal flow): FRegisterComponentContext == nullptr > UPrimitiveComponent::CreateRenderState_Concurrent : calls CreateSceneProxy > RegisterDebugDrawDelegate > UnregisterDebugDrawDelegate ==> works fine Case 2 (deferred AddPrimitive): FRegisterComponentContext != nullptr > UPrimitiveComponent::CreateRenderState_Concurrent : defers CreateSceneProxy > RegisterDebugDrawDelegate (skip register since not init) > CreateSceneProxy > UnregisterDebugDrawDelegate ==> ensures in UnregisterDebugDrawDelegate With this new version `CreateRenderState_Concurrent` calls `RequestRegisterDebugDrawDelegate` that will take care of registering the delegate immediately or mark it for deferred execution. An explicit call to `ProcessDeferredRegister` is then required from `CreateSceneProxy` to implement proper flow: Case 2 (fixed) (deferred AddPrimitive + deferred Register): FRegisterComponentContext != nullptr > UPrimitiveComponent::CreateRenderState_Concurrent: defers CreateSceneProxy > RequestRegisterDebugDrawDelegate: defers RegisterDebugDrawDelegate > CreateSceneProxy: calls ProcessDeferredRegister & RegisterDebugDrawDelegate > UnregisterDebugDrawDelegate ==> works fine Bonus: - New DebugDrawComponent abstract class that is now used to share common functionalities between existing debug related components. Takes care of DelegateHelper registration flow to render text on screen from different sources. - FDebugDrawDelegateHelper::InitDelegateHelper is no longer virtual and derived classes requiring extra data from their associated scene proxy should set it up from their overriden CreateSceneProxy - FDebugDrawDelegateHelper derived classes should not override RegisterDebugDrawDelegate/UnregisterDebugDrawDelegate to use their `DrawDebugLabels` method since this is already a virtual method that would get called from the base class. - Fixed a few ViewFlag members in the SceneProxy so the DelegateHelper base class can behave as expected #jira FORT-419154 #rb mieszko.zielinski #robomerge FnMain #preflight 61703f8766ed7f0001c0faf1 [CL 17875336 by Yoan StAmant in ue5-main branch]
20 lines
516 B
C++
20 lines
516 B
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "Debug/DebugDrawComponent.h"
|
|
#include "VisualLoggerRenderingComponent.generated.h"
|
|
|
|
/**
|
|
* Primitive component used to draw visual logger data on level
|
|
*/
|
|
UCLASS(ClassGroup = Debug)
|
|
class UVisualLoggerRenderingComponent : public UDebugDrawComponent
|
|
{
|
|
public:
|
|
GENERATED_UCLASS_BODY()
|
|
|
|
virtual FDebugRenderSceneProxy* CreateDebugSceneProxy() override;
|
|
virtual FBoxSphereBounds CalcBounds(const FTransform &LocalToWorld) const override;
|
|
};
|