@@ -59,12 +59,12 @@ bool AsepriteDecoder::decode()
59
59
60
60
// Create the new sprite
61
61
std::unique_ptr<doc::Sprite> sprite (
62
- new doc::Sprite (doc::ImageSpec (header.depth == 32 ? doc::ColorMode::RGB:
63
- header.depth == 16 ? doc::ColorMode::GRAYSCALE:
64
- doc::ColorMode::INDEXED,
65
- header.width ,
66
- header.height ),
67
- header.ncolors ));
62
+ std::make_unique< doc::Sprite> (doc::ImageSpec (header.depth == 32 ? doc::ColorMode::RGB:
63
+ header.depth == 16 ? doc::ColorMode::GRAYSCALE:
64
+ doc::ColorMode::INDEXED,
65
+ header.width ,
66
+ header.height ),
67
+ header.ncolors ));
68
68
69
69
// Set frames and speed
70
70
sprite->setTotalFrames (doc::frame_t (header.frames ));
@@ -784,7 +784,7 @@ doc::Cel* AsepriteDecoder::readCelChunk(doc::Sprite* sprite,
784
784
break ;
785
785
}
786
786
787
- cel. reset ( new doc::Cel (frame, image) );
787
+ cel = std::make_unique< doc::Cel> (frame, image);
788
788
cel->setPosition (x, y);
789
789
cel->setOpacity (opacity);
790
790
}
@@ -825,7 +825,7 @@ doc::Cel* AsepriteDecoder::readCelChunk(doc::Sprite* sprite,
825
825
doc::ImageRef image (doc::Image::create (pixelFormat, w, h));
826
826
read_compressed_image (f (), delegate (), image.get (), header, chunk_end);
827
827
828
- cel. reset ( new doc::Cel (frame, image) );
828
+ cel = std::make_unique< doc::Cel> (frame, image);
829
829
cel->setPosition (x, y);
830
830
cel->setOpacity (opacity);
831
831
}
@@ -870,7 +870,7 @@ doc::Cel* AsepriteDecoder::readCelChunk(doc::Sprite* sprite,
870
870
return doc::tile_geti (tile) >= tilesetSize ? doc::notile : tile;
871
871
});
872
872
873
- cel. reset ( new doc::Cel (frame, image) );
873
+ cel = std::make_unique< doc::Cel> (frame, image);
874
874
cel->setPosition (x, y);
875
875
cel->setOpacity (opacity);
876
876
}
@@ -1075,7 +1075,7 @@ doc::Slice* AsepriteDecoder::readSliceChunk(doc::Slices& slices)
1075
1075
read32 (); // 4 bytes reserved
1076
1076
std::string name = readString (); // Name
1077
1077
1078
- std::unique_ptr<doc::Slice> slice (new doc::Slice);
1078
+ std::unique_ptr<doc::Slice> slice (std::make_unique< doc::Slice>() );
1079
1079
slice->setName (name);
1080
1080
1081
1081
// For each key
0 commit comments