Merge 1.7.0-RC1

This commit is contained in:
Pavel Stupnikov
2017-04-09 22:34:33 +03:00
262 changed files with 4673 additions and 3860 deletions
+11 -17
View File
@@ -1,4 +1,4 @@
/* $Id: sdl_v.cpp 27167 2015-02-22 23:06:45Z frosch $ */
/* $Id: sdl_v.cpp 27775 2017-03-11 13:05:54Z frosch $ */
/*
* This file is part of OpenTTD.
@@ -404,19 +404,6 @@ bool VideoDriver_SDL::CreateMainSurface(uint w, uint h)
blitter->PostResize();
InitPalette();
switch (blitter->UsePaletteAnimation()) {
case Blitter::PALETTE_ANIMATION_NONE:
case Blitter::PALETTE_ANIMATION_VIDEO_BACKEND:
UpdatePalette();
break;
case Blitter::PALETTE_ANIMATION_BLITTER:
if (VideoDriver::GetInstance() != NULL) blitter->PaletteAnimate(_local_palette);
break;
default:
NOT_REACHED();
}
seprintf(caption, lastof(caption), "OpenTTD %s", _openttd_revision);
SDL_CALL SDL_WM_SetCaption(caption, caption);
@@ -695,7 +682,7 @@ void VideoDriver_SDL::MainLoop()
_draw_mutex->BeginCritical();
_draw_continue = true;
_draw_threaded = ThreadObject::New(&DrawSurfaceToScreenThread, NULL, &_draw_thread);
_draw_threaded = ThreadObject::New(&DrawSurfaceToScreenThread, NULL, &_draw_thread, "ottd:draw-sdl");
/* Free the mutex if we won't be able to use it. */
if (!_draw_threaded) {
@@ -839,11 +826,18 @@ bool VideoDriver_SDL::ToggleFullscreen(bool fullscreen)
}
bool VideoDriver_SDL::AfterBlitterChange()
{
return CreateMainSurface(_screen.width, _screen.height);
}
void VideoDriver_SDL::AcquireBlitterLock()
{
if (_draw_mutex != NULL) _draw_mutex->BeginCritical(true);
bool ret = CreateMainSurface(_screen.width, _screen.height);
}
void VideoDriver_SDL::ReleaseBlitterLock()
{
if (_draw_mutex != NULL) _draw_mutex->EndCritical(true);
return ret;
}
#endif /* WITH_SDL */