diff --git a/VERSION b/VERSION index 020680e6..3c832765 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -B2-rc4-7-g5c912e3c27+1 \ No newline at end of file +B2-rc4-8-gf9b6dcc986+1 \ No newline at end of file diff --git a/client/src/config.c b/client/src/config.c index f45fe45c..d12185c2 100644 --- a/client/src/config.c +++ b/client/src/config.c @@ -247,6 +247,13 @@ static struct Option options[] = .type = OPTION_TYPE_INT, .value.x_int = 0, }, + { + .module = "input", + .name = "mouseRedraw", + .description = "Mouse movements trigger redraws (ignores FPS minimum)", + .type = OPTION_TYPE_BOOL, + .value.x_bool = true, + }, // spice options { @@ -399,6 +406,7 @@ bool config_load(int argc, char * argv[]) params.escapeKey = option_get_int ("input", "escapeKey" ); params.hideMouse = option_get_bool ("input", "hideCursor" ); params.mouseSens = option_get_int ("input", "mouseSens" ); + params.mouseRedraw = option_get_bool ("input", "mouseRedraw" ); params.minimizeOnFocusLoss = option_get_bool("win", "minimizeOnFocusLoss"); diff --git a/client/src/main.c b/client/src/main.c index 0436b73d..02bc1db4 100644 --- a/client/src/main.c +++ b/client/src/main.c @@ -358,6 +358,9 @@ static int cursorThread(void * unused) state.cursor.x, state.cursor.y ); + + if (params.mouseRedraw) + lgSignalEvent(e_frame); } lgmpClientUnsubscribe(&queue); @@ -1349,13 +1352,15 @@ static int lg_run() // ensure renderer viewport is aware of the current window size updatePositionInfo(); - // use a default of 60FPS now that frame updates are host update triggered if (params.fpsMin == -1) - state.frameTime = 1e9 / 60; + { + // minimum 60fps to keep interactivity decent + state.frameTime = 1000000000ULL / 60ULL; + } else { DEBUG_INFO("Using the FPS minimum from args: %d", params.fpsMin); - state.frameTime = 1e9 / params.fpsMin; + state.frameTime = 1000000000ULL / (unsigned long long)params.fpsMin; } register_key_binds(); diff --git a/client/src/main.h b/client/src/main.h index c60d26f4..2fd0b56f 100644 --- a/client/src/main.h +++ b/client/src/main.h @@ -160,6 +160,7 @@ struct AppParams const char * windowTitle; int mouseSens; + bool mouseRedraw; }; struct CBRequest