Download

How can I rewrite this constructor's initializer list to avoid this error?

Hi everyone. This is actually a question for UE3, but I’m asking here because I don’t really have any other options. My UE3 project builds fine for Windows, but now I’m reworking some UE3 code to appease clang and XCode for a macOS build. The compiler is giving me several errors like this:

base class 'FSceneCaptureProbe' is uninitialized when used here to access 'FSceneCaptureProbe::bSkipUpdateIfTextureUsersOccluded'

This is the code that’s causing the problem.

class FSceneCaptureProbeReflect : public FSceneCaptureProbe
{
    public:
        /**
        * Constructor (init)
        */
        FSceneCaptureProbeReflect(
        const AActor* InViewActor,
        UTextureRenderTarget* InTextureTarget,
        const EShowFlags& InShowFlags,
        const FLinearColor& InBackgroundColor,
        const FLOAT InFrameRate,
        const UPostProcessChain* InPostProcess,
        UBOOL bInSkipUpdateIfTextureUsersOccluded,
        UBOOL bInUseMainScenePostProcessSettings,
        const UBOOL bInSkipUpdateIfOwnerOccluded,
        const UBOOL bInSkipPrepass,
        const FLOAT InMaxUpdateDist,
        const FLOAT InMaxStreamingUpdateDist,
        const FLOAT InMaxViewDistanceOverride,
        const FPlane& InMirrorPlane
        )
        : 
FSceneCaptureProbe(InViewActor,InTextureTarget,InShowFlags,InBackgroundColor,InFrameRate,InPostProcess,bInUseMainScenePostProcessSettings,bSkipUpdateIfTextureUsersOccluded,bInSkipUpdateIfOwnerOccluded,bInSkipPrepass,InMaxUpdateDist,InMaxStreamingUpdateDist,InMaxViewDistanceOverride)
, MirrorPlane(InMirrorPlane)
    {
    }

I’m new to C++ so I’m a little lost here. How can I rewrite the constructor and/or its initializer list so it does the same thing, but initializes FSceneCaptureProbe?

Is this a bug? Do I need to replace “bSkipUpdateIfTextureUsersOccluded” with “bInSkipUpdateIfTextureUsersOccluded”? I’ll try that and get back to you…

I’m pretty sure that is what you want, otherwise you’re trying to assign the member variable to itself. You want the one that is coming in through the constructor function

1 Like

You’re also passing the parameters to FSceneCaptureProbe in a different order than your FSceneCaptureProbeReflect which may be incorrect:

        ...
        const UPostProcessChain* InPostProcess,
        UBOOL bInSkipUpdateIfTextureUsersOccluded,
        UBOOL bInUseMainScenePostProcessSettings,
        ...

versus

..., InPostProcess,bInUseMainScenePostProcessSettings,bSkipUpdateIfTextureUsersOccluded, ...
1 Like