From 0a15aaaa123482ecf7b2490a13e33a884416d51c Mon Sep 17 00:00:00 2001 From: JosJuice Date: Wed, 6 Jul 2016 20:33:05 +0200 Subject: 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. --- Source/Android/jni/MainAndroid.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'Source/Android/jni/MainAndroid.cpp') diff --git a/Source/Android/jni/MainAndroid.cpp b/Source/Android/jni/MainAndroid.cpp index 2ccc634874..7e3da54b25 100644 --- a/Source/Android/jni/MainAndroid.cpp +++ b/Source/Android/jni/MainAndroid.cpp @@ -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(pVolume->GetCountry()); __android_log_print(ANDROID_LOG_INFO, DOLPHIN_TAG, "Country Code: %i", country); return country; } - // Return UNKNOWN - return 13; + return static_cast(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 titles = pVolume->GetLongNames(); + std::map 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 descriptions = volume->GetDescriptions(); + std::map 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; //} -- cgit v1.2.3