mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-08 01:10:28 +00:00
(svn r9085) -Codechange/Fix: [win32] Move the initialisation of _codepage (non-UNICODE) to winMain as a dedicated server, or different video driver will not have a win32 messageloop.
This commit is contained in:
parent
6f36db349f
commit
8007fb38d4
@ -214,9 +214,6 @@ static LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
|
||||
switch (msg) {
|
||||
case WM_CREATE:
|
||||
SetTimer(hwnd, TID_POLLMOUSE, MOUSE_POLL_DELAY, (TIMERPROC)TrackMouseTimerProc);
|
||||
#if !defined(UNICODE)
|
||||
_codepage = GetACP(); // get system codepage as some kind of a default
|
||||
#endif /* UNICODE */
|
||||
break;
|
||||
|
||||
case WM_PAINT: {
|
||||
|
@ -884,12 +884,16 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
|
||||
char *argv[64]; // max 64 command line arguments
|
||||
char *cmdline;
|
||||
|
||||
#if !defined(UNICODE)
|
||||
_codepage = GetACP(); // get system codepage as some kind of a default
|
||||
#endif /* UNICODE */
|
||||
|
||||
#if defined(UNICODE)
|
||||
/* For UNICODE we need to convert the commandline to char* _AND_
|
||||
* save it because argv[] points into this buffer and thus needs to
|
||||
* be available between subsequent calls to FS2OTTD() */
|
||||
char cmdlinebuf[MAX_PATH];
|
||||
#endif
|
||||
#endif /* UNICODE */
|
||||
|
||||
cmdline = WIDE_TO_MB_BUFFER(GetCommandLine(), cmdlinebuf, lengthof(cmdlinebuf));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user