summaryrefslogtreecommitdiff
path: root/Source/Android/jni/MainAndroid.cpp
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2016-07-06 20:33:05 +0200
committerJosJuice <josjuice@gmail.com>2016-07-13 17:29:27 +0200
commit0a15aaaa123482ecf7b2490a13e33a884416d51c (patch)
tree3ba5c883fb2a16ae29b77a6dac575642d41582e7 /Source/Android/jni/MainAndroid.cpp
parentbaf9abe9115fe444689f9a773fe814b1fc83956d (diff)
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.
Diffstat (limited to 'Source/Android/jni/MainAndroid.cpp')
-rw-r--r--Source/Android/jni/MainAndroid.cpp32
1 files changed, 16 insertions, 16 deletions
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<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;
//}