Make OpenAL debugging easier

This commit is contained in:
Ilya Fedin 2020-12-29 15:25:44 +04:00 committed by John Preston
parent e864aa2ff2
commit 19a5dcbffc
1 changed files with 17 additions and 0 deletions

View File

@ -324,6 +324,23 @@ int Launcher::exec() {
// Must be started before Platform is started.
Logs::start(this);
if (Logs::DebugEnabled()) {
const auto openalLogPath = QDir::toNativeSeparators(
cWorkingDir() + qsl("DebugLogs/last_openal_log.txt"));
qputenv("ALSOFT_LOGLEVEL", "3");
#ifdef Q_OS_WIN
_wputenv_s(
L"ALSOFT_LOGFILE",
openalLogPath.toStdWString().c_str());
#else // Q_OS_WIN
qputenv(
"ALSOFT_LOGFILE",
QFile::encodeName(openalLogPath));
#endif // !Q_OS_WIN
}
// Must be started before Sandbox is created.
Platform::start();
Ui::DisableCustomScaling();