mirror of
https://github.com/DrBeef/ioq3quest.git
synced 2024-11-10 23:02:01 +00:00
Combine mouse movement events in event queue
Fixes 'Com_QueueEvent: overflow' spam after hitch / map load. Based on patch by @ec-.
This commit is contained in:
parent
e793c0c37c
commit
be1c71d363
1 changed files with 13 additions and 0 deletions
|
@ -1961,6 +1961,19 @@ void Com_QueueEvent( int time, sysEventType_t type, int value, int value2, int p
|
||||||
{
|
{
|
||||||
sysEvent_t *ev;
|
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 ];
|
ev = &eventQueue[ eventHead & MASK_QUEUED_EVENTS ];
|
||||||
|
|
||||||
if ( eventHead - eventTail >= MAX_QUEUED_EVENTS )
|
if ( eventHead - eventTail >= MAX_QUEUED_EVENTS )
|
||||||
|
|
Loading…
Reference in a new issue