mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-08 12:54:25 +00:00
1c027bc148
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).
27 lines
563 B
C++
27 lines
563 B
C++
// 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());
|
|
}
|