engine/EngineVideoScreen.c
/*	Must be called whenever vid changes
	Internal use only
*/
Must be called whenever vid changes
Internal use only
Must be called whenever vid changes Internal use only
void Screen_UpdateSize(void)
{
	float size, scale; 
	vid.bRecalcRefDef = false;
	scr_tileclear_updates = 0; 
	if(scr_viewsize.value < 30)
		Cvar_Set("viewsize","30");
	else if(scr_viewsize.value > 120)
		Cvar_Set("viewsize","120");
	if(scr_fov.value < 10)
		Cvar_Set ("fov","10");
	else if(scr_fov.value > 170)
		Cvar_Set ("fov","170");
	 -- rewrote this section
	size = scr_viewsize.value;
	scale = Math_Clamp(1.0, scr_sbarscale.value, (float)glwidth / 320.0);
	if (size >= 120 || cl.intermission || scr_sbaralpha.value < 1)  -- scr_sbaralpha.value
		sb_lines = 0;
	else if (size >= 110)
		sb_lines = 24*scale;
	else
		sb_lines = 48*scale;
	size = Math_Min(scr_viewsize.value,100)/100;
	 -- rewrote this section
	r_refdef.vrect.width = Math_Max(glwidth * size, 96); 
	r_refdef.vrect.height = Math_Min(glheight * size, glheight - sb_lines); 
	r_refdef.vrect.x = (glwidth - r_refdef.vrect.width)/2;
	r_refdef.vrect.y = (glheight - sb_lines - r_refdef.vrect.height)/2;
	r_refdef.fov_x = scr_fov.value;
	r_refdef.fov_y = CalcFovy (r_refdef.fov_x, r_refdef.vrect.width, r_refdef.vrect.height);
	scr_vrect = r_refdef.vrect;
}
void Screen_UpdateSize ( void ) { float size , scale ; vid . bRecalcRefDef = false ; scr_tileclear_updates = 0 ; if ( scr_viewsize . value < 30 ) Cvar_Set ( " " , " " ) ; else if ( scr_viewsize . value > 120 ) Cvar_Set ( " " , " " ) ; if ( scr_fov . value < 10 ) Cvar_Set ( " " , " " ) ; else if ( scr_fov . value > 170 ) Cvar_Set ( " " , " " ) ; size = scr_viewsize . value ; scale = Math_Clamp ( 1.0 , scr_sbarscale . value , ( float ) glwidth / 320.0 ) ; if ( size >= 120 || cl . intermission || scr_sbaralpha . value < 1 ) sb_lines = 0 ; else if ( size >= 110 ) sb_lines = 24 * scale ; else sb_lines = 48 * scale ; size = Math_Min ( scr_viewsize . value , 100 ) / 100 ; r_refdef . vrect . width = Math_Max ( glwidth * size , 96 ) ; r_refdef . vrect . height = Math_Min ( glheight * size , glheight - sb_lines ) ; r_refdef . vrect . x = ( glwidth - r_refdef . vrect . width ) / 2 ; r_refdef . vrect . y = ( glheight - sb_lines - r_refdef . vrect . height ) / 2 ; r_refdef . fov_x = scr_fov . value ; r_refdef . fov_y = CalcFovy ( r_refdef . fov_x , r_refdef . vrect . width , r_refdef . vrect . height ) ; scr_vrect = r_refdef . vrect ; }
Must be called whenever vid changes
Internal use only
Must be called whenever vid changes Internal use only
//johnfitz -- scale //johnfitz // bound viewsize // Bound fov //johnfitz -- rewrote this section //johnfitz -- scr_sbaralpha.value //johnfitz //johnfitz -- rewrote this section //no smaller than 96, for icons //make room for sbar //johnfitz