summaryrefslogtreecommitdiff
path: root/src/video/sdl_v.cpp
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2021-02-24 14:45:10 +0100
committerPatric Stout <github@truebrain.nl>2021-02-24 21:58:47 +0100
commitc409f45ddd12bbd399dcda4a33043ce261da4dc4 (patch)
tree78d378284cd09d6faf6679c3471c89f64a46bf7b /src/video/sdl_v.cpp
parent70e484591579640b05727e189cfe70ba7d2b4e51 (diff)
downloadopenttd-c409f45ddd12bbd399dcda4a33043ce261da4dc4.tar.xz
Codechange: [Video] make the prototype of PollEvent() the same for all drivers
Additionally, call it from the draw-tick.
Diffstat (limited to 'src/video/sdl_v.cpp')
-rw-r--r--src/video/sdl_v.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/video/sdl_v.cpp b/src/video/sdl_v.cpp
index 12a663e3b..f21b1e9fd 100644
--- a/src/video/sdl_v.cpp
+++ b/src/video/sdl_v.cpp
@@ -507,11 +507,11 @@ static uint ConvertSdlKeyIntoMy(SDL_keysym *sym, WChar *character)
return key;
}
-int VideoDriver_SDL::PollEvent()
+bool VideoDriver_SDL::PollEvent()
{
SDL_Event ev;
- if (!SDL_PollEvent(&ev)) return -2;
+ if (!SDL_PollEvent(&ev)) return false;
switch (ev.type) {
case SDL_MOUSEMOTION:
@@ -598,7 +598,8 @@ int VideoDriver_SDL::PollEvent()
break;
}
}
- return -1;
+
+ return true;
}
const char *VideoDriver_SDL::Start(const StringList &parm)
@@ -719,7 +720,6 @@ void VideoDriver_SDL::MainLoop()
for (;;) {
InteractiveRandom(); // randomness
- while (PollEvent() == -1) {}
if (_exit_game) break;
if (this->Tick()) {