mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Clean up pointer use:
* Use unique_ptr for Actions instead of manual memory management * Use unique_ptr in KeywordDatabase * Use unique_ptr instead of shared_ptr for file formats * Don't pass shared_ptr to Reader/Writer, use references instead Also * Switch to C++17 so we can use map::try_emplace
This commit is contained in:
@@ -32,7 +32,7 @@ void ImageValueViewer::draw(RotatedDC& dc) {
|
||||
// load from file
|
||||
if (!value().filename.empty()) {
|
||||
try {
|
||||
InputStreamP image_file = getLocalPackage().openIn(value().filename);
|
||||
auto image_file = getLocalPackage().openIn(value().filename);
|
||||
if (image_load_file(image, *image_file)) {
|
||||
image.Rescale(w, h);
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ void PackageChoiceValueViewer::initItems() {
|
||||
i.package_name = p->relativeFilename();
|
||||
i.name = capitalize_sentence(p->short_name);
|
||||
Image image;
|
||||
InputStreamP stream = p->openIconFile();
|
||||
auto stream = p->openIconFile();
|
||||
if (stream && image_load_file(image, *stream)) {
|
||||
i.image = Bitmap(resample(image, 16,16));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user