Browse Source

Revert fork's hud_scale behaviour

pull/2/head
Alibek Omarov 7 years ago
parent
commit
a015d6b915
  1. 18
      engine/client/cl_game.c
  2. 3
      engine/client/cl_main.c
  3. 1
      engine/client/client.h

18
engine/client/cl_game.c

@ -1618,24 +1618,16 @@ get actual screen info
*/ */
int CL_GetScreenInfo( SCREENINFO *pscrinfo ) int CL_GetScreenInfo( SCREENINFO *pscrinfo )
{ {
float scale_factor = hud_scale->value;
// setup screen info // setup screen info
clgame.scrInfo.iSize = sizeof( clgame.scrInfo ); clgame.scrInfo.iSize = sizeof( clgame.scrInfo );
clgame.scrInfo.iFlags = SCRINFO_SCREENFLASH; clgame.scrInfo.iFlags = SCRINFO_SCREENFLASH;
if( Cvar_VariableInteger( "hud_scale" )) if( scale_factor && scale_factor != 1.0f)
{ {
if( glState.width < 640 ) clgame.scrInfo.iWidth = (float)glState.width / scale_factor;
{ clgame.scrInfo.iHeight = (float)glState.height / scale_factor;
// virtual screen space 320x200
clgame.scrInfo.iWidth = 320;
clgame.scrInfo.iHeight = 200;
}
else
{
// virtual screen space 640x480
clgame.scrInfo.iWidth = 640;
clgame.scrInfo.iHeight = 480;
}
clgame.scrInfo.iFlags |= SCRINFO_STRETCHED; clgame.scrInfo.iFlags |= SCRINFO_STRETCHED;
} }
else else

3
engine/client/cl_main.c

@ -57,6 +57,7 @@ convar_t *cl_nosmooth;
convar_t *cl_smoothtime; convar_t *cl_smoothtime;
convar_t *cl_clockreset; convar_t *cl_clockreset;
convar_t *cl_fixtimerate; convar_t *cl_fixtimerate;
convar_t *hud_scale;
convar_t *cl_solid_players; convar_t *cl_solid_players;
convar_t *cl_draw_beams; convar_t *cl_draw_beams;
convar_t *cl_updaterate; convar_t *cl_updaterate;
@ -2560,7 +2561,7 @@ void CL_InitLocal( void )
cl_bmodelinterp = Cvar_Get( "cl_bmodelinterp", "1", FCVAR_ARCHIVE, "enable bmodel interpolation" ); cl_bmodelinterp = Cvar_Get( "cl_bmodelinterp", "1", FCVAR_ARCHIVE, "enable bmodel interpolation" );
cl_clockreset = Cvar_Get( "cl_clockreset", "0.1", FCVAR_ARCHIVE, "frametime delta maximum value before reset" ); cl_clockreset = Cvar_Get( "cl_clockreset", "0.1", FCVAR_ARCHIVE, "frametime delta maximum value before reset" );
cl_fixtimerate = Cvar_Get( "cl_fixtimerate", "7.5", FCVAR_ARCHIVE, "time in msec to client clock adjusting" ); cl_fixtimerate = Cvar_Get( "cl_fixtimerate", "7.5", FCVAR_ARCHIVE, "time in msec to client clock adjusting" );
Cvar_Get( "hud_scale", "0", FCVAR_ARCHIVE|FCVAR_LATCH, "scale hud at current resolution" ); hud_scale = Cvar_Get( "hud_scale", "0", FCVAR_ARCHIVE|FCVAR_LATCH, "scale hud at current resolution" );
Cvar_Get( "cl_background", "0", FCVAR_READ_ONLY, "indicate what background map is running" ); Cvar_Get( "cl_background", "0", FCVAR_READ_ONLY, "indicate what background map is running" );
cl_showevents = Cvar_Get( "cl_showevents", "0", FCVAR_ARCHIVE, "show events playback" ); cl_showevents = Cvar_Get( "cl_showevents", "0", FCVAR_ARCHIVE, "show events playback" );

1
engine/client/client.h

@ -695,6 +695,7 @@ extern convar_t *cl_levelshot_name;
extern convar_t *cl_draw_beams; extern convar_t *cl_draw_beams;
extern convar_t *cl_clockreset; extern convar_t *cl_clockreset;
extern convar_t *cl_fixtimerate; extern convar_t *cl_fixtimerate;
extern convar_t *hud_scale;
extern convar_t *gl_showtextures; extern convar_t *gl_showtextures;
extern convar_t *cl_bmodelinterp; extern convar_t *cl_bmodelinterp;
extern convar_t *cl_righthand; extern convar_t *cl_righthand;

Loading…
Cancel
Save