]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - vid_wgl.c
fixed 'slow gravity' bug when cl_movement players are not replying to all server...
[xonotic/darkplaces.git] / vid_wgl.c
index 1b05d59d007b7cfbd19fa02d8644d7a125c0e6db..3c5614d69b0faaa56dd2789c3252a126c3d32e92 100644 (file)
--- a/vid_wgl.c
+++ b/vid_wgl.c
@@ -30,8 +30,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include <commctrl.h>
 #include <dinput.h>
 
-extern void S_BlockSound (void);
-extern void S_UnblockSound (void);
 extern HINSTANCE global_hInstance;
 
 
@@ -275,7 +273,7 @@ void VID_Finish (qboolean allowmousegrab)
 
 // handle the mouse state when windowed if that's changed
        vid_usemouse = false;
-       if (allowmousegrab && vid_mouse.integer && !key_consoleactive && !cls.demoplayback)
+       if (allowmousegrab && vid_mouse.integer && !key_consoleactive && (key_dest != key_game || !cls.demoplayback))
                vid_usemouse = true;
        if (vid_isfullscreen)
                vid_usemouse = true;
@@ -285,10 +283,15 @@ void VID_Finish (qboolean allowmousegrab)
 
        if (r_render.integer && !vid_hidden)
        {
+               CHECKGLERROR
                if (r_speeds.integer || gl_finish.integer)
-                       qglFinish();
+               {
+                       qglFinish();CHECKGLERROR
+               }
                SwapBuffers(baseDC);
        }
+
+       VID_UpdateGamma(false, 256);
 }
 
 //==========================================================================
@@ -409,7 +412,7 @@ void AppActivate(BOOL fActive, BOOL minimize)
 *
 ****************************************************************************/
 {
-       static BOOL     sound_active;
+       static qboolean sound_active = false;  // initially blocked by Sys_InitConsole()
 
        vid_activewindow = fActive;
        vid_hidden = minimize;
@@ -647,7 +650,7 @@ LONG WINAPI MainWndProc (HWND hWnd, UINT uMsg, WPARAM  wParam, LPARAM lParam)
        return lRet;
 }
 
-int VID_SetGamma(unsigned short *ramps)
+int VID_SetGamma(unsigned short *ramps, int rampsize)
 {
        HDC hdc = GetDC (NULL);
        int i = SetDeviceGammaRamp(hdc, ramps);
@@ -655,7 +658,7 @@ int VID_SetGamma(unsigned short *ramps)
        return i; // return success or failure
 }
 
-int VID_GetGamma(unsigned short *ramps)
+int VID_GetGamma(unsigned short *ramps, int rampsize)
 {
        HDC hdc = GetDC (NULL);
        int i = GetDeviceGammaRamp(hdc, ramps);
@@ -1623,7 +1626,7 @@ static void IN_JoyMove (void)
        else
                speed = 1;
        // LordHavoc: viewzoom affects sensitivity for sniping
-       aspeed = speed * host_realframetime * cl.viewzoom;
+       aspeed = speed * cl.realframetime * cl.viewzoom;
 
        // loop through the axes
        for (i = 0; i < JOY_MAX_AXES; i++)