mirror of
https://git.chinosk6.cn/chinosk/gkms-local.git
synced 2026-02-04 17:13:59 +00:00
支持解锁 Live, 支持自定义角色, 支持换头, 支持 FOV 调整
This commit is contained in:
@@ -139,4 +139,28 @@ namespace GakumasLocal::Log {
|
||||
|
||||
Debug(result.c_str());
|
||||
}
|
||||
|
||||
void LogUnityLog(int prio, const char* fmt, ...) {
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
va_list args_copy;
|
||||
va_copy(args_copy, args);
|
||||
|
||||
// 计算格式化后的字符串长度
|
||||
int size = vsnprintf(nullptr, 0, fmt, args_copy) + 1; // 加上额外的终止符空间
|
||||
va_end(args_copy);
|
||||
|
||||
// 动态分配缓冲区
|
||||
char* buffer = new char[size];
|
||||
|
||||
// 格式化字符串
|
||||
vsnprintf(buffer, size, fmt, args);
|
||||
|
||||
va_end(args);
|
||||
|
||||
std::string result(buffer);
|
||||
delete[] buffer; // 释放缓冲区
|
||||
|
||||
__android_log_write(prio, "GakumasLog", result.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user