mirror of
https://github.com/vanilla-wiiu/vanilla.git
synced 2025-01-22 08:11:47 -05:00
optimization: only copy actual data to frontend
This commit is contained in:
parent
5f86ab1498
commit
410b002d99
1 changed files with 6 additions and 1 deletions
|
@ -327,7 +327,12 @@ int get_event(event_loop_t *loop, vanilla_event_t *event, int wait)
|
||||||
|
|
||||||
if (loop->active && loop->used_index < loop->new_index) {
|
if (loop->active && loop->used_index < loop->new_index) {
|
||||||
// Output data to pointer
|
// Output data to pointer
|
||||||
*event = loop->events[loop->used_index % VANILLA_MAX_EVENT_COUNT];
|
vanilla_event_t *pull_event = &loop->events[loop->used_index % VANILLA_MAX_EVENT_COUNT];
|
||||||
|
|
||||||
|
event->type = pull_event->type;
|
||||||
|
memcpy(event->data, pull_event->data, pull_event->size);
|
||||||
|
event->size = pull_event->size;
|
||||||
|
|
||||||
loop->used_index++;
|
loop->used_index++;
|
||||||
ret = 1;
|
ret = 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue