Fix crash caused by a resize event during the loading screen
The window event handling under SDL2 was incorrectly relying on SDL_event.window.type for sub-events for SDL_WINDOWEVENT. This resulted in the if-statements supposed to catch certain window-events to always evaluate to false, causing the code to never run.
This commit is contained in:
parent
55f7b28720
commit
94b93a8fa3
1 changed files with 3 additions and 3 deletions
|
@ -210,12 +210,12 @@ void loadscreen::draw_screen(const std::string &text)
|
|||
while(SDL_PollEvent(&ev)) {
|
||||
#if SDL_VERSION_ATLEAST(2,0,0)
|
||||
if (ev.type == SDL_WINDOWEVENT &&
|
||||
ev.window.type == SDL_WINDOWEVENT_RESIZED) {
|
||||
ev.window.event == SDL_WINDOWEVENT_RESIZED) {
|
||||
display::get_singleton()->video().update_framebuffer();
|
||||
}
|
||||
if (ev.type == SDL_WINDOWEVENT &&
|
||||
(ev.window.type == SDL_WINDOWEVENT_RESIZED ||
|
||||
ev.window.type == SDL_WINDOWEVENT_EXPOSED))
|
||||
(ev.window.event == SDL_WINDOWEVENT_RESIZED ||
|
||||
ev.window.event == SDL_WINDOWEVENT_EXPOSED))
|
||||
#else
|
||||
if(ev.type == SDL_VIDEORESIZE || ev.type == SDL_VIDEOEXPOSE)
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue