Codechange: [Video] make the prototype of PollEvent() the same for all drivers
Additionally, call it from the draw-tick.
This commit is contained in:

committed by
Patric Stout

parent
70e4845915
commit
c409f45ddd
@@ -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()) {
|
||||
|
Reference in New Issue
Block a user