summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO
diff options
context:
space:
mode:
authorcomex <comexk@gmail.com>2015-06-06 01:23:52 -0400
committercomex <comexk@gmail.com>2015-06-06 01:23:52 -0400
commit95d682dfd5f0fbbe27f5d6a38da98f0535fa6845 (patch)
tree5a84a12a3f5b284ebdddf3c4aa1f2a26ff22cb97 /Source/Core/DiscIO
parent726fc58b49ef44a4477c43bd66cfaec2239411d9 (diff)
parent0ed31181411a9aa98dc194c6179681e670f186cb (diff)
Merge pull request #2519 from JosJuice/volume-type-enum
Volume: Return volume type as an enum
Diffstat (limited to 'Source/Core/DiscIO')
-rw-r--r--Source/Core/DiscIO/FileMonitor.cpp2
-rw-r--r--Source/Core/DiscIO/Volume.h11
-rw-r--r--Source/Core/DiscIO/VolumeDirectory.cpp4
-rw-r--r--Source/Core/DiscIO/VolumeDirectory.h2
-rw-r--r--Source/Core/DiscIO/VolumeGC.cpp5
-rw-r--r--Source/Core/DiscIO/VolumeGC.h1
-rw-r--r--Source/Core/DiscIO/VolumeWad.cpp4
-rw-r--r--Source/Core/DiscIO/VolumeWad.h2
-rw-r--r--Source/Core/DiscIO/VolumeWiiCrypted.cpp4
-rw-r--r--Source/Core/DiscIO/VolumeWiiCrypted.h2
10 files changed, 25 insertions, 12 deletions
diff --git a/Source/Core/DiscIO/FileMonitor.cpp b/Source/Core/DiscIO/FileMonitor.cpp
index 7a3c28fd8a..0583d17a44 100644
--- a/Source/Core/DiscIO/FileMonitor.cpp
+++ b/Source/Core/DiscIO/FileMonitor.cpp
@@ -76,7 +76,7 @@ void ReadFileSystem(const std::string& filename)
if (!OpenISO)
return;
- if (!OpenISO->IsWadFile())
+ if (OpenISO->GetVolumeType() != DiscIO::IVolume::WII_WAD)
{
pFileSystem = DiscIO::CreateFileSystem(OpenISO);
diff --git a/Source/Core/DiscIO/Volume.h b/Source/Core/DiscIO/Volume.h
index 967ecb61bc..fc86827f51 100644
--- a/Source/Core/DiscIO/Volume.h
+++ b/Source/Core/DiscIO/Volume.h
@@ -19,6 +19,14 @@ class IVolume
{
public:
// Increment CACHE_REVISION if the enums below are modified (ISOFile.cpp & GameFile.cpp)
+ enum EPlatform
+ {
+ GAMECUBE_DISC = 0,
+ WII_DISC,
+ WII_WAD,
+ NUMBER_OF_PLATFORMS
+ };
+
enum ECountry
{
COUNTRY_EUROPE = 0,
@@ -86,8 +94,7 @@ public:
// 0 is the first disc, 1 is the second disc
virtual u8 GetDiscNumber() const { return 0; }
- virtual bool IsWiiDisc() const { return false; }
- virtual bool IsWadFile() const { return false; }
+ virtual EPlatform GetVolumeType() const = 0;
virtual bool SupportsIntegrityCheck() const { return false; }
virtual bool CheckIntegrity() const { return false; }
virtual bool ChangePartition(u64 offset) { return false; }
diff --git a/Source/Core/DiscIO/VolumeDirectory.cpp b/Source/Core/DiscIO/VolumeDirectory.cpp
index b7fe30aed5..77f4523417 100644
--- a/Source/Core/DiscIO/VolumeDirectory.cpp
+++ b/Source/Core/DiscIO/VolumeDirectory.cpp
@@ -220,9 +220,9 @@ std::string CVolumeDirectory::GetApploaderDate() const
return "VOID";
}
-bool CVolumeDirectory::IsWiiDisc() const
+IVolume::EPlatform CVolumeDirectory::GetVolumeType() const
{
- return m_is_wii;
+ return m_is_wii ? WII_DISC : GAMECUBE_DISC;
}
u64 CVolumeDirectory::GetSize() const
diff --git a/Source/Core/DiscIO/VolumeDirectory.h b/Source/Core/DiscIO/VolumeDirectory.h
index 3498459a5a..ac9d965e3b 100644
--- a/Source/Core/DiscIO/VolumeDirectory.h
+++ b/Source/Core/DiscIO/VolumeDirectory.h
@@ -47,7 +47,7 @@ public:
u32 GetFSTSize() const override;
std::string GetApploaderDate() const override;
- bool IsWiiDisc() const override;
+ EPlatform GetVolumeType() const override;
ECountry GetCountry() const override;
diff --git a/Source/Core/DiscIO/VolumeGC.cpp b/Source/Core/DiscIO/VolumeGC.cpp
index d4883645c9..8a396cff00 100644
--- a/Source/Core/DiscIO/VolumeGC.cpp
+++ b/Source/Core/DiscIO/VolumeGC.cpp
@@ -272,6 +272,11 @@ u8 CVolumeGC::GetDiscNumber() const
return disc_number;
}
+IVolume::EPlatform CVolumeGC::GetVolumeType() const
+{
+ return GAMECUBE_DISC;
+}
+
bool CVolumeGC::LoadBannerFile() const
{
// The methods GetNames, GetDescriptions, GetCompany and GetBanner
diff --git a/Source/Core/DiscIO/VolumeGC.h b/Source/Core/DiscIO/VolumeGC.h
index 415158eaef..9d93441579 100644
--- a/Source/Core/DiscIO/VolumeGC.h
+++ b/Source/Core/DiscIO/VolumeGC.h
@@ -37,6 +37,7 @@ public:
std::string GetApploaderDate() const override;
u8 GetDiscNumber() const override;
+ EPlatform GetVolumeType() const override;
ECountry GetCountry() const override;
u64 GetSize() const override;
u64 GetRawSize() const override;
diff --git a/Source/Core/DiscIO/VolumeWad.cpp b/Source/Core/DiscIO/VolumeWad.cpp
index 18836f8e63..de1a2fd542 100644
--- a/Source/Core/DiscIO/VolumeWad.cpp
+++ b/Source/Core/DiscIO/VolumeWad.cpp
@@ -112,9 +112,9 @@ u16 CVolumeWAD::GetRevision() const
return Common::swap16(revision);
}
-bool CVolumeWAD::IsWadFile() const
+IVolume::EPlatform CVolumeWAD::GetVolumeType() const
{
- return true;
+ return WII_WAD;
}
std::map<IVolume::ELanguage, std::string> CVolumeWAD::GetNames() const
diff --git a/Source/Core/DiscIO/VolumeWad.h b/Source/Core/DiscIO/VolumeWad.h
index 0b4a8b6e07..e52951e33e 100644
--- a/Source/Core/DiscIO/VolumeWad.h
+++ b/Source/Core/DiscIO/VolumeWad.h
@@ -36,7 +36,7 @@ public:
u32 GetFSTSize() const override { return 0; }
std::string GetApploaderDate() const override { return ""; }
- bool IsWadFile() const override;
+ EPlatform GetVolumeType() const override;
ECountry GetCountry() const override;
u64 GetSize() const override;
diff --git a/Source/Core/DiscIO/VolumeWiiCrypted.cpp b/Source/Core/DiscIO/VolumeWiiCrypted.cpp
index 4a4c1ad3bc..fe337253df 100644
--- a/Source/Core/DiscIO/VolumeWiiCrypted.cpp
+++ b/Source/Core/DiscIO/VolumeWiiCrypted.cpp
@@ -238,9 +238,9 @@ std::string CVolumeWiiCrypted::GetApploaderDate() const
return date;
}
-bool CVolumeWiiCrypted::IsWiiDisc() const
+IVolume::EPlatform CVolumeWiiCrypted::GetVolumeType() const
{
- return true;
+ return WII_DISC;
}
u8 CVolumeWiiCrypted::GetDiscNumber() const
diff --git a/Source/Core/DiscIO/VolumeWiiCrypted.h b/Source/Core/DiscIO/VolumeWiiCrypted.h
index 1637e69594..634614a690 100644
--- a/Source/Core/DiscIO/VolumeWiiCrypted.h
+++ b/Source/Core/DiscIO/VolumeWiiCrypted.h
@@ -37,7 +37,7 @@ public:
std::string GetApploaderDate() const override;
u8 GetDiscNumber() const override;
- bool IsWiiDisc() const override;
+ EPlatform GetVolumeType() const override;
bool SupportsIntegrityCheck() const override { return true; }
bool CheckIntegrity() const override;
bool ChangePartition(u64 offset) override;