From 86ee478273b8fbed06216cd4ca65e914c0971b2c Mon Sep 17 00:00:00 2001 From: Jan Laupetin Date: Mon, 10 Nov 2025 21:32:32 +0100 Subject: [PATCH] chore: use std vector for std arrays --- src/ObjLoading/Game/T6/BSP/BSPCreator.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ObjLoading/Game/T6/BSP/BSPCreator.cpp b/src/ObjLoading/Game/T6/BSP/BSPCreator.cpp index bc12bea1..98f25a46 100644 --- a/src/ObjLoading/Game/T6/BSP/BSPCreator.cpp +++ b/src/ObjLoading/Game/T6/BSP/BSPCreator.cpp @@ -209,8 +209,8 @@ namespace BSP return nullptr; } - std::unique_ptr gfxMapData(new char[static_cast(gfxFile.m_length)]); - gfxFile.m_stream->read(gfxMapData.get(), gfxFile.m_length); + std::vector gfxMapData(static_cast(gfxFile.m_length)); + gfxFile.m_stream->read(gfxMapData.data(), gfxFile.m_length); if (gfxFile.m_stream->gcount() != gfxFile.m_length) { con::error("Read error of gfx fbx file: {}", gfxFbxPath); @@ -222,7 +222,7 @@ namespace BSP optsGfx.target_axes = ufbx_axes_right_handed_y_up; optsGfx.generate_missing_normals = true; optsGfx.allow_missing_vertex_position = false; - ufbx_scene* gfxScene = ufbx_load_memory(gfxMapData.get(), static_cast(gfxFile.m_length), &optsGfx, &errorGfx); + ufbx_scene* gfxScene = ufbx_load_memory(gfxMapData.data(), static_cast(gfxFile.m_length), &optsGfx, &errorGfx); if (!gfxScene) { con::error("Failed to load map gfx fbx file: {}", errorGfx.description.data); @@ -239,9 +239,9 @@ namespace BSP } else { - std::unique_ptr colMapData(new char[static_cast(colFile.m_length)]); + std::vector colMapData(static_cast(colFile.m_length)); colFile.m_stream->seekg(0); - colFile.m_stream->read(colMapData.get(), colFile.m_length); + colFile.m_stream->read(colMapData.data(), colFile.m_length); if (colFile.m_stream->gcount() != colFile.m_length) { con::error("Read error of collision fbx file: {}", colFbxPath); @@ -253,7 +253,7 @@ namespace BSP optsCol.target_axes = ufbx_axes_right_handed_y_up; optsCol.generate_missing_normals = true; optsCol.allow_missing_vertex_position = false; - colScene = ufbx_load_memory(colMapData.get(), static_cast(colFile.m_length), &optsCol, &errorCol); + colScene = ufbx_load_memory(colMapData.data(), static_cast(colFile.m_length), &optsCol, &errorCol); if (!colScene) { con::error("Failed to load map collision fbx file: {}", errorCol.description.data);