增加自定义画质设置

This commit is contained in:
chinosk
2024-05-26 21:34:18 +08:00
parent acac544183
commit 53cb596845
15 changed files with 785 additions and 293 deletions

View File

@@ -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