Fix VSync renderer workaround

SDL just got an API to toggle VSync without having to tear down the
renderer ( libsdl-org/SDL#4157 ). We can remove the workaround and use
that instead. For now, we are putting it behind an ifdef until SDL
2.0.18 officially releases in November.

Fixes #831.
This commit is contained in:
Misa
2021-09-14 20:23:22 -07:00
parent 8d0a90a588
commit 6ba7058a0e
4 changed files with 14 additions and 49 deletions

View File

@@ -605,11 +605,12 @@ static void menuactionpress(void)
game.savestatsandsettings_menu();
break;
case 5:
/* FIXME: Upgrade to SDL 2.0.18 and remove this ifdef when it releases! */
#if SDL_VERSION_ATLEAST(2, 0, 17)
//toggle vsync
music.playef(11);
#ifndef __HAIKU__ // FIXME: Remove after SDL VSync bug is fixed! -flibit
graphics.screenbuffer->vsync = !graphics.screenbuffer->vsync;
graphics.screenbuffer->resetRendererWorkaround();
graphics.screenbuffer->toggleVSync();
game.savestatsandsettings_menu();
#endif
break;