概要
UEを更新した際(多分UE5.6)にImGuiのビルドでWarningが出ている箇所があったのでその修正
Warning内容
ローカルディレクトリが書かれている箇所は~で置換しています
[15/73] Compile [x64] ImGuiContextProxy.cpp
~\Plugins\ImGui\Source\ImGui\Private\ImGuiContextProxy.cpp(268,12): warning C4996: 'TArray<FImGuiDrawList,FDefaultAllocator>::SetNum': SetNum with a boolean bAllowShrinking has been deprecated - please use the EAllowShrinking enum instead - Please update your code to the new API before upgrading to the next release, otherwise your project will no longer compile.
DrawLists.SetNum(DrawData->CmdListsCount, false);
^
[16/73] Compile [x64] ImGuiDrawData.cpp
~\Plugins\ImGui\Source\ImGui\Private\ImGuiDrawData.cpp(13,17): warning C4996: 'TArray<FSlateVertex,FDefaultAllocator>::SetNumUninitialized': SetNumUninitialized with a boolean bAllowShrinking has been deprecated - please use the EAllowShrinking enum instead - Please update your code to the new API before upgrading to the next release, otherwise your project will no longer compile.
OutVertexBuffer.SetNumUninitialized(ImGuiVertexBuffer.Size, false);
^
~\Plugins\ImGui\Source\ImGui\Private\ImGuiDrawData.cpp(47,16): warning C4996: 'TArray<uint32,FDefaultAllocator>::SetNumUninitialized': SetNumUninitialized with a boolean bAllowShrinking has been deprecated - please use the EAllowShrinking enum instead - Please update your code to the new API before upgrading to the next release, otherwise your project will no longer compile.
OutIndexBuffer.SetNumUninitialized(NumElements, false);
^
Warningの内容
引数の2番目のboolの指定がenumを指定するように変わったので出てしまっているようです
シュリンク(縮小)を許可するかどうかをboolでやっていたのがenumで指定させる形に変わるようです
更新内容
ImGuiContextProxy.cpp line 268
// Before(元々シュリンクは許可していない)
DrawLists.SetNum(DrawData->CmdListsCount, false);
// After(enumでのシュリンク許可なしに変える)
DrawLists.SetNum(DrawData->CmdListsCount, EAllowShrinking::No);
ImGuiDrawData.cpp line 13
// Before(元々シュリンクは許可していない)
OutVertexBuffer.SetNumUninitialized(ImGuiVertexBuffer.Size, false);
// After(enumでのシュリンク許可なしに変える)
OutVertexBuffer.SetNumUninitialized(ImGuiVertexBuffer.Size, EAllowShrinking::No);
ImGuiDrawData.cpp line 13
// Before(元々シュリンクは許可していない)
OutIndexBuffer.SetNumUninitialized(NumElements, false);
// After(enumでのシュリンク許可なしに変える)
OutIndexBuffer.SetNumUninitialized(NumElements, EAllowShrinking::No);