diff --git a/Minecraft.Client/Common/Consoles_App.cpp b/Minecraft.Client/Common/Consoles_App.cpp index 2f13c680..331d5d37 100644 --- a/Minecraft.Client/Common/Consoles_App.cpp +++ b/Minecraft.Client/Common/Consoles_App.cpp @@ -1657,6 +1657,7 @@ void CMinecraftApp::ActionGameSettings(int iPad,eGameSetting eVal) pMinecraft->options->set(Options::Option::GRAPHICS, true); pMinecraft->options->set(Options::Option::MIPMAPS_BLEND, false); pMinecraft->options->set(Options::Option::AMBIENT_OCCLUSION, true); + RenderManager.DisableVsync(); pMinecraft->options->set(Options::Option::PARTICLES, 0); pMinecraft->textures->reloadAll(); } @@ -1665,6 +1666,7 @@ void CMinecraftApp::ActionGameSettings(int iPad,eGameSetting eVal) pMinecraft->options->set(Options::Option::GRAPHICS, true); pMinecraft->options->set(Options::Option::MIPMAPS_BLEND, true); pMinecraft->options->set(Options::Option::AMBIENT_OCCLUSION, true); + RenderManager.EnableVsync(); pMinecraft->options->set(Options::Option::PARTICLES, 0); pMinecraft->textures->reloadAll(); } diff --git a/Minecraft.Client/Windows64/Libs/4JLibs/inc/4J_Render.h b/Minecraft.Client/Windows64/Libs/4JLibs/inc/4J_Render.h index 20c9382a..f5424a4e 100644 --- a/Minecraft.Client/Windows64/Libs/4JLibs/inc/4J_Render.h +++ b/Minecraft.Client/Windows64/Libs/4JLibs/inc/4J_Render.h @@ -230,6 +230,11 @@ public: // ashlyn add const char* GetScreenshotPath(); + + // GabsPuN add + void EnableVsync(); + void DisableVsync(); + bool GetVsync(); }; constexpr int GL_MODELVIEW_MATRIX = 0; diff --git a/Minecraft.Client/Windows64/Libs/4JLibs/libs/4J_Input_d.lib b/Minecraft.Client/Windows64/Libs/4JLibs/libs/4J_Input_d.lib index 31974c2a..44f00880 100644 Binary files a/Minecraft.Client/Windows64/Libs/4JLibs/libs/4J_Input_d.lib and b/Minecraft.Client/Windows64/Libs/4JLibs/libs/4J_Input_d.lib differ diff --git a/Minecraft.Client/Windows64/Libs/4JLibs/libs/4J_Profile_d.lib b/Minecraft.Client/Windows64/Libs/4JLibs/libs/4J_Profile_d.lib index 1029d55e..3260d91b 100644 Binary files a/Minecraft.Client/Windows64/Libs/4JLibs/libs/4J_Profile_d.lib and b/Minecraft.Client/Windows64/Libs/4JLibs/libs/4J_Profile_d.lib differ diff --git a/Minecraft.Client/Windows64/Libs/4JLibs/libs/4J_Render_PC_d.lib b/Minecraft.Client/Windows64/Libs/4JLibs/libs/4J_Render_PC_d.lib index 044f88d9..4708f159 100644 Binary files a/Minecraft.Client/Windows64/Libs/4JLibs/libs/4J_Render_PC_d.lib and b/Minecraft.Client/Windows64/Libs/4JLibs/libs/4J_Render_PC_d.lib differ diff --git a/Minecraft.Client/Windows64/Libs/4JLibs/libs/4J_Storage_d.lib b/Minecraft.Client/Windows64/Libs/4JLibs/libs/4J_Storage_d.lib index 20c98bc8..6b497e89 100644 Binary files a/Minecraft.Client/Windows64/Libs/4JLibs/libs/4J_Storage_d.lib and b/Minecraft.Client/Windows64/Libs/4JLibs/libs/4J_Storage_d.lib differ diff --git a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp index e4f68272..69535c06 100644 --- a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp +++ b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp @@ -661,7 +661,9 @@ HRESULT InitDevice() sd.SampleDesc.Count = 1; sd.SampleDesc.Quality = 0; sd.SwapEffect = DXGI_SWAP_EFFECT_FLIP_DISCARD; - sd.Flags = DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING; + + if (!RenderManager.GetVsync()) + sd.Flags = DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING; IDXGISwapChain1* pNewSwapChain = nullptr; hr = dxgiFactory->CreateSwapChainForHwnd(g_pd3dDevice, g_hWnd, &sd, nullptr, nullptr, &pNewSwapChain); @@ -733,7 +735,11 @@ void Render() g_pImmediateContext->ClearRenderTargetView( g_pRenderTargetView, ClearColor ); g_pImmediateContext->Flush(); - g_pSwapChain->Present( 0, DXGI_PRESENT_ALLOW_TEARING ); + + if (RenderManager.GetVsync()) + g_pSwapChain->Present( 1, 0 ); + else + g_pSwapChain->Present( 0, DXGI_PRESENT_ALLOW_TEARING ); } //-------------------------------------------------------------------------------------- @@ -839,7 +845,9 @@ static bool ResizeD3D(int newW, int newH) sd.SampleDesc.Count = 1; sd.SampleDesc.Quality = 0; sd.SwapEffect = DXGI_SWAP_EFFECT_FLIP_DISCARD; - sd.Flags = DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING; + + if (!RenderManager.GetVsync()) + sd.Flags = DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING; IDXGISwapChain1* pNewSwapChain = nullptr; hr = dxgiFactory->CreateSwapChainForHwnd(g_pd3dDevice, g_hWnd, &sd, nullptr, nullptr, &pNewSwapChain);