diff --git a/engine/platform/sdl/vid_sdl.c b/engine/platform/sdl/vid_sdl.c index 50209717..ca335f6b 100644 --- a/engine/platform/sdl/vid_sdl.c +++ b/engine/platform/sdl/vid_sdl.c @@ -208,7 +208,7 @@ vidmode_t R_GetVideoMode( int num ) { static vidmode_t error = { NULL }; - if( !vidmodes || num < 0 || num > R_MaxVideoModes() ) + if( !vidmodes || num < 0 || num >= R_MaxVideoModes() ) { error.width = glState.width; error.height = glState.height; @@ -223,6 +223,7 @@ static void R_InitVideoModes( void ) int displayIndex = 0; // TODO: handle multiple displays somehow int i, modes; + num_vidmodes = 0; modes = SDL_GetNumDisplayModes( displayIndex ); if( !modes ) diff --git a/engine/platform/win32/win_con.c b/engine/platform/win32/win_con.c index 8725a720..087c7e5b 100644 --- a/engine/platform/win32/win_con.c +++ b/engine/platform/win32/win_con.c @@ -356,7 +356,7 @@ void Wcon_CreateConsole( void ) { s_wcd.SysInputLineWndProc = (WNDPROC)SetWindowLong( s_wcd.hwndInputLine, GWL_WNDPROC, (long)Wcon_InputLineProc ); SendMessage( s_wcd.hwndInputLine, WM_SETFONT, ( WPARAM )s_wcd.hfBufferFont, 0 ); - } + } // show console if needed if( host.con_showalways ) @@ -370,7 +370,7 @@ void Wcon_CreateConsole( void ) SetFocus( s_wcd.hWnd ); else SetFocus( s_wcd.hwndInputLine ); s_wcd.status = true; - } + } else s_wcd.status = false; }