Skip to content

Commit

Permalink
Fixed stale code warning so it doesn't break in 4.23+
Browse files Browse the repository at this point in the history
Fix Enqueue_Unique_Render_Command_FourParameter warnings. Future proofed.
  • Loading branch information
EvoPulseGaming committed Jun 11, 2019
1 parent 1144177 commit 7c0c3ca
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
Binary file modified Content/ShipsAndExamples/ManOfWar/BP_ManOfWar.uasset
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -224,22 +224,27 @@ void UAdvancedBuoyancyComponent::PopulateTrianglesFromStaticMesh()
uint16* Indices = new uint16[numIndices];
int numVertices = LODResource.VertexBuffers.PositionVertexBuffer.VertexBufferRHI->GetSize() / (sizeof(float) * 3);
float* Vertices = new float[numVertices * 3];
ENQUEUE_UNIQUE_RENDER_COMMAND_FOURPARAMETER(
GetMyBuffers,
FRawStaticIndexBuffer*, IndexBuffer, &LODResource.IndexBuffer,
uint16*, Indices, Indices,
FPositionVertexBuffer*, PositionVertexBuffer, &LODResource.VertexBuffers.PositionVertexBuffer,
float*, Vertices, Vertices,


FRawStaticIndexBuffer* IndexBuffer = &LODResource.IndexBuffer;
uint16* Indices0 = Indices;
FPositionVertexBuffer* PositionVertexBuffer = &LODResource.VertexBuffers.PositionVertexBuffer;
float* Vertices0 = Vertices;
ENQUEUE_RENDER_COMMAND(GetMyBuffers)
(
[IndexBuffer, Indices0, PositionVertexBuffer, Vertices0](FRHICommandListImmediate& RHICmdList)

{
uint16* indices1 = (uint16*)RHILockIndexBuffer(IndexBuffer->IndexBufferRHI, 0, IndexBuffer->IndexBufferRHI->GetSize(), RLM_ReadOnly);
float* indices2 = (float*)RHILockVertexBuffer(PositionVertexBuffer->VertexBufferRHI, 0, PositionVertexBuffer->VertexBufferRHI->GetSize(), RLM_ReadOnly);

memcpy(Indices, indices1, IndexBuffer->IndexBufferRHI->GetSize());
memcpy(Vertices, indices2, PositionVertexBuffer->VertexBufferRHI->GetSize());
memcpy(Indices0, indices1, IndexBuffer->IndexBufferRHI->GetSize());
memcpy(Vertices0, indices2, PositionVertexBuffer->VertexBufferRHI->GetSize());

RHIUnlockIndexBuffer(IndexBuffer->IndexBufferRHI);
RHIUnlockVertexBuffer(PositionVertexBuffer->VertexBufferRHI);
});
}
);

FlushRenderingCommands();

Expand Down

0 comments on commit 7c0c3ca

Please sign in to comment.