MCPcopy Create free account
hub / github.com/ZDoom/Raze / D_ProcessEvents

Function D_ProcessEvents

source/common/engine/d_event.cpp:67–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65//==========================================================================
66
67void D_ProcessEvents (void)
68{
69 FixedBitArray<NUM_KEYS> keywasdown;
70 TArray<event_t*> delayedevents;
71
72 keywasdown.Zero();
73 while (eventtail != eventhead)
74 {
75 event_t *ev = &events[eventtail];
76 eventtail = (eventtail + 1) & (MAXEVENTS - 1);
77
78 if (ev->type == EV_KeyUp && keywasdown[ev->data1])
79 {
80 delayedevents.Push(ev);
81 continue;
82 }
83
84 if (ev->type == EV_None)
85 continue;
86 if (ev->type == EV_DeviceChange)
87 UpdateJoystickMenu(I_UpdateDeviceList());
88
89 // allow the game to intercept Escape before dispatching it.
90 if (ev->type != EV_KeyDown || ev->data1 != KEY_ESCAPE || !sysCallbacks.WantEscape || !sysCallbacks.WantEscape())
91 {
92 if (gamestate != GS_INTRO) // GS_INTRO blocks the UI.
93 {
94 if (C_Responder(ev))
95 continue; // console ate the event
96 if (M_Responder(ev))
97 continue; // menu ate the event
98 }
99 }
100
101 if (sysCallbacks.G_Responder(ev) && ev->type == EV_KeyDown) keywasdown.Set(ev->data1);
102 }
103
104 for (auto ev: delayedevents)
105 {
106 D_PostEvent(ev);
107 }
108}
109
110//==========================================================================
111//

Callers 1

NetUpdateFunction · 0.85

Calls 9

UpdateJoystickMenuFunction · 0.85
C_ResponderFunction · 0.85
M_ResponderFunction · 0.85
D_PostEventFunction · 0.85
I_UpdateDeviceListFunction · 0.50
ZeroMethod · 0.45
PushMethod · 0.45
WantEscapeMethod · 0.45
SetMethod · 0.45

Tested by

no test coverage detected