diff --git a/Source/InstancedMeshLineRendering/Private/GPUInstancedLineComponent.cpp b/Source/InstancedMeshLineRendering/Private/GPUInstancedLineComponent.cpp
index 1c9c81026d9a488c4a197b7f4aa47b9f035a3cfe..5cdc7b3a6e1a739767650fb0e31daf6f3d3ce1ed 100644
--- a/Source/InstancedMeshLineRendering/Private/GPUInstancedLineComponent.cpp
+++ b/Source/InstancedMeshLineRendering/Private/GPUInstancedLineComponent.cpp
@@ -4,6 +4,7 @@
#include "GPUInstancedLineComponent.h"
#include "PropertyPathHelpers.h"
+//#pragma optimize("", off)
UGPUInstancedLineComponent::UGPUInstancedLineComponent(const FObjectInitializer& ObjectInitializer)
@@ -224,7 +225,6 @@ void UGPUInstancedLineComponent::PostInitProperties()
UE_LOG(LogTemp, Display, TEXT("UGPUInstancedLineComponent::PostInitProperties IF"));
}
-//#pragma optimize("", off)
#if WITH_EDITOR
void UGPUInstancedLineComponent::PostEditChangeChainProperty(FPropertyChangedChainEvent& PropertyChangedEvent)
@@ -397,7 +397,6 @@ void UGPUInstancedLineComponent::PostEditChangeProperty(FPropertyChangedEvent& P
Super::PostEditChangeProperty(PropertyChangedEvent);
}
#endif
-//#pragma optimize("", on)
// Doesn't do anything yet, just as a testing function to see execution order on Unreal startup.
void UGPUInstancedLineComponent::PostLoad()
@@ -1221,13 +1220,14 @@ bool UGPUInstancedLineComponent::RemoveLine(int32 LineId)
{
// 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)
{
if (LineArray[i].Key >= InstancesToRemove[Index - 1])
{
LineArray[i].Key -= Index;
+ break;
}
}
}
@@ -1349,3 +1349,4 @@ bool UGPUInstancedLineComponent::RemovePoints(int32 LineId, int32 StartingPointI
return false;
}
+//#pragma optimize("", on)