diff --git a/hecl/lib/CVar.cpp b/hecl/lib/CVar.cpp index 9cf5c41b3..6a3d3c8c0 100755 --- a/hecl/lib/CVar.cpp +++ b/hecl/lib/CVar.cpp @@ -127,7 +127,7 @@ CVar::CVar(std::string_view name, int value, std::string_view help, CVar::EFlags std::string CVar::help() const { return std::string(m_help + (m_defaultValue != std::string() ? "\ndefault: " + m_defaultValue : "") + - (isReadOnly() ? "[ReadOnly]" : "")); + (isReadOnly() ? " [ReadOnly]" : "")); } atVec4f CVar::toVec4f(bool* isValid) const diff --git a/hecl/lib/CVarManager.cpp b/hecl/lib/CVarManager.cpp index 79ebc1af3..5ac9d5f0a 100755 --- a/hecl/lib/CVarManager.cpp +++ b/hecl/lib/CVarManager.cpp @@ -276,7 +276,7 @@ void CVarManager::parseCommandLine(const std::vector& args) { bool oldDeveloper = suppressDeveloper(); std::string developerName = com_developer->name().data(); - ToLower(developerName); + athena::utility::tolower(developerName); for (const SystemString& arg : args) { if (arg[0] == _S('+')) @@ -291,7 +291,7 @@ void CVarManager::parseCommandLine(const std::vector& args) if (CVar* cv = findCVar(cvarName)) { cv->fromLiteralToType(cvarValue); - hecl::ToLower(cvarName); + athena::utility::tolower(cvarName); if (developerName == cvarName) /* Make sure we're not overriding developer mode when we restore */ oldDeveloper = com_developer->toBoolean(); diff --git a/hecl/lib/Console.cpp b/hecl/lib/Console.cpp index b1eea1bc4..30e5b0509 100644 --- a/hecl/lib/Console.cpp +++ b/hecl/lib/Console.cpp @@ -124,7 +124,12 @@ void Console::report(Level level, const char* fmt, va_list list) { char tmp[2048]; vsnprintf(tmp, 2048, fmt, list); - m_log.emplace_back(std::string(tmp), level); + std::vector lines = athena::utility::split(tmp, '\n'); + for (const std::string& line : lines) + { + std::string v = athena::utility::sprintf("%s", line.c_str()); + m_log.emplace_back(v, level); + } printf("%s\n", tmp); } @@ -372,16 +377,24 @@ void Console::LogVisorAdapter::report(const char* modName, logvisor::Level sever { char tmp[2048]; vsnprintf(tmp, 2048, format, ap); - std::string v = athena::utility::sprintf("[%s] %s", modName, tmp); - m_con->m_log.emplace_back(v, Console::Level(severity)); + std::vector lines = athena::utility::split(tmp, '\n'); + for (const std::string& line : lines) + { + std::string v = athena::utility::sprintf("[%s] %s", modName, line.c_str()); + m_con->m_log.emplace_back(v, Console::Level(severity)); + } } void Console::LogVisorAdapter::report(const char* modName, logvisor::Level severity, const wchar_t* format, va_list ap) { wchar_t tmp[2048]; vswprintf(tmp, 2048, format, ap); - std::string v = athena::utility::sprintf("[%s] %s", modName, athena::utility::wideToUtf8(tmp).c_str()); - m_con->m_log.emplace_back(v, Console::Level(severity)); + std::vector lines = athena::utility::split(athena::utility::wideToUtf8(tmp), '\n'); + for (const std::string& line : lines) + { + std::string v = athena::utility::sprintf("[%s] %s", modName, line.c_str()); + m_con->m_log.emplace_back(v, Console::Level(severity)); + } } void Console::LogVisorAdapter::reportSource(const char* modName, logvisor::Level severity, const char* file, unsigned linenum, const char* format, va_list ap) @@ -396,8 +409,12 @@ void Console::LogVisorAdapter::reportSource(const char* modName, logvisor::Level { wchar_t tmp[2048]; vswprintf(tmp, 2048, format, ap); - std::string v = athena::utility::sprintf("[%s] %s %s:%i", modName, athena::utility::wideToUtf8(tmp).c_str(), file, linenum); - m_con->m_log.emplace_back(v, Console::Level(severity)); + std::vector lines = athena::utility::split(athena::utility::wideToUtf8(tmp), '\n'); + for (const std::string& line : lines) + { + std::string v = athena::utility::sprintf("[%s] %s %s:%i", modName, line.c_str(), file, linenum); + m_con->m_log.emplace_back(v, Console::Level(severity)); + } } void Console::dumpLog()