Skip to content

Conversation

@samr46
Copy link
Contributor

@samr46 samr46 commented Mar 8, 2025

This small PR is aimed to provide smoother experience for high refresh monitors in main menu when player is not connected.
Current limit is below 88 and not stable because of how frame rate limiting is designed.

I had to change Sleep function call behavior to make frame limit work properly in main menu.
Sleep(1) freezes thread for at least 15ms (instead of 1) on average because of default timer resolution in Windows (64 times per second). And since thread isn't busy in main menu it prevented setting high refresh rate. So I changed Sleep call spare time from 2ms to 10ms (in my case 4ms was enough during testing but I decided to go with 10ms).

This also fixes bug with unlimited FPS if deathmatch mod is loaded when not connected (i.e. opening "host game" window).

@Dutchman101 Dutchman101 requested a review from botder March 8, 2025 23:35
@botder botder merged commit acbcc8e into multitheftauto:master Mar 8, 2025
6 checks passed
@botder botder added this to the 1.6.1 milestone Mar 8, 2025
@botder botder added the enhancement New feature or request label Mar 8, 2025
MTABot pushed a commit that referenced this pull request Mar 8, 2025
acbcc8e Set main menu FPS limit to current display refresh rate (PR #4083)
6bb19ac Update client en_US pot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants