diff --git a/Common/UI/AsyncImageFileView.cpp b/Common/UI/AsyncImageFileView.cpp index 845e2ad86a..3fa627b900 100644 --- a/Common/UI/AsyncImageFileView.cpp +++ b/Common/UI/AsyncImageFileView.cpp @@ -79,7 +79,7 @@ void AsyncImageFileView::DeviceRestored(Draw::DrawContext *draw) { void AsyncImageFileView::Draw(UIContext &dc) { using namespace Draw; if (!texture_ && !textureFailed_ && !filename_.empty()) { - texture_ = std::unique_ptr(new ManagedTexture(dc.GetDrawContext(), filename_.c_str(), ImageFileType::DETECT, true)); + texture_ = std::make_unique(dc.GetDrawContext(), filename_.c_str(), ImageFileType::DETECT, true); if (!texture_.get()) textureFailed_ = true; } diff --git a/Core/HLE/sceIo.cpp b/Core/HLE/sceIo.cpp index ef2ba44cbf..b69eb28320 100644 --- a/Core/HLE/sceIo.cpp +++ b/Core/HLE/sceIo.cpp @@ -649,9 +649,9 @@ void __IoInit() { // TODO(scoped): This won't work if memStickDirectory points at the contents of /PSP... #if defined(USING_WIN_UI) || defined(APPLE) - auto flash0System = std::shared_ptr(new DirectoryFileSystem(&pspFileSystem, g_Config.flash0Directory, FileSystemFlags::FLASH)); + auto flash0System = std::make_shared(&pspFileSystem, g_Config.flash0Directory, FileSystemFlags::FLASH); #else - auto flash0System = std::shared_ptr(new VFSFileSystem(&pspFileSystem, "flash0")); + auto flash0System = std::make_shared(&pspFileSystem, "flash0"); #endif FileSystemFlags memstickFlags = FileSystemFlags::SIMULATE_FAT32 | FileSystemFlags::CARD; @@ -662,7 +662,7 @@ void __IoInit() { memstickFlags |= FileSystemFlags::STRIP_PSP; } - auto memstickSystem = std::shared_ptr(new DirectoryFileSystem(&pspFileSystem, g_Config.memStickDirectory, memstickFlags)); + auto memstickSystem = std::make_shared(&pspFileSystem, g_Config.memStickDirectory, memstickFlags); pspFileSystem.Mount("ms0:", memstickSystem); pspFileSystem.Mount("fatms0:", memstickSystem); @@ -675,7 +675,7 @@ void __IoInit() { const std::string gameId = g_paramSFO.GetDiscID(); const Path exdataPath = GetSysDirectory(DIRECTORY_EXDATA) / gameId; if (File::Exists(exdataPath)) { - auto exdataSystem = std::shared_ptr(new DirectoryFileSystem(&pspFileSystem, exdataPath, FileSystemFlags::SIMULATE_FAT32 | FileSystemFlags::CARD)); + auto exdataSystem = std::make_shared(&pspFileSystem, exdataPath, FileSystemFlags::SIMULATE_FAT32 | FileSystemFlags::CARD); pspFileSystem.Mount("exdata0:", exdataSystem); INFO_LOG(SCEIO, "Mounted exdata/%s/ under memstick for exdata0:/", gameId.c_str()); } else { diff --git a/Core/PSPLoaders.cpp b/Core/PSPLoaders.cpp index b3dac49194..e126310f2d 100644 --- a/Core/PSPLoaders.cpp +++ b/Core/PSPLoaders.cpp @@ -84,7 +84,7 @@ void InitMemoryForGameISO(FileLoader *fileLoader) { std::shared_ptr blockSystem; if (fileLoader->IsDirectory()) { - fileSystem = std::shared_ptr(new VirtualDiscFileSystem(&pspFileSystem, fileLoader->GetPath())); + fileSystem = std::make_shared(&pspFileSystem, fileLoader->GetPath()); blockSystem = fileSystem; } else { auto bd = constructBlockDevice(fileLoader); @@ -92,9 +92,9 @@ void InitMemoryForGameISO(FileLoader *fileLoader) { if (!bd) return; - std::shared_ptr iso = std::shared_ptr(new ISOFileSystem(&pspFileSystem, bd)); + auto iso = std::make_shared(&pspFileSystem, bd); fileSystem = iso; - blockSystem = std::shared_ptr(new ISOBlockSystem(iso)); + blockSystem = std::make_shared(iso); } pspFileSystem.Mount("umd0:", blockSystem); @@ -152,16 +152,16 @@ bool ReInitMemoryForGameISO(FileLoader *fileLoader) { std::shared_ptr blockSystem; if (fileLoader->IsDirectory()) { - fileSystem = std::shared_ptr(new VirtualDiscFileSystem(&pspFileSystem, fileLoader->GetPath())); + fileSystem = std::make_shared(&pspFileSystem, fileLoader->GetPath()); blockSystem = fileSystem; } else { auto bd = constructBlockDevice(fileLoader); if (!bd) return false; - std::shared_ptr iso = std::shared_ptr(new ISOFileSystem(&pspFileSystem, bd)); + auto iso = std::make_shared(&pspFileSystem, bd); fileSystem = iso; - blockSystem = std::shared_ptr(new ISOBlockSystem(iso)); + blockSystem = std::make_shared(iso); } pspFileSystem.Remount("umd0:", blockSystem); @@ -368,8 +368,8 @@ bool Load_PSP_ELF_PBP(FileLoader *fileLoader, std::string *error_string) { if (PSP_CoreParameter().mountIsoLoader != nullptr) { auto bd = constructBlockDevice(PSP_CoreParameter().mountIsoLoader); if (bd != NULL) { - std::shared_ptr umd2 = std::shared_ptr(new ISOFileSystem(&pspFileSystem, bd)); - std::shared_ptr blockSystem = std::shared_ptr(new ISOBlockSystem(umd2)); + auto umd2 = std::make_shared(&pspFileSystem, bd); + auto blockSystem = std::make_shared(umd2); pspFileSystem.Mount("umd1:", blockSystem); pspFileSystem.Mount("disc0:", umd2); @@ -430,7 +430,7 @@ bool Load_PSP_ELF_PBP(FileLoader *fileLoader, std::string *error_string) { dir = full_path.NavigateUp(); } - std::shared_ptr fs = std::shared_ptr(new DirectoryFileSystem(&pspFileSystem, dir, FileSystemFlags::SIMULATE_FAT32 | FileSystemFlags::CARD)); + auto fs = std::make_shared(&pspFileSystem, dir, FileSystemFlags::SIMULATE_FAT32 | FileSystemFlags::CARD); pspFileSystem.Mount("umd0:", fs); std::string finalName = ms_path + file; @@ -495,7 +495,7 @@ bool Load_PSP_ELF_PBP(FileLoader *fileLoader, std::string *error_string) { } bool Load_PSP_GE_Dump(FileLoader *fileLoader, std::string *error_string) { - std::shared_ptr umd = std::shared_ptr(new BlobFileSystem(&pspFileSystem, fileLoader, "data.ppdmp")); + auto umd = std::make_shared(&pspFileSystem, fileLoader, "data.ppdmp"); pspFileSystem.Mount("disc0:", umd); PSPLoaders_Shutdown();