mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-18 04:23:20 +01:00
Use std::make_unique instead of new for arrays
This commit is contained in:
@@ -185,7 +185,7 @@ bool SpriteFile::Save(const utf8* path)
|
||||
static bool SpriteImageExport(const rct_g1_element& spriteElement, const char* outPath)
|
||||
{
|
||||
const auto pixelBufferSize = spriteElement.width * spriteElement.height;
|
||||
std::unique_ptr<uint8_t[]> pixelBuffer(new uint8_t[pixelBufferSize]);
|
||||
auto pixelBuffer = std::make_unique<uint8_t[]>(pixelBufferSize);
|
||||
auto pixels = pixelBuffer.get();
|
||||
std::fill_n(pixels, pixelBufferSize, 0x00);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user