update 60fps patch

This commit is contained in:
fgsfds 2020-07-08 13:31:34 +03:00
parent d7187b219c
commit 2dc93701a2
1 changed files with 11 additions and 11 deletions

View File

@ -1890,10 +1890,19 @@ index 0467495..fa4eb33 100644
using namespace Microsoft::WRL; // For ComPtr
diff --git a/src/pc/gfx/gfx_sdl2.c b/src/pc/gfx/gfx_sdl2.c
index a39b76d..3fb1bb1 100644
index aef2978..ff53b27 100644
--- a/src/pc/gfx/gfx_sdl2.c
+++ b/src/pc/gfx/gfx_sdl2.c
@@ -141,7 +141,7 @@ static inline void gfx_sdl_set_vsync(int mode) {
@@ -53,7 +53,7 @@ static void (*kb_all_keys_up)(void) = NULL;
// whether to use timer for frame control
static bool use_timer = true;
// time between consequtive game frames
-static const Uint32 frame_time = 1000 / FRAMERATE;
+static const Uint32 frame_time = 1000 / (2 * FRAMERATE);
static Uint32 frame_start = 0;
const SDL_Scancode windows_scancode_table[] = {
@@ -142,7 +142,7 @@ static inline void gfx_sdl_set_vsync(int mode) {
if (mode > 1) {
// try to detect refresh rate
SDL_GL_SetSwapInterval(1);
@ -1902,15 +1911,6 @@ index a39b76d..3fb1bb1 100644
if (vblanks) {
printf("determined swap interval: %d\n", vblanks);
SDL_GL_SetSwapInterval(vblanks);
@@ -225,7 +225,7 @@ static void gfx_sdl_init(const char *window_title) {
gfx_sdl_set_fullscreen();
qpc_freq = SDL_GetPerformanceFrequency();
- frame_time = qpc_freq / FRAMERATE;
+ frame_time = qpc_freq / (2 * FRAMERATE);
for (size_t i = 0; i < sizeof(windows_scancode_table) / sizeof(SDL_Scancode); i++) {
inverted_scancode_table[windows_scancode_table[i]] = i;
diff --git a/src/pc/pc_main.c b/src/pc/pc_main.c
index ed6ee74..63679ad 100644
--- a/src/pc/pc_main.c