]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix v_flipped in cs_unproject (it was correct in cs_project) if a view port is set up
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 17 Jul 2009 07:56:01 +0000 (07:56 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 17 Jul 2009 07:56:01 +0000 (07:56 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9061 d7cf8633-e32d-0410-b094-e92efae38249

clvm_cmds.c

index ccef8d5ee0502e4559031e8cdfe8ff7ecf032702..f0c55629862328bc3782c5d8bdeee22d02c4c383 100644 (file)
@@ -940,7 +940,7 @@ static void VM_CL_unproject (void)
        VM_SAFEPARMCOUNT(1, VM_CL_unproject);
        f = PRVM_G_VECTOR(OFS_PARM0);
        if(v_flipped.integer)
-               f[0] = r_refdef.view.x + r_refdef.view.width - f[0];
+               f[0] = 2 * r_refdef.view.x + r_refdef.view.width - f[0];
        VectorSet(temp, f[2], (-1.0 + 2.0 * (f[0] - r_refdef.view.x) / r_refdef.view.width) * f[2] * -r_refdef.view.frustum_x, (-1.0 + 2.0 * (f[1] - r_refdef.view.y) / r_refdef.view.height) * f[2] * -r_refdef.view.frustum_y);
        Matrix4x4_Transform(&r_refdef.view.matrix, temp, PRVM_G_VECTOR(OFS_RETURN));
 }