cvar_t cl_nodelta = {0, "cl_nodelta", "0", "disables delta compression of non-player entities in QW network protocol"};
+extern cvar_t v_flipped;
/*
================
// clamp before the move to prevent starting with bad angles
CL_AdjustAngles ();
+ if(v_flipped.integer)
+ cl.viewangles[YAW] = -cl.viewangles[YAW];
+
// reset some of the command fields
cl.cmd.forwardmove = 0;
cl.cmd.sidemove = 0;
}
}
+ if(v_flipped.integer)
+ {
+ cl.viewangles[YAW] = -cl.viewangles[YAW];
+ cl.cmd.sidemove = -cl.cmd.sidemove;
+ }
+
// clamp after the move to prevent rendering with bad angles
CL_AdjustAngles ();
}
// calculate current view matrix
Matrix4x4_OriginFromMatrix(&r_view.matrix, cl.cmd.cursor_start);
// calculate direction vector of cursor in viewspace by using frustum slopes
- VectorSet(temp, cl.cmd.cursor_screen[2] * 1000000, cl.cmd.cursor_screen[0] * -r_view.frustum_x * 1000000, cl.cmd.cursor_screen[1] * -r_view.frustum_y * 1000000);
+ VectorSet(temp, cl.cmd.cursor_screen[2] * 1000000, (v_flipped.integer ? -1 : 1) * cl.cmd.cursor_screen[0] * -r_view.frustum_x * 1000000, cl.cmd.cursor_screen[1] * -r_view.frustum_y * 1000000);
Matrix4x4_Transform(&r_view.matrix, temp, cl.cmd.cursor_end);
// trace from view origin to the cursor
cl.cmd.cursor_fraction = CL_SelectTraceLine(cl.cmd.cursor_start, cl.cmd.cursor_end, cl.cmd.cursor_impact, cl.cmd.cursor_normal, &cl.cmd.cursor_entitynumber, (chase_active.integer || cl.intermission) ? &cl.entities[cl.playerentity].render : NULL);
cvar_t gl_lockarrays_minimumvertices = {0, "gl_lockarrays_minimumvertices", "1", "minimum number of vertices required for use of glLockArraysEXT, setting this too low may reduce performance"};
cvar_t gl_vbo = {0, "gl_vbo", "1", "make use of GL_ARB_vertex_buffer_object extension to store static geometry in video memory for faster rendering"};
+cvar_t v_flipped = {0, "v_flipped", "0", "mirror the screen (poor man's left handed mode"};
+qboolean v_flipped_state = false;
+
int gl_maxdrawrangeelementsvertices;
int gl_maxdrawrangeelementsindices;
Cvar_RegisterVariable(&r_render);
Cvar_RegisterVariable(&r_waterwarp);
Cvar_RegisterVariable(&gl_polyblend);
+ Cvar_RegisterVariable(&v_flipped);
Cvar_RegisterVariable(&gl_dither);
Cvar_RegisterVariable(&gl_lockarrays);
Cvar_RegisterVariable(&gl_lockarrays_minimumvertices);
void GL_SetupView_Orientation_Identity (void)
{
backend_viewmatrix = identitymatrix;
+ v_flipped_state = false;
memset(&backend_modelmatrix, 0, sizeof(backend_modelmatrix));
}
Matrix4x4_CreateRotate(&basematrix, -90, 1, 0, 0);
Matrix4x4_ConcatRotate(&basematrix, 90, 0, 0, 1);
Matrix4x4_Concat(&backend_viewmatrix, &basematrix, &tempmatrix);
+
+ v_flipped_state = v_flipped.integer;
+ if(v_flipped_state)
+ {
+ Matrix4x4_Transpose(&basematrix, &backend_viewmatrix);
+ Matrix4x4_ConcatScale3(&basematrix, -1, 1, 1);
+ Matrix4x4_Transpose(&backend_viewmatrix, &basematrix);
+ }
+
//Matrix4x4_ConcatRotate(&backend_viewmatrix, -angles[2], 1, 0, 0);
//Matrix4x4_ConcatRotate(&backend_viewmatrix, -angles[0], 0, 1, 0);
//Matrix4x4_ConcatRotate(&backend_viewmatrix, -angles[1], 0, 0, 1);
void GL_CullFace(int state)
{
CHECKGLERROR
+
+ if(v_flipped_state)
+ {
+ if(state == GL_FRONT)
+ state = GL_BACK;
+ else if(state == GL_BACK)
+ state = GL_FRONT;
+ }
+
if (state != GL_NONE)
{
if (!gl_state.cullfaceenable)