mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-11 16:49:28 +02:00
Use UICommon's game list code on Android
Deduplicates code, and gets rid of some problems the old code had (such as: bad performance when calling native functions, only one disc showing up for multi-disc games, Wii banners being low-res, unnecessarily much effort being needed for adding more metadata).
This commit is contained in:
26
Source/Android/jni/AndroidCommon/AndroidCommon.cpp
Normal file
26
Source/Android/jni/AndroidCommon/AndroidCommon.cpp
Normal file
@ -0,0 +1,26 @@
|
||||
// Copyright 2018 Dolphin Emulator Project
|
||||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "jni/AndroidCommon/AndroidCommon.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <jni.h>
|
||||
|
||||
std::string GetJString(JNIEnv* env, jstring jstr)
|
||||
{
|
||||
std::string result = "";
|
||||
if (!jstr)
|
||||
return result;
|
||||
|
||||
const char* s = env->GetStringUTFChars(jstr, nullptr);
|
||||
result = s;
|
||||
env->ReleaseStringUTFChars(jstr, s);
|
||||
return result;
|
||||
}
|
||||
|
||||
jstring ToJString(JNIEnv* env, const std::string& str)
|
||||
{
|
||||
return env->NewStringUTF(str.c_str());
|
||||
}
|
Reference in New Issue
Block a user