- case VF_MIN: r_view.x = (int)(f[0] * vid.width / vid_conwidth.value);
- r_view.y = (int)(f[1] * vid.height / vid_conheight.value);
- break;
- case VF_MIN_X: r_view.x = (int)(k * vid.width / vid_conwidth.value);
- break;
- case VF_MIN_Y: r_view.y = (int)(k * vid.height / vid_conheight.value);
- break;
- case VF_SIZE: r_view.width = (int)(f[0] * vid.width / vid_conwidth.value);
- r_view.height = (int)(f[1] * vid.height / vid_conheight.value);
- break;
- case VF_SIZE_Y: r_view.width = (int)(k * vid.width / vid_conwidth.value);
- break;
- case VF_SIZE_X: r_view.height = (int)(k * vid.height / vid_conheight.value);
- break;
- case VF_VIEWPORT: r_view.x = (int)(f[0] * vid.width / vid_conwidth.value);
- r_view.y = (int)(f[1] * vid.height / vid_conheight.value);
- f = PRVM_G_VECTOR(OFS_PARM2);
- r_view.width = (int)(f[0] * vid.width / vid_conwidth.value);
- r_view.height = (int)(f[1] * vid.height / vid_conheight.value);
- break;
- case VF_FOV: r_view.frustum_x = tan(f[0] * M_PI / 360.0);r_view.ortho_x = f[0];
- r_view.frustum_y = tan(f[1] * M_PI / 360.0);r_view.ortho_y = f[1];
- break;
- case VF_FOVX: r_view.frustum_x = tan(k * M_PI / 360.0);r_view.ortho_x = k;
- break;
- case VF_FOVY: r_view.frustum_y = tan(k * M_PI / 360.0);r_view.ortho_y = k;
- break;
- case VF_ORIGIN: VectorCopy(f, cl.csqc_origin);
- CSQC_R_RecalcView();
- break;
- case VF_ORIGIN_X: cl.csqc_origin[0] = k;
- CSQC_R_RecalcView();
- break;
- case VF_ORIGIN_Y: cl.csqc_origin[1] = k;
- CSQC_R_RecalcView();
- break;
- case VF_ORIGIN_Z: cl.csqc_origin[2] = k;
- CSQC_R_RecalcView();
- break;
- case VF_ANGLES: VectorCopy(f, cl.csqc_angles);
- CSQC_R_RecalcView();
- break;
- case VF_ANGLES_X: cl.csqc_angles[0] = k;
- CSQC_R_RecalcView();
- break;
- case VF_ANGLES_Y: cl.csqc_angles[1] = k;
- CSQC_R_RecalcView();
- break;
- case VF_ANGLES_Z: cl.csqc_angles[2] = k;
- CSQC_R_RecalcView();
- break;
- case VF_DRAWWORLD: cl.csqc_vidvars.drawworld = k;
- break;
- case VF_DRAWENGINESBAR: cl.csqc_vidvars.drawenginesbar = k;
- break;
- case VF_DRAWCROSSHAIR: cl.csqc_vidvars.drawcrosshair = k;
- break;
-
- case VF_CL_VIEWANGLES: VectorCopy(f, cl.viewangles);
- break;
- case VF_CL_VIEWANGLES_X:cl.viewangles[0] = k;
- break;
- case VF_CL_VIEWANGLES_Y:cl.viewangles[1] = k;
- break;
- case VF_CL_VIEWANGLES_Z:cl.viewangles[2] = k;
- break;
-
- case VF_PERSPECTIVE: r_view.useperspective = k != 0;
- break;
-
- default: PRVM_G_FLOAT(OFS_RETURN) = 0;
- VM_Warning("VM_CL_R_SetView : unknown parm %i\n", c);
- return;
+ 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);
+ break;
+ case VF_MIN_X:
+ r_refdef.view.x = (int)(k * vid.width / vid_conwidth.value);
+ break;
+ case VF_MIN_Y:
+ r_refdef.view.y = (int)(k * vid.height / vid_conheight.value);
+ 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);
+ break;
+ case VF_SIZE_Y:
+ r_refdef.view.width = (int)(k * vid.width / vid_conwidth.value);
+ break;
+ case VF_SIZE_X:
+ r_refdef.view.height = (int)(k * vid.height / vid_conheight.value);
+ 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);
+ 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);
+ break;
+ case VF_FOV:
+ r_refdef.view.frustum_x = tan(f[0] * M_PI / 360.0);r_refdef.view.ortho_x = f[0];
+ r_refdef.view.frustum_y = tan(f[1] * M_PI / 360.0);r_refdef.view.ortho_y = f[1];
+ break;
+ case VF_FOVX:
+ r_refdef.view.frustum_x = tan(k * M_PI / 360.0);r_refdef.view.ortho_x = k;
+ break;
+ case VF_FOVY:
+ r_refdef.view.frustum_y = tan(k * M_PI / 360.0);r_refdef.view.ortho_y = k;
+ break;
+ case VF_ORIGIN:
+ VectorCopy(f, cl.csqc_origin);
+ CSQC_R_RecalcView();
+ break;
+ case VF_ORIGIN_X:
+ cl.csqc_origin[0] = k;
+ CSQC_R_RecalcView();
+ break;
+ case VF_ORIGIN_Y:
+ cl.csqc_origin[1] = k;
+ CSQC_R_RecalcView();
+ break;
+ case VF_ORIGIN_Z:
+ cl.csqc_origin[2] = k;
+ CSQC_R_RecalcView();
+ break;
+ case VF_ANGLES:
+ VectorCopy(f, cl.csqc_angles);
+ CSQC_R_RecalcView();
+ break;
+ case VF_ANGLES_X:
+ cl.csqc_angles[0] = k;
+ CSQC_R_RecalcView();
+ break;
+ case VF_ANGLES_Y:
+ cl.csqc_angles[1] = k;
+ CSQC_R_RecalcView();
+ break;
+ case VF_ANGLES_Z:
+ cl.csqc_angles[2] = k;
+ CSQC_R_RecalcView();
+ break;
+ case VF_DRAWWORLD:
+ cl.csqc_vidvars.drawworld = k;
+ break;
+ case VF_DRAWENGINESBAR:
+ cl.csqc_vidvars.drawenginesbar = k;
+ break;
+ case VF_DRAWCROSSHAIR:
+ cl.csqc_vidvars.drawcrosshair = k;
+ break;
+ case VF_CL_VIEWANGLES:
+ VectorCopy(f, cl.viewangles);
+ break;
+ case VF_CL_VIEWANGLES_X:
+ cl.viewangles[0] = k;
+ break;
+ case VF_CL_VIEWANGLES_Y:
+ cl.viewangles[1] = k;
+ break;
+ case VF_CL_VIEWANGLES_Z:
+ cl.viewangles[2] = k;
+ break;
+ case VF_PERSPECTIVE:
+ r_refdef.view.useperspective = k != 0;
+ break;
+ case VF_CLEARSCREEN:
+ r_refdef.view.clear = k ? true : false;
+ break;
+ default:
+ PRVM_G_FLOAT(OFS_RETURN) = 0;
+ VM_Warning("VM_CL_R_SetView : unknown parm %i\n", c);
+ return;