mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-06 14:27:16 +00:00
(svn r6421) -Revert r6420: The dedicated server's console actually needs to work. It misses half the input at the moment. Sorry, too hasty commit.
This commit is contained in:
parent
67e9294b22
commit
87761ab2d9
11
win32.c
11
win32.c
@ -786,26 +786,15 @@ static int ParseCommandLine(char *line, char **argv, int max_argc)
|
|||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef ATTACH_PARENT_PROCESS
|
|
||||||
#define ATTACH_PARENT_PROCESS ((DWORD)-1)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void CreateConsole(void)
|
void CreateConsole(void)
|
||||||
{
|
{
|
||||||
HANDLE hand;
|
HANDLE hand;
|
||||||
CONSOLE_SCREEN_BUFFER_INFO coninfo;
|
CONSOLE_SCREEN_BUFFER_INFO coninfo;
|
||||||
BOOL (WINAPI *AttachConsole)(DWORD);
|
|
||||||
|
|
||||||
if (_has_console) return;
|
if (_has_console) return;
|
||||||
|
|
||||||
_has_console = true;
|
_has_console = true;
|
||||||
|
|
||||||
/* Attach to an existing console if one exists. Unfortunately this function
|
|
||||||
* only exists on WindowsXP or higher, so for all other users out there:
|
|
||||||
* you're stuck with an additional console even if you started openttd from
|
|
||||||
* the command line */
|
|
||||||
if (!LoadLibraryList((Function*)&AttachConsole, "kernel32.dll\0AttachConsole\0") ||
|
|
||||||
!AttachConsole(ATTACH_PARENT_PROCESS))
|
|
||||||
AllocConsole();
|
AllocConsole();
|
||||||
|
|
||||||
hand = GetStdHandle(STD_OUTPUT_HANDLE);
|
hand = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||||
|
Loading…
Reference in New Issue
Block a user