From 51463d5b5889120b856daf143c19ee024bd6f405 Mon Sep 17 00:00:00 2001 From: havoc Date: Thu, 2 Oct 2008 09:43:52 +0000 Subject: [PATCH] fix setview VF_VIEWPORT and variants to use screen coords rather than draw coords, this matches FTEQW git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8518 d7cf8633-e32d-0410-b094-e92efae38249 --- clvm_cmds.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/clvm_cmds.c b/clvm_cmds.c index cc48e814..d9fc74bf 100644 --- a/clvm_cmds.c +++ b/clvm_cmds.c @@ -753,31 +753,31 @@ void VM_CL_R_SetView (void) switch(c) { case VF_MIN: - r_refdef.view.x = (int)(f[0] * vid.width / vid_conwidth.value); - r_refdef.view.y = (int)(f[1] * vid.height / vid_conheight.value); + r_refdef.view.x = (int)(f[0]); + r_refdef.view.y = (int)(f[1]); break; case VF_MIN_X: - r_refdef.view.x = (int)(k * vid.width / vid_conwidth.value); + r_refdef.view.x = (int)(k); break; case VF_MIN_Y: - r_refdef.view.y = (int)(k * vid.height / vid_conheight.value); + r_refdef.view.y = (int)(k); break; case VF_SIZE: - r_refdef.view.width = (int)(f[0] * vid.width / vid_conwidth.value); - r_refdef.view.height = (int)(f[1] * vid.height / vid_conheight.value); + r_refdef.view.width = (int)(f[0]); + r_refdef.view.height = (int)(f[1]); break; case VF_SIZE_X: - r_refdef.view.width = (int)(k * vid.width / vid_conwidth.value); + r_refdef.view.width = (int)(k); break; case VF_SIZE_Y: - r_refdef.view.height = (int)(k * vid.height / vid_conheight.value); + r_refdef.view.height = (int)(k); break; case VF_VIEWPORT: - r_refdef.view.x = (int)(f[0] * vid.width / vid_conwidth.value); - r_refdef.view.y = (int)(f[1] * vid.height / vid_conheight.value); + r_refdef.view.x = (int)(f[0]); + r_refdef.view.y = (int)(f[1]); f = PRVM_G_VECTOR(OFS_PARM2); - r_refdef.view.width = (int)(f[0] * vid.width / vid_conwidth.value); - r_refdef.view.height = (int)(f[1] * vid.height / vid_conheight.value); + r_refdef.view.width = (int)(f[0]); + r_refdef.view.height = (int)(f[1]); break; case VF_FOV: r_refdef.view.frustum_x = tan(f[0] * M_PI / 360.0);r_refdef.view.ortho_x = f[0]; -- 2.39.2