Custom events are thread safe
This commit is contained in:
parent
518ecf2a8f
commit
5a0086c4ea
3 changed files with 19 additions and 23 deletions
18
src/main.cpp
18
src/main.cpp
|
|
@ -761,18 +761,12 @@ SDL_AppResult SDL_AppEvent(void *appstate, SDL_Event *event) {
|
|||
case SDL_EVENT_SCREEN_KEYBOARD_HIDDEN:
|
||||
break;
|
||||
default: {
|
||||
if(event->type == CustomEvents::PasteEvent::EVENT_NUM) {
|
||||
mS.m->input_paste_callback(CustomEvents::get_event<CustomEvents::PasteEvent>());
|
||||
CustomEvents::pop_event();
|
||||
}
|
||||
else if(event->type == CustomEvents::OpenInfiniPaintFileEvent::EVENT_NUM) {
|
||||
mS.m->input_open_infinipaint_file_callback(CustomEvents::get_event<CustomEvents::OpenInfiniPaintFileEvent>());
|
||||
CustomEvents::pop_event();
|
||||
}
|
||||
else if(event->type == CustomEvents::AddFileToCanvasEvent::EVENT_NUM) {
|
||||
mS.m->input_add_file_to_canvas_callback(CustomEvents::get_event<CustomEvents::AddFileToCanvasEvent>());
|
||||
CustomEvents::pop_event();
|
||||
}
|
||||
if(event->type == CustomEvents::PasteEvent::EVENT_NUM)
|
||||
mS.m->input_paste_callback(*CustomEvents::get_event<CustomEvents::PasteEvent>());
|
||||
else if(event->type == CustomEvents::OpenInfiniPaintFileEvent::EVENT_NUM)
|
||||
mS.m->input_open_infinipaint_file_callback(*CustomEvents::get_event<CustomEvents::OpenInfiniPaintFileEvent>());
|
||||
else if(event->type == CustomEvents::AddFileToCanvasEvent::EVENT_NUM)
|
||||
mS.m->input_add_file_to_canvas_callback(*CustomEvents::get_event<CustomEvents::AddFileToCanvasEvent>());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue