From 69288462ca18535a88ecb3a901b8d5cc22999ffd Mon Sep 17 00:00:00 2001 From: Magnus Olsen Date: Sun, 1 Jan 2006 14:40:24 +0000 Subject: [PATCH] optimize hide curs lite. so it does not tryung update the underlying surface hold time. and do not save the underlying surface in show when it is hide. all these save alot of cycles and winquake are bit faster. svn path=/trunk/; revision=20514 --- reactos/lib/dinput/mouse.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/reactos/lib/dinput/mouse.c b/reactos/lib/dinput/mouse.c index f89dff072e7..1966b0f12cd 100644 --- a/reactos/lib/dinput/mouse.c +++ b/reactos/lib/dinput/mouse.c @@ -423,6 +423,7 @@ static LRESULT CALLBACK dinput_mouse_hook( int code, WPARAM wparam, LPARAM lpara DWORD dwCoop; static long last_event = 0; int wdata; + long lasttime = 0; if (code != HC_ACTION) return CallNextHookEx( This->hook, code, wparam, lparam ); @@ -434,10 +435,19 @@ static LRESULT CALLBACK dinput_mouse_hook( int code, WPARAM wparam, LPARAM lpara * the warps happen. But if it involves a mouse button event we * allow it since we don't want to lose the clicks. */ +#ifndef __REACTOS__ if (((GetCurrentTime() - last_event) < 10) && wparam == WM_MOUSEMOVE) goto end; else last_event = GetCurrentTime(); +#else + lasttime = GetCurrentTime() - last_event; + + if ((lasttime) < 1) + goto end; + else if ((lasttime) >= 10) + last_event = GetCurrentTime(); +#endif /* Mouse moved -> send event if asked */ if (This->hEvent)