]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - vid_glx.c
darkplaces now compiles in mingw
[xonotic/darkplaces.git] / vid_glx.c
index 035e70141b507348c051e102aec917bb1e8962a4..5fa9867b6ec74b5c0ee2dcf8019a0e8f8e363f88 100644 (file)
--- a/vid_glx.c
+++ b/vid_glx.c
@@ -478,27 +478,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;
@@ -852,8 +849,9 @@ void IN_MouseMove (usercmd_t *cmd)
                old_mouse_y = mouse_y;
        }
 
-       mouse_x *= sensitivity.value;
-       mouse_y *= sensitivity.value;
+       // LordHavoc: viewzoom affects mouse sensitivity for sniping
+       mouse_x *= sensitivity.value * cl.viewzoom;
+       mouse_y *= sensitivity.value * cl.viewzoom;
 
        if (in_strafe.state & 1)
                cmd->sidemove += m_side.value * mouse_x;
@@ -864,10 +862,7 @@ void IN_MouseMove (usercmd_t *cmd)
                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)
@@ -881,6 +876,7 @@ void IN_MouseMove (usercmd_t *cmd)
 void IN_Move (usercmd_t *cmd)
 {
        IN_MouseMove(cmd);
+       cl.viewangles[PITCH] = bound (in_pitch_min.value, cl.viewangles[PITCH], in_pitch_max.value);
 }