on Windows, a fatal error will move the early console window to the foreground

This commit is contained in:
myT 2018-01-16 03:02:59 +01:00
parent 511c7ad2cc
commit f5b7c66b5a
3 changed files with 8 additions and 1 deletions

View file

@ -1,6 +1,8 @@
DD Mmm 18 - 1.50
chg: on Windows, a fatal error will move the early console window to the foreground
chg: com_hunkMegs doesn't have a maximum value anymore
a value too high would reset it and the engine might fail to load with the default value

View file

@ -86,7 +86,7 @@ void QDECL Sys_Error( const char *error, ... )
WIN_AppendConsoleText( "\n" );
Sys_SetErrorText( text );
Sys_ShowConsole( 1, qtrue );
Sys_ShowConsole( 3, qtrue );
WIN_EndTimePeriod();

View file

@ -539,6 +539,11 @@ void Sys_ShowConsole( int visLevel, qbool quitOnClose )
case 2:
ShowWindow( s_wcd.hWnd, SW_MINIMIZE );
break;
case 3:
ShowWindow( s_wcd.hWnd, SW_SHOWNORMAL );
SendMessage( s_wcd.hwndBuffer, EM_LINESCROLL, 0, 0xffff );
SetForegroundWindow( s_wcd.hWnd );
break;
default:
Sys_Error( "Invalid visLevel %d sent to Sys_ShowConsole\n", visLevel );
break;