From 19b8f1c10adeefd9413687ab7a7c21b509fe777d Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sat, 13 Jun 2015 12:51:24 +0200 Subject: VolumeWiiCrypted: Replace ChangePartition with a partition parameter By removing mutable state in VolumeWiiCrypted, this change makes partition-related code simpler. It also gets rid of other ugly things, like ISOProperties's "over 9000" loop that creates a list of partitions by trying possible combinations, and DiscScrubber's volume swapping that recreates the entire volume when it needs to change partition. --- Source/Core/DiscIO/Filesystem.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'Source/Core/DiscIO/Filesystem.cpp') diff --git a/Source/Core/DiscIO/Filesystem.cpp b/Source/Core/DiscIO/Filesystem.cpp index 48c9a33b6f..9670ecda43 100644 --- a/Source/Core/DiscIO/Filesystem.cpp +++ b/Source/Core/DiscIO/Filesystem.cpp @@ -5,10 +5,12 @@ #include "DiscIO/Filesystem.h" #include #include "DiscIO/FileSystemGCWii.h" +#include "DiscIO/Volume.h" namespace DiscIO { -IFileSystem::IFileSystem(const IVolume* _rVolume) : m_rVolume(_rVolume) +IFileSystem::IFileSystem(const IVolume* _rVolume, const Partition& partition) + : m_rVolume(_rVolume), m_partition(partition) { } @@ -16,12 +18,12 @@ IFileSystem::~IFileSystem() { } -std::unique_ptr CreateFileSystem(const IVolume* volume) +std::unique_ptr CreateFileSystem(const IVolume* volume, const Partition& partition) { if (!volume) return nullptr; - std::unique_ptr filesystem = std::make_unique(volume); + std::unique_ptr filesystem = std::make_unique(volume, partition); if (!filesystem) return nullptr; -- cgit v1.2.3