IOQ3 commit 2319

This commit is contained in:
Richard Allen 2012-12-12 19:10:14 +00:00
parent 49b625704c
commit 3494733113
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.width = w;
refdef.height = h; refdef.height = h;
refdef.fov_x = (int)((float)refdef.width / 640.0f * 90.0f); refdef.fov_x = (int)((float)refdef.width / uis.xscale / 640.0f * 90.0f);
xx = refdef.width / tan( refdef.fov_x / 360 * M_PI ); xx = refdef.width / uis.xscale / tan( refdef.fov_x / 360 * M_PI );
refdef.fov_y = atan2( refdef.height, xx ); refdef.fov_y = atan2( refdef.height / uis.yscale, xx );
refdef.fov_y *= ( 360 / M_PI ); refdef.fov_y *= ( 360 / M_PI );
// calculate distance so the player nearly fills the box // calculate distance so the player nearly fills the box

View file

@ -753,13 +753,13 @@ void UI_DrawPlayer(float x, float y, float w, float h, playerInfo_t * pi, int ti
refdef.width = w; refdef.width = w;
refdef.height = h; refdef.height = h;
refdef.fov_x = (int) ((float) refdef.width / 640.0f * 90.0f); refdef.fov_x = (int)((float)refdef.width / uiInfo.uiDC.xscale / 640.0f * 90.0f);
xx = refdef.width / tan(refdef.fov_x / 360 * M_PI); xx = refdef.width / uiInfo.uiDC.xscale / tan( refdef.fov_x / 360 * M_PI );
refdef.fov_y = atan2(refdef.height, xx); refdef.fov_y = atan2( refdef.height / uiInfo.uiDC.yscale, xx );
refdef.fov_y *= (360 / (float) M_PI); refdef.fov_y *= (360 / (float) M_PI);
// calculate distance so the player nearly fills the box // calculate distance so the player nearly fills the box
len = 0.7 * (maxs[2] - mins[2]); len = 0.7 * ( maxs[2] - mins[2] );
origin[0] = len / tan(DEG2RAD(refdef.fov_x) * 0.5); origin[0] = len / tan(DEG2RAD(refdef.fov_x) * 0.5);
origin[1] = 0.5 * (mins[1] + maxs[1]); origin[1] = 0.5 * (mins[1] + maxs[1]);
origin[2] = -0.5 * (mins[2] + maxs[2]); origin[2] = -0.5 * (mins[2] + maxs[2]);