maint: minor change to branding

This commit is contained in:
Diavolo 2022-12-30 11:25:50 +01:00
parent 4dcd90c84b
commit 7d5d402144
No known key found for this signature in database
GPG Key ID: FA77F074E98D98A5
2 changed files with 6 additions and 10 deletions

View File

@ -11,7 +11,7 @@ static char* com_get_build_version_stub()
const auto version_number = SELECT_VALUE(0x1CD, 0x5EC0E); const auto version_number = SELECT_VALUE(0x1CD, 0x5EC0E);
_snprintf_s(buf, _TRUNCATE, "%d %s", version_number, __DATE__); sprintf_s(buf, _TRUNCATE, "%d %s", version_number, __DATE__);
return buf; return buf;
} }

View File

@ -3,7 +3,6 @@
#include "game/game.hpp" #include "game/game.hpp"
#include "scheduler.hpp" #include "scheduler.hpp"
#include "log_file.hpp"
class console final : public module class console final : public module
{ {
@ -15,16 +14,13 @@ public:
(void)_pipe(this->handles_, 1024, _O_TEXT); (void)_pipe(this->handles_, 1024, _O_TEXT);
(void)_dup2(this->handles_[1], 1); (void)_dup2(this->handles_[1], 1);
(void)_dup2(this->handles_[1], 2); (void)_dup2(this->handles_[1], 2);
//setvbuf(stdout, nullptr, _IONBF, 0);
//setvbuf(stderr, nullptr, _IONBF, 0);
} }
void post_start() override void post_start() override
{ {
scheduler::loop(std::bind(&console::log_messages, this), scheduler::pipeline::main); scheduler::loop(std::bind(&log_messages, this), scheduler::pipeline::main);
this->console_runner_ = std::thread(std::bind(&console::runner, this)); this->console_runner_ = std::thread(std::bind(&runner, this));
} }
void pre_destroy() override void pre_destroy() override
@ -86,17 +82,17 @@ private:
static void log_message(const std::string& message) static void log_message(const std::string& message)
{ {
#ifdef _DEBUG
OutputDebugStringA(message.data()); OutputDebugStringA(message.data());
log_file::com_log_print_message(message); #endif
game::native::Conbuf_AppendText(message.data()); game::native::Conbuf_AppendText(message.data());
} }
void runner() void runner()
{ {
char buffer[1024];
while (!this->terminate_runner_ && this->handles_[0]) while (!this->terminate_runner_ && this->handles_[0])
{ {
char buffer[1024];
const auto len = _read(this->handles_[0], buffer, sizeof(buffer)); const auto len = _read(this->handles_[0], buffer, sizeof(buffer));
if (len > 0) if (len > 0)
{ {