Macro for native console window
This commit is contained in:
parent
70d2f1fa2f
commit
7cd2cfe8f3
@ -30,7 +30,9 @@ namespace console
|
|||||||
|
|
||||||
if (process == GetCurrentProcessId() || IsDebuggerPresent())
|
if (process == GetCurrentProcessId() || IsDebuggerPresent())
|
||||||
{
|
{
|
||||||
|
#ifndef NATIVE_CONSOLE
|
||||||
ShowWindow(con_window, SW_HIDE);
|
ShowWindow(con_window, SW_HIDE);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -66,12 +68,14 @@ namespace console
|
|||||||
{
|
{
|
||||||
hide_console();
|
hide_console();
|
||||||
|
|
||||||
|
#ifdef NATIVE_CONSOLE
|
||||||
|
setvbuf(stdout, nullptr, _IONBF, 0);
|
||||||
|
setvbuf(stderr, nullptr, _IONBF, 0);
|
||||||
|
#else
|
||||||
(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);
|
||||||
|
#endif
|
||||||
//setvbuf(stdout, nullptr, _IONBF, 0);
|
|
||||||
//setvbuf(stderr, nullptr, _IONBF, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void post_start() override
|
void post_start() override
|
||||||
@ -133,7 +137,9 @@ namespace console
|
|||||||
{
|
{
|
||||||
if (game::environment::is_dedi() || !utils::flags::has_flag("noconsole"))
|
if (game::environment::is_dedi() || !utils::flags::has_flag("noconsole"))
|
||||||
{
|
{
|
||||||
|
#ifndef NATIVE_CONSOLE
|
||||||
game::Sys_ShowConsole();
|
game::Sys_ShowConsole();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!game::environment::is_dedi())
|
if (!game::environment::is_dedi())
|
||||||
|
@ -166,7 +166,6 @@ namespace game
|
|||||||
* Variables
|
* Variables
|
||||||
**************************************************************/
|
**************************************************************/
|
||||||
|
|
||||||
|
|
||||||
WEAK symbol<CmdArgs> sv_cmd_args{0, 0x14946BA20};
|
WEAK symbol<CmdArgs> sv_cmd_args{0, 0x14946BA20};
|
||||||
|
|
||||||
WEAK symbol<const char*> command_whitelist{0x141079A60, 0x14120C360};
|
WEAK symbol<const char*> command_whitelist{0x141079A60, 0x14120C360};
|
||||||
|
Loading…
Reference in New Issue
Block a user