Skip to content

Commit

Permalink
Dedicated Server|Unix: Don't use stdout with curses
Browse files Browse the repository at this point in the history
The curses output will get messed up by prints to standard out/err.
  • Loading branch information
skyjake committed Apr 10, 2012
1 parent 71f4caa commit 35d8e9b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions doomsday/engine/unix/src/sys_console.c
Expand Up @@ -263,6 +263,9 @@ Window* Sys_ConInit(const char* title)
{
int maxPos[2];

// Do not output to standard out, curses would get confused.
LogBuffer_EnableStandardOutput(false);

// Initialize curses.
if(!(cursesRootWin = initscr()))
{
Expand Down
5 changes: 5 additions & 0 deletions doomsday/libdeng2/include/de/c_wrapper.h
Expand Up @@ -67,6 +67,11 @@ DENG2_PUBLIC void LegacyCore_PrintLogFragment(LegacyCore* lc, const char* text);
DENG2_PUBLIC void LegacyCore_PrintfLogFragmentAtLevel(LegacyCore* lc, legacycore_loglevel_t level, const char* format, ...);
DENG2_PUBLIC void LegacyCore_FlushLog(void);

/*
* LogBuffer
*/
DENG2_PUBLIC void LogBuffer_EnableStandardOutput(int enable);

/*
* LegacyNetwork
*/
Expand Down
5 changes: 5 additions & 0 deletions doomsday/libdeng2/src/c_wrapper.cpp
Expand Up @@ -137,6 +137,11 @@ void LegacyCore_FlushLog(void)
de::LogBuffer::appBuffer().flush();
}

void LogBuffer_EnableStandardOutput(int enable)
{
de::LogBuffer::appBuffer().enableStandardOutput(enable != 0);
}

int LegacyNetwork_OpenServerSocket(unsigned short port)
{
try
Expand Down

0 comments on commit 35d8e9b

Please sign in to comment.