Browse Source

engine: client: fool proof R_SaveVideoMode

pull/2/head
Alibek Omarov 2 years ago
parent
commit
6232e288e1
  1. 12
      engine/client/vid_common.c

12
engine/client/vid_common.c

@ -66,19 +66,25 @@ void VID_InitDefaultResolution( void )
R_SaveVideoMode R_SaveVideoMode
================= =================
*/ */
void R_SaveVideoMode( int w, int h , int render_w, int render_h ) void R_SaveVideoMode( int w, int h, int render_w, int render_h )
{ {
host.renderinfo_changed = false;
if( !w || !h || !render_w || !render_h )
return;
host.window_center_x = w / 2; host.window_center_x = w / 2;
host.window_center_y = h / 2; host.window_center_y = h / 2;
Cvar_SetValue( "width", w ); Cvar_SetValue( "width", w );
Cvar_SetValue( "height", h ); Cvar_SetValue( "height", h );
if( refState.width == render_w && refState.height == render_h )
return;
refState.width = render_w; refState.width = render_w;
refState.height = render_h; refState.height = render_h;
host.renderinfo_changed = false;
// check for 4:3 or 5:4 // check for 4:3 or 5:4
if( render_w * 3 != render_h * 4 && render_w * 4 != render_h * 5 ) if( render_w * 3 != render_h * 4 && render_w * 4 != render_h * 5 )
refState.wideScreen = true; refState.wideScreen = true;

Loading…
Cancel
Save