mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-30 08:44:31 +00:00
vid_sdl: fix incorrect video modes list length
This commit is contained in:
parent
4ced29ee8f
commit
216b4f4147
@ -208,7 +208,7 @@ vidmode_t R_GetVideoMode( int num )
|
|||||||
{
|
{
|
||||||
static vidmode_t error = { NULL };
|
static vidmode_t error = { NULL };
|
||||||
|
|
||||||
if( !vidmodes || num < 0 || num > R_MaxVideoModes() )
|
if( !vidmodes || num < 0 || num >= R_MaxVideoModes() )
|
||||||
{
|
{
|
||||||
error.width = glState.width;
|
error.width = glState.width;
|
||||||
error.height = glState.height;
|
error.height = glState.height;
|
||||||
@ -223,6 +223,7 @@ static void R_InitVideoModes( void )
|
|||||||
int displayIndex = 0; // TODO: handle multiple displays somehow
|
int displayIndex = 0; // TODO: handle multiple displays somehow
|
||||||
int i, modes;
|
int i, modes;
|
||||||
|
|
||||||
|
num_vidmodes = 0;
|
||||||
modes = SDL_GetNumDisplayModes( displayIndex );
|
modes = SDL_GetNumDisplayModes( displayIndex );
|
||||||
|
|
||||||
if( !modes )
|
if( !modes )
|
||||||
|
@ -356,7 +356,7 @@ void Wcon_CreateConsole( void )
|
|||||||
{
|
{
|
||||||
s_wcd.SysInputLineWndProc = (WNDPROC)SetWindowLong( s_wcd.hwndInputLine, GWL_WNDPROC, (long)Wcon_InputLineProc );
|
s_wcd.SysInputLineWndProc = (WNDPROC)SetWindowLong( s_wcd.hwndInputLine, GWL_WNDPROC, (long)Wcon_InputLineProc );
|
||||||
SendMessage( s_wcd.hwndInputLine, WM_SETFONT, ( WPARAM )s_wcd.hfBufferFont, 0 );
|
SendMessage( s_wcd.hwndInputLine, WM_SETFONT, ( WPARAM )s_wcd.hfBufferFont, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
// show console if needed
|
// show console if needed
|
||||||
if( host.con_showalways )
|
if( host.con_showalways )
|
||||||
@ -370,7 +370,7 @@ void Wcon_CreateConsole( void )
|
|||||||
SetFocus( s_wcd.hWnd );
|
SetFocus( s_wcd.hWnd );
|
||||||
else SetFocus( s_wcd.hwndInputLine );
|
else SetFocus( s_wcd.hwndInputLine );
|
||||||
s_wcd.status = true;
|
s_wcd.status = true;
|
||||||
}
|
}
|
||||||
else s_wcd.status = false;
|
else s_wcd.status = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user