Skip to content
Snippets Groups Projects
Commit 376092fe authored by David Gilbert's avatar David Gilbert :bug:
Browse files

Fixed bug in RemoveLine that broke the internal data structure.

parent 4c2efe73
No related branches found
No related tags found
No related merge requests found
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "GPUInstancedLineComponent.h" #include "GPUInstancedLineComponent.h"
#include "PropertyPathHelpers.h" #include "PropertyPathHelpers.h"
//#pragma optimize("", off)
UGPUInstancedLineComponent::UGPUInstancedLineComponent(const FObjectInitializer& ObjectInitializer) UGPUInstancedLineComponent::UGPUInstancedLineComponent(const FObjectInitializer& ObjectInitializer)
...@@ -224,7 +225,6 @@ void UGPUInstancedLineComponent::PostInitProperties() ...@@ -224,7 +225,6 @@ void UGPUInstancedLineComponent::PostInitProperties()
UE_LOG(LogTemp, Display, TEXT("UGPUInstancedLineComponent::PostInitProperties IF")); UE_LOG(LogTemp, Display, TEXT("UGPUInstancedLineComponent::PostInitProperties IF"));
} }
//#pragma optimize("", off)
#if WITH_EDITOR #if WITH_EDITOR
void UGPUInstancedLineComponent::PostEditChangeChainProperty(FPropertyChangedChainEvent& PropertyChangedEvent) void UGPUInstancedLineComponent::PostEditChangeChainProperty(FPropertyChangedChainEvent& PropertyChangedEvent)
...@@ -397,7 +397,6 @@ void UGPUInstancedLineComponent::PostEditChangeProperty(FPropertyChangedEvent& P ...@@ -397,7 +397,6 @@ void UGPUInstancedLineComponent::PostEditChangeProperty(FPropertyChangedEvent& P
Super::PostEditChangeProperty(PropertyChangedEvent); Super::PostEditChangeProperty(PropertyChangedEvent);
} }
#endif #endif
//#pragma optimize("", on)
// Doesn't do anything yet, just as a testing function to see execution order on Unreal startup. // Doesn't do anything yet, just as a testing function to see execution order on Unreal startup.
void UGPUInstancedLineComponent::PostLoad() void UGPUInstancedLineComponent::PostLoad()
...@@ -1221,13 +1220,14 @@ bool UGPUInstancedLineComponent::RemoveLine(int32 LineId) ...@@ -1221,13 +1220,14 @@ bool UGPUInstancedLineComponent::RemoveLine(int32 LineId)
{ {
// Apparently unreal also shuffles the instance indices, this might bite us later on // Apparently unreal also shuffles the instance indices, this might bite us later on
// This is insanely slow: // This is insanely slow and very ugly:
for(int32 Index = InstancesToRemove.Num(); Index > 0; --Index) for(int32 Index = InstancesToRemove.Num(); Index > 0; --Index)
{ {
if (LineArray[i].Key >= InstancesToRemove[Index - 1]) if (LineArray[i].Key >= InstancesToRemove[Index - 1])
{ {
LineArray[i].Key -= Index; LineArray[i].Key -= Index;
break;
} }
} }
} }
...@@ -1349,3 +1349,4 @@ bool UGPUInstancedLineComponent::RemovePoints(int32 LineId, int32 StartingPointI ...@@ -1349,3 +1349,4 @@ bool UGPUInstancedLineComponent::RemovePoints(int32 LineId, int32 StartingPointI
return false; return false;
} }
//#pragma optimize("", on)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment