Skip to content

Commit

Permalink
Add updates for UE 5.2 so we dont get deprecation warnings that fail …
Browse files Browse the repository at this point in the history
…at compilation
  • Loading branch information
xxEoD2242 committed Jun 16, 2023
1 parent fb8d689 commit f66d436
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ multi-agent autonomous systems. Check it out here: [SWARM Developer System](http
Moving forward, we are now using Unreal Engine 5 version 5.03 or greater! If you
want to use UE4.27, you can use the branch `ue4.27`.

## Unreal Engine Version for Main Branch
The main branch of this repository **only** supports Unreal Engine 5.2! Please see our other branches
for other versions that we support.

## Currently Supported Operating Systems
Below are the list of officially supported Operating Systems, with full Unreal Engine support:
### Windows
Expand Down
12 changes: 6 additions & 6 deletions Unreal/Plugins/AirSim/Source/AirBlueprintLib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -494,9 +494,9 @@ std::vector<msr::airlib::MeshPositionVertexBuffersResponse> UAirBlueprintLib::Ge
ENQUEUE_RENDER_COMMAND(GetVertexBuffer)
(
[vertex_buffer, data](FRHICommandListImmediate& RHICmdList) {
FVector* indices = (FVector*)RHILockVertexBuffer(vertex_buffer->VertexBufferRHI, 0, vertex_buffer->VertexBufferRHI->GetSize(), RLM_ReadOnly);
FVector* indices = (FVector*)RHILockBuffer(vertex_buffer->VertexBufferRHI, 0, vertex_buffer->VertexBufferRHI->GetSize(), RLM_ReadOnly);
memcpy(data, indices, vertex_buffer->VertexBufferRHI->GetSize());
RHIUnlockVertexBuffer(vertex_buffer->VertexBufferRHI);
RHIUnlockBuffer(vertex_buffer->VertexBufferRHI);
});

#if ((ENGINE_MAJOR_VERSION > 4) || (ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION >= 27))
Expand All @@ -516,9 +516,9 @@ std::vector<msr::airlib::MeshPositionVertexBuffersResponse> UAirBlueprintLib::Ge
ENQUEUE_RENDER_COMMAND(GetIndexBuffer)
(
[IndexBuffer, data_ptr](FRHICommandListImmediate& RHICmdList) {
uint16_t* indices = (uint16_t*)RHILockIndexBuffer(IndexBuffer->IndexBufferRHI, 0, IndexBuffer->IndexBufferRHI->GetSize(), RLM_ReadOnly);
uint16_t* indices = (uint16_t*)RHILockBuffer(IndexBuffer->IndexBufferRHI, 0, IndexBuffer->IndexBufferRHI->GetSize(), RLM_ReadOnly);
memcpy(data_ptr, indices, IndexBuffer->IndexBufferRHI->GetSize());
RHIUnlockIndexBuffer(IndexBuffer->IndexBufferRHI);
RHIUnlockBuffer(IndexBuffer->IndexBufferRHI);
});

//Need to force the render command to go through cause on the next iteration the buffer no longer exists
Expand All @@ -539,9 +539,9 @@ std::vector<msr::airlib::MeshPositionVertexBuffersResponse> UAirBlueprintLib::Ge
ENQUEUE_RENDER_COMMAND(GetIndexBuffer)
(
[IndexBuffer, data_ptr](FRHICommandListImmediate& RHICmdList) {
uint32_t* indices = (uint32_t*)RHILockIndexBuffer(IndexBuffer->IndexBufferRHI, 0, IndexBuffer->IndexBufferRHI->GetSize(), RLM_ReadOnly);
uint32_t* indices = (uint32_t*)RHILockBuffer(IndexBuffer->IndexBufferRHI, 0, IndexBuffer->IndexBufferRHI->GetSize(), RLM_ReadOnly);
memcpy(data_ptr, indices, IndexBuffer->IndexBufferRHI->GetSize());
RHIUnlockIndexBuffer(IndexBuffer->IndexBufferRHI);
RHIUnlockBuffer(IndexBuffer->IndexBufferRHI);
});

FlushRenderingCommands();
Expand Down

0 comments on commit f66d436

Please sign in to comment.