mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-17 18:40:02 +00:00
engine: client: fool proof R_SaveVideoMode
This commit is contained in:
parent
a6475f530b
commit
6232e288e1
@ -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…
x
Reference in New Issue
Block a user