mirror of
https://git.chinosk6.cn/chinosk/gkms-local.git
synced 2026-02-05 01:14:05 +00:00
增加自定义画质设置
This commit is contained in:
@@ -2,6 +2,10 @@
|
||||
|
||||
#include <codecvt>
|
||||
#include <locale>
|
||||
#include <jni.h>
|
||||
|
||||
|
||||
extern JavaVM* g_javaVM;
|
||||
|
||||
|
||||
namespace GakumasLocal::Misc {
|
||||
@@ -14,4 +18,17 @@ namespace GakumasLocal::Misc {
|
||||
std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t> utf16conv;
|
||||
return utf16conv.to_bytes(str.data(), str.data() + str.size());
|
||||
}
|
||||
|
||||
JNIEnv* GetJNIEnv() {
|
||||
if (!g_javaVM) return nullptr;
|
||||
JNIEnv* env = nullptr;
|
||||
if (g_javaVM->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_6) != JNI_OK) {
|
||||
int status = g_javaVM->AttachCurrentThread(&env, nullptr);
|
||||
if (status < 0) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
return env;
|
||||
}
|
||||
|
||||
} // namespace UmaPyogin::Misc
|
||||
|
||||
Reference in New Issue
Block a user