|
@@ -567,16 +567,16 @@ bool VideoDriver_SDL::PollEvent()
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
const char *VideoDriver_SDL::Start(const StringList &parm)
|
|
|
const char *VideoDriver_SDL::Start(const StringList ¶m)
|
|
|
{
|
|
|
char buf[30];
|
|
|
_use_hwpalette = GetDriverParamInt(parm, "hw_palette", 2);
|
|
|
_use_hwpalette = GetDriverParamInt(param, "hw_palette", 2);
|
|
|
|
|
|
/* Just on the offchance the audio subsystem started before the video system,
|
|
|
* check whether any part of SDL has been initialised before getting here.
|
|
|
* Slightly duplicated with sound/sdl_s.cpp */
|
|
|
int ret_code = 0;
|
|
|
if (SDL_WasInit(SDL_INIT_EVERYTHING) == 0) {
|
|
@@ -596,12 +596,14 @@ const char *VideoDriver_SDL::Start(const
|
|
|
SDL_VideoDriverName(buf, sizeof buf);
|
|
|
DEBUG(driver, 1, "SDL: using driver '%s'", buf);
|
|
|
|
|
|
MarkWholeScreenDirty();
|
|
|
SetupKeyboard();
|
|
|
|
|
|
this->is_game_threaded = !GetDriverParamBool(param, "no_threads") && !GetDriverParamBool(param, "no_thread");
|
|
|
|
|
|
return nullptr;
|
|
|
}
|
|
|
|
|
|
void VideoDriver_SDL::SetupKeyboard()
|
|
|
{
|
|
|
SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
|
|
@@ -644,18 +646,22 @@ void VideoDriver_SDL::InputLoop()
|
|
|
|
|
|
if (old_ctrl_pressed != _ctrl_pressed) HandleCtrlChanged();
|
|
|
}
|
|
|
|
|
|
void VideoDriver_SDL::MainLoop()
|
|
|
{
|
|
|
this->StartGameThread();
|
|
|
|
|
|
for (;;) {
|
|
|
if (_exit_game) break;
|
|
|
|
|
|
this->Tick();
|
|
|
this->SleepTillNextTick();
|
|
|
}
|
|
|
|
|
|
this->StopGameThread();
|
|
|
}
|
|
|
|
|
|
bool VideoDriver_SDL::ChangeResolution(int w, int h)
|
|
|
{
|
|
|
return CreateMainSurface(w, h);
|
|
|
}
|