mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-11 16:49:28 +02:00
Move DiscIO enums to a new file
At first there weren't many enums in Volume.h, but the number has been growing, and I'm planning to add one more for regions. To not make Volume.h too large, and to avoid needing to include Volume.h in code that doesn't use volume objects, I'm moving the enums to a new file. I'm also turning them into enum classes while I'm at it.
This commit is contained in:
@ -33,6 +33,7 @@
|
||||
#include "Core/PowerPC/Profiler.h"
|
||||
#include "Core/State.h"
|
||||
|
||||
#include "DiscIO/Enums.h"
|
||||
#include "DiscIO/Volume.h"
|
||||
#include "DiscIO/VolumeCreator.h"
|
||||
|
||||
@ -226,15 +227,14 @@ static int GetCountry(std::string filename)
|
||||
|
||||
if (pVolume != nullptr)
|
||||
{
|
||||
DiscIO::IVolume::ECountry country = pVolume->GetCountry();
|
||||
int country = static_cast<int>(pVolume->GetCountry());
|
||||
|
||||
__android_log_print(ANDROID_LOG_INFO, DOLPHIN_TAG, "Country Code: %i", country);
|
||||
|
||||
return country;
|
||||
}
|
||||
|
||||
// Return UNKNOWN
|
||||
return 13;
|
||||
return static_cast<int>(DiscIO::Country::COUNTRY_UNKNOWN);
|
||||
}
|
||||
|
||||
static int GetPlatform(std::string filename)
|
||||
@ -245,13 +245,13 @@ static int GetPlatform(std::string filename)
|
||||
{
|
||||
switch (pVolume->GetVolumeType())
|
||||
{
|
||||
case DiscIO::IVolume::GAMECUBE_DISC:
|
||||
case DiscIO::Platform::GAMECUBE_DISC:
|
||||
__android_log_print(ANDROID_LOG_INFO, DOLPHIN_TAG, "Volume is a GameCube disc.");
|
||||
return 0;
|
||||
case DiscIO::IVolume::WII_DISC:
|
||||
case DiscIO::Platform::WII_DISC:
|
||||
__android_log_print(ANDROID_LOG_INFO, DOLPHIN_TAG, "Volume is a Wii disc.");
|
||||
return 1;
|
||||
case DiscIO::IVolume::WII_WAD:
|
||||
case DiscIO::Platform::WII_WAD:
|
||||
__android_log_print(ANDROID_LOG_INFO, DOLPHIN_TAG, "Volume is a Wii WAD.");
|
||||
return 2;
|
||||
}
|
||||
@ -269,13 +269,13 @@ static std::string GetTitle(std::string filename)
|
||||
|
||||
if (pVolume != nullptr)
|
||||
{
|
||||
std::map<DiscIO::IVolume::ELanguage, std::string> titles = pVolume->GetLongNames();
|
||||
std::map<DiscIO::Language, std::string> titles = pVolume->GetLongNames();
|
||||
if (titles.empty())
|
||||
titles = pVolume->GetShortNames();
|
||||
|
||||
/*
|
||||
bool is_wii_title = pVolume->GetVolumeType() != DiscIO::IVolume::GAMECUBE_DISC;
|
||||
DiscIO::IVolume::ELanguage language = SConfig::GetInstance().GetCurrentLanguage(is_wii_title);
|
||||
bool is_wii_title = pVolume->GetVolumeType() != DiscIO::Platform::GAMECUBE_DISC;
|
||||
DiscIO::Language language = SConfig::GetInstance().GetCurrentLanguage(is_wii_title);
|
||||
|
||||
auto it = titles.find(language);
|
||||
if (it != end)
|
||||
@ -284,8 +284,8 @@ static std::string GetTitle(std::string filename)
|
||||
auto end = titles.end();
|
||||
|
||||
// English tends to be a good fallback when the requested language isn't available
|
||||
// if (language != DiscIO::IVolume::ELanguage::LANGUAGE_ENGLISH) {
|
||||
auto it = titles.find(DiscIO::IVolume::ELanguage::LANGUAGE_ENGLISH);
|
||||
// if (language != DiscIO::Language::LANGUAGE_ENGLISH) {
|
||||
auto it = titles.find(DiscIO::Language::LANGUAGE_ENGLISH);
|
||||
if (it != end)
|
||||
return it->second;
|
||||
//}
|
||||
@ -312,11 +312,11 @@ static std::string GetDescription(std::string filename)
|
||||
|
||||
if (volume != nullptr)
|
||||
{
|
||||
std::map<DiscIO::IVolume::ELanguage, std::string> descriptions = volume->GetDescriptions();
|
||||
std::map<DiscIO::Language, std::string> descriptions = volume->GetDescriptions();
|
||||
|
||||
/*
|
||||
bool is_wii_title = pVolume->GetVolumeType() != DiscIO::IVolume::GAMECUBE_DISC;
|
||||
DiscIO::IVolume::ELanguage language = SConfig::GetInstance().GetCurrentLanguage(is_wii_title);
|
||||
bool is_wii_title = pVolume->GetVolumeType() != DiscIO::Platform::GAMECUBE_DISC;
|
||||
DiscIO::Language language = SConfig::GetInstance().GetCurrentLanguage(is_wii_title);
|
||||
|
||||
auto it = descriptions.find(language);
|
||||
if (it != end)
|
||||
@ -325,8 +325,8 @@ static std::string GetDescription(std::string filename)
|
||||
auto end = descriptions.end();
|
||||
|
||||
// English tends to be a good fallback when the requested language isn't available
|
||||
// if (language != DiscIO::IVolume::ELanguage::LANGUAGE_ENGLISH) {
|
||||
auto it = descriptions.find(DiscIO::IVolume::ELanguage::LANGUAGE_ENGLISH);
|
||||
// if (language != DiscIO::Language::LANGUAGE_ENGLISH) {
|
||||
auto it = descriptions.find(DiscIO::Language::LANGUAGE_ENGLISH);
|
||||
if (it != end)
|
||||
return it->second;
|
||||
//}
|
||||
|
Reference in New Issue
Block a user