[ioquake3] 10/34: Combine mouse movement events in event queue

Simon McVittie smcv at debian.org
Fri Sep 8 10:33:19 UTC 2017


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to annotated tag debian/1.36+u20170908+dfsg1-1
in repository ioquake3.

commit be1c71d36306637490348a128ecc2245b909c5da
Author: Zack Middleton <zack at cloemail.com>
Date:   Mon Aug 21 19:48:44 2017 -0500

    Combine mouse movement events in event queue
    
    Fixes 'Com_QueueEvent: overflow' spam after hitch / map load.
    
    Based on patch by @ec-.
---
 code/qcommon/common.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/code/qcommon/common.c b/code/qcommon/common.c
index 5d64d68..0359a30 100644
--- a/code/qcommon/common.c
+++ b/code/qcommon/common.c
@@ -1961,6 +1961,19 @@ void Com_QueueEvent( int time, sysEventType_t type, int value, int value2, int p
 {
 	sysEvent_t  *ev;
 
+	// combine mouse movement with previous mouse event
+	if ( type == SE_MOUSE && eventHead != eventTail )
+	{
+		ev = &eventQueue[ ( eventHead + MAX_QUEUED_EVENTS - 1 ) & MASK_QUEUED_EVENTS ];
+
+		if ( ev->evType == SE_MOUSE )
+		{
+			ev->evValue += value;
+			ev->evValue2 += value2;
+			return;
+		}
+	}
+
 	ev = &eventQueue[ eventHead & MASK_QUEUED_EVENTS ];
 
 	if ( eventHead - eventTail >= MAX_QUEUED_EVENTS )

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/ioquake3.git



More information about the Pkg-games-commits mailing list