diff options
| author | Eder Bastos <bastos.eder@gmail.com> | 2015-05-16 19:02:46 -0400 |
|---|---|---|
| committer | Eder Bastos <bastos.eder@gmail.com> | 2015-05-20 19:44:31 -0400 |
| commit | 4c786cb70c03c15183905586a7ff60cf52d92395 (patch) | |
| tree | a44bc54469efaef0a8dbf2e07bcf0b71411dcf38 /Source/Core/DolphinWX/MainAndroid.cpp | |
| parent | 12493c332c0fe3f19548aa83264aa8f6080b1c1f (diff) | |
Android: Implement reading country value from game files.
Diffstat (limited to 'Source/Core/DolphinWX/MainAndroid.cpp')
| -rw-r--r-- | Source/Core/DolphinWX/MainAndroid.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/Source/Core/DolphinWX/MainAndroid.cpp b/Source/Core/DolphinWX/MainAndroid.cpp index 50aab79f45..44391f0ccd 100644 --- a/Source/Core/DolphinWX/MainAndroid.cpp +++ b/Source/Core/DolphinWX/MainAndroid.cpp @@ -43,6 +43,7 @@ #include "VideoCommon/OnScreenDisplay.h" #include "VideoCommon/VideoBackendBase.h" +#include "../DiscIO/Volume.h" ANativeWindow* surf; std::string g_filename; @@ -178,6 +179,23 @@ static bool IsWiiTitle(std::string filename) return false; } +static int GetCountry(std::string filename) +{ + std::unique_ptr<DiscIO::IVolume> pVolume(DiscIO::CreateVolumeFromFilename(filename)); + + if (pVolume != nullptr) + { + DiscIO::IVolume::ECountry country = pVolume->GetCountry(); + + __android_log_print(ANDROID_LOG_INFO, DOLPHIN_TAG, "Country Code: %i", country); + + return country; + } + + // Technically correct. + return 13; +} + static std::string GetTitle(std::string filename) { __android_log_print(ANDROID_LOG_WARN, DOLPHIN_TAG, "Getting Title for file: %s", filename.c_str()); @@ -330,6 +348,7 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_onGamePadMov JNIEXPORT jintArray JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetBanner(JNIEnv *env, jobject obj, jstring jFile);JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetTitle(JNIEnv *env, jobject obj, jstring jFilename); JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetDescription(JNIEnv *env, jobject obj, jstring jFilename); JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetGameId(JNIEnv *env, jobject obj, jstring jFilename); +JNIEXPORT jint JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetCountry(JNIEnv *env, jobject obj, jstring jFilename); JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetDate(JNIEnv *env, jobject obj, jstring jFilename); JNIEXPORT jlong JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetFilesize(JNIEnv *env, jobject obj, jstring jFilename); JNIEXPORT jboolean JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_IsWiiTitle(JNIEnv *env, jobject obj, jstring jFilename); @@ -411,6 +430,13 @@ JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetDate(J return env->NewStringUTF(date.c_str()); } +JNIEXPORT jint JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetCountry(JNIEnv *env, jobject obj, jstring jFilename) +{ + std::string filename = GetJString(env, jFilename); + int country = GetCountry(filename); + return country; +} + JNIEXPORT jlong JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetFilesize(JNIEnv *env, jobject obj, jstring jFilename) { std::string filename = GetJString(env, jFilename); |
