]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - vid_glx.c
added cl_avidemo cvar (saves a series of tga images named gamedir/dpavi000000.tga...
[xonotic/darkplaces.git] / vid_glx.c
index 3735592e734189133b9620dec6aa3838c879fb67..878429ce15a30a558de177054aae68693ad90a72 100644 (file)
--- a/vid_glx.c
+++ b/vid_glx.c
@@ -55,12 +55,10 @@ static qboolean             mouse_avail = true;
 static qboolean                mouse_active = false, usingmouse = false;
 // static qboolean             dga_active;
 static float   mouse_x, mouse_y;
-static float   old_mouse_x, old_mouse_y;
 static int p_mouse_x, p_mouse_y;
 
 cvar_t vid_dga = {CVAR_SAVE, "vid_dga", "1"};
 cvar_t vid_dga_mouseaccel = {0, "vid_dga_mouseaccel", "1"};
-cvar_t m_filter = {0, "m_filter", "0"};
 
 qboolean vidmode_ext = false;
 
@@ -78,8 +76,6 @@ static Colormap vidx11_colormap;
 
 /*-----------------------------------------------------------------------*/
 
-float          gldepthmin, gldepthmax;
-
 const char *gl_vendor;
 const char *gl_renderer;
 const char *gl_version;
@@ -478,27 +474,24 @@ void InitSig(void)
 
 /*
 =================
-GL_BeginRendering
-
+VID_GetWindowSize
 =================
 */
-void GL_BeginRendering (int *x, int *y, int *width, int *height)
+void VID_GetWindowSize (int *x, int *y, int *width, int *height)
 {
        *x = *y = 0;
        *width = scr_width;
        *height = scr_height;
-
-//     glViewport (*x, *y, *width, *height);
 }
 
-
-void GL_EndRendering (void)
+void VID_Finish (void)
 {
        int usemouse;
-       if (!r_render.integer)
-               return;
-       glFlush();
-       glXSwapBuffers(vidx11_display, win);
+       if (r_render.integer)
+       {
+               glFinish();
+               glXSwapBuffers(vidx11_display, win);
+       }
 
 // handle the mouse state when windowed if that's changed
        usemouse = false;
@@ -636,10 +629,8 @@ void VID_Init(void)
        qboolean fullscreen = true;
        int MajorVersion, MinorVersion;
 
-       Cvar_RegisterVariable (&vid_mouse);
        Cvar_RegisterVariable (&vid_dga);
        Cvar_RegisterVariable (&vid_dga_mouseaccel);
-       Cvar_RegisterVariable (&m_filter);
 
 // interpret command-line params
 
@@ -834,54 +825,12 @@ void IN_Commands (void)
 {
 }
 
-/*
-===========
-IN_Move
-===========
-*/
-void IN_MouseMove (usercmd_t *cmd)
-{
-       if (!mouse_avail)
-               return;
-
-       if (m_filter.integer)
-       {
-               mouse_x = (mouse_x + old_mouse_x) * 0.5;
-               mouse_y = (mouse_y + old_mouse_y) * 0.5;
-
-               old_mouse_x = mouse_x;
-               old_mouse_y = mouse_y;
-       }
-
-       mouse_x *= sensitivity.value;
-       mouse_y *= sensitivity.value;
-
-       if (in_strafe.state & 1)
-               cmd->sidemove += m_side.value * mouse_x;
-       else
-               cl.viewangles[YAW] -= m_yaw.value * mouse_x;
-
-       //if (freelook)
-               V_StopPitchDrift ();
-
-       if (/*freelook && */!(in_strafe.state & 1))
-       {
-               cl.viewangles[PITCH] += m_pitch.value * mouse_y;
-               cl.viewangles[PITCH] = bound (-90, cl.viewangles[PITCH], 90);
-       }
-       else
-       {
-               if ((in_strafe.state & 1) && noclip_anglehack)
-                       cmd->upmove -= m_forward.value * mouse_y;
-               else
-                       cmd->forwardmove -= m_forward.value * mouse_y;
-       }
-       mouse_x = mouse_y = 0.0;
-}
-
 void IN_Move (usercmd_t *cmd)
 {
-       IN_MouseMove(cmd);
+       if (mouse_avail)
+               IN_Mouse(cmd, mouse_x, mouse_y);
+       mouse_x = 0;
+       mouse_y = 0;
 }