Fix UI player model FOV when using non-640x480 resolution.

This commit is contained in:
Zack Middleton 2012-09-30 02:56:50 +00:00
parent 2cb7f25093
commit 11811e8138
2 changed files with 7 additions and 7 deletions

View File

@ -736,9 +736,9 @@ void UI_DrawPlayer( float x, float y, float w, float h, playerInfo_t *pi, int ti
refdef.width = w;
refdef.height = h;
refdef.fov_x = (int)((float)refdef.width / 640.0f * 90.0f);
xx = refdef.width / tan( refdef.fov_x / 360 * M_PI );
refdef.fov_y = atan2( refdef.height, xx );
refdef.fov_x = (int)((float)refdef.width / uis.xscale / 640.0f * 90.0f);
xx = refdef.width / uis.xscale / tan( refdef.fov_x / 360 * M_PI );
refdef.fov_y = atan2( refdef.height / uis.yscale, xx );
refdef.fov_y *= ( 360 / M_PI );
// calculate distance so the player nearly fills the box

View File

@ -742,9 +742,9 @@ void UI_DrawPlayer( float x, float y, float w, float h, playerInfo_t *pi, int ti
refdef.width = w;
refdef.height = h;
refdef.fov_x = (int)((float)refdef.width / 640.0f * 90.0f);
xx = refdef.width / tan( refdef.fov_x / 360 * M_PI );
refdef.fov_y = atan2( refdef.height, xx );
refdef.fov_x = (int)((float)refdef.width / uiInfo.uiDC.xscale / 640.0f * 90.0f);
xx = refdef.width / uiInfo.uiDC.xscale / tan( refdef.fov_x / 360 * M_PI );
refdef.fov_y = atan2( refdef.height / uiInfo.uiDC.yscale, xx );
refdef.fov_y *= ( 360 / (float)M_PI );
// calculate distance so the player nearly fills the box