This commit is contained in:
MihailRis
2024-04-28 22:33:34 +03:00
parent 167388aefb
commit ef28a368cb
12 changed files with 54 additions and 51 deletions
+2 -2
View File
@@ -50,7 +50,7 @@ bool AtlasBuilder::has(const std::string& name) const {
return names.find(name) != names.end();
}
Atlas* AtlasBuilder::build(uint extrusion, bool prepare, uint maxResolution) {
std::unique_ptr<Atlas> AtlasBuilder::build(uint extrusion, bool prepare, uint maxResolution) {
if (maxResolution == 0) {
maxResolution = Texture::MAX_RESOLUTION;
}
@@ -99,5 +99,5 @@ Atlas* AtlasBuilder::build(uint extrusion, bool prepare, uint maxResolution) {
unitX * x, unitY * y, unitX * (x + w), unitY * (y + h)
);
}
return new Atlas(std::move(canvas), regions, prepare);
return std::make_unique<Atlas>(std::move(canvas), regions, prepare);
}
+1 -1
View File
@@ -55,7 +55,7 @@ public:
/// (greather is less mip-mapping artifacts)
/// @param prepare generate atlas texture (calls .prepare())
/// @param maxResolution max atlas resolution
Atlas* build(uint extrusion, bool prepare=true, uint maxResolution=0);
std::unique_ptr<Atlas> build(uint extrusion, bool prepare=true, uint maxResolution=0);
};
#endif // GRAPHICS_CORE_ATLAS_HPP_