mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
remove unnecessary 'new' operators
This commit is contained in:
parent
26e2068164
commit
fab124a2e2
9 changed files with 36 additions and 42 deletions
|
|
@ -254,7 +254,7 @@ void ImageData::fixAlphaColor() {
|
|||
}
|
||||
}
|
||||
|
||||
ImageData* add_atlas_margins(ImageData* image, int grid_size) {
|
||||
std::unique_ptr<ImageData> add_atlas_margins(ImageData* image, int grid_size) {
|
||||
// RGBA is only supported
|
||||
assert(image->getFormat() == ImageFormat::rgba8888);
|
||||
assert(image->getWidth() == image->getHeight());
|
||||
|
|
@ -300,5 +300,7 @@ ImageData* add_atlas_margins(ImageData* image, int grid_size) {
|
|||
}
|
||||
}
|
||||
}
|
||||
return new ImageData(image->getFormat(), dstwidth, dstheight, std::move(dstdata));
|
||||
return std::make_unique<ImageData>(
|
||||
image->getFormat(), dstwidth, dstheight, std::move(dstdata)
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue