mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 06:42:12 +00:00
- minor optimization to last PR to use a FixedBitArray to reduce stack impact of the check array.
This commit is contained in:
parent
b1fea228be
commit
4530a7b583
1 changed files with 3 additions and 2 deletions
|
@ -67,9 +67,10 @@ CVAR(Bool, m_filter, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
|
|||
|
||||
void D_ProcessEvents (void)
|
||||
{
|
||||
bool keywasdown[NUM_KEYS] = { false };
|
||||
FixedBitArray<NUM_KEYS> keywasdown;
|
||||
TArray<event_t> delayedevents;
|
||||
|
||||
keywasdown.Zero();
|
||||
while (eventtail != eventhead)
|
||||
{
|
||||
event_t *ev = &events[eventtail];
|
||||
|
@ -94,7 +95,7 @@ void D_ProcessEvents (void)
|
|||
continue; // menu ate the event
|
||||
}
|
||||
|
||||
keywasdown[ev->data1] = G_Responder(ev) && ev->type == EV_KeyDown;
|
||||
if (G_Responder(ev) && ev->type == EV_KeyDown) keywasdown.Set(ev->data1);
|
||||
}
|
||||
|
||||
for (auto& ev: delayedevents)
|
||||
|
|
Loading…
Reference in a new issue