From a4c21ebdccc0b27f7f001cad7f7695f13d0bf288 Mon Sep 17 00:00:00 2001 From: tmyqlfpir <80724828+tmyqlfpir@users.noreply.github.com> Date: Mon, 9 Oct 2023 13:57:01 +1000 Subject: [PATCH] Blood: Expose KMT option for vsync (#764) --- source/blood/src/menu.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/source/blood/src/menu.cpp b/source/blood/src/menu.cpp index bf576e88e9..9137504a4d 100644 --- a/source/blood/src/menu.cpp +++ b/source/blood/src/menu.cpp @@ -476,13 +476,19 @@ const int nRendererValues[] = { const char *pzVSyncStrings[] = { "ADAPTIVE", "OFF", - "ON" + "ON", +#if defined USE_OPENGL && defined _WIN32 && defined RENDERTYPESDL + "KMT" +#endif }; const int nVSyncValues[] = { -1, 0, - 1 + 1, +#if defined USE_OPENGL && defined _WIN32 && defined RENDERTYPESDL + 2 +#endif }; const char *pzFrameLimitStrings[] = { @@ -514,7 +520,7 @@ CGameMenuItemTitle itemOptionsDisplayModeTitle("VIDEO MODE", 1, 160, 20, 2038); CGameMenuItemZCycle itemOptionsDisplayModeResolution("RESOLUTION:", 3, 66, 60, 180, 0, NULL, NULL, 0, 0, true); CGameMenuItemZCycle itemOptionsDisplayModeRenderer("RENDERER:", 3, 66, 70, 180, 0, NULL, pzRendererStrings, 2, 0); CGameMenuItemZBool itemOptionsDisplayModeFullscreen("FULLSCREEN:", 3, 66, 80, 180, 0, NULL, NULL, NULL); -CGameMenuItemZCycle itemOptionsDisplayModeVSync("VSYNC:", 3, 66, 90, 180, 0, NULL, pzVSyncStrings, 3, 0); +CGameMenuItemZCycle itemOptionsDisplayModeVSync("VSYNC:", 3, 66, 90, 180, 0, NULL, pzVSyncStrings, ARRAY_SSIZE(pzVSyncStrings), 0); CGameMenuItemZCycle itemOptionsDisplayModeFrameLimit("FRAMERATE LIMIT:", 3, 66, 100, 180, 0, UpdateVideoModeMenuFrameLimit, pzFrameLimitStrings, 8, 0); // CGameMenuItemSlider itemOptionsDisplayModeFPSOffset("FPS OFFSET:", 3, 66, 110, 180, 0, -10, 10, 1, UpdateVideoModeMenuFPSOffset, -1, -1, kMenuSliderValue); CGameMenuItemChain itemOptionsDisplayModeApply("APPLY CHANGES", 3, 66, 125, 180, 0, NULL, 0, SetVideoMode, 0); @@ -1885,7 +1891,7 @@ void SetupVideoModeMenu(CGameMenuItemChain *pItem) } } #endif - for (int i = 0; i < 3; i++) + for (int i = 0; i < itemOptionsDisplayModeVSync.m_nItems; i++) { if (vsync == nVSyncValues[i]) {