From 55a815643b9c493d44689157ba8161fd37bfbc62 Mon Sep 17 00:00:00 2001 From: TheBrokenRail Date: Wed, 16 Mar 2022 19:49:13 -0400 Subject: [PATCH] Add "Disable V-Sync" Feature Flag --- .../lib/minecraft-pi-reborn-client/available-feature-flags | 1 + mods/src/misc/misc.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/launcher/client-data/lib/minecraft-pi-reborn-client/available-feature-flags b/launcher/client-data/lib/minecraft-pi-reborn-client/available-feature-flags index e75d4561..d15781fe 100644 --- a/launcher/client-data/lib/minecraft-pi-reborn-client/available-feature-flags +++ b/launcher/client-data/lib/minecraft-pi-reborn-client/available-feature-flags @@ -33,3 +33,4 @@ FALSE Disable Raw Mouse Motion (Not Recommended) TRUE Fix Furnace Not Checking Item Auxiliary FALSE Disable Hosting LAN Worlds TRUE Improved Cursor Rendering +FALSE Disable V-Sync diff --git a/mods/src/misc/misc.c b/mods/src/misc/misc.c index 858e49c5..ac76d804 100644 --- a/mods/src/misc/misc.c +++ b/mods/src/misc/misc.c @@ -6,7 +6,9 @@ #include #include + #include +#include #include "../init/init.h" #include "../feature/feature.h" @@ -245,6 +247,11 @@ void init_misc() { overwrite_calls((void *) GameRenderer_render, (void *) GameRenderer_render_injection); } + // Disable V-Sync + if (feature_has("Disable V-Sync", 0)) { + media_disable_vsync(); + } + // Init C++ And Logging _init_misc_cpp(); _init_misc_logging();