[patch] Improve window drag

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Post Reply
User avatar
ZehMatt
Engineer
Engineer
Posts: 1
Joined: 26 Jan 2018 19:25

[patch] Improve window drag

Post by ZehMatt »

Hi everyone,

I'm new here and started to play OpenTTD and noticed some minor issue. The window drag didn't feel smooth so I decided to look into it. I've done something like this on OpenRCT2 before where GetTickCount's resolution simply isn't precise enough.

So I've basically replaced the GetTickCount function with an alternative where we get 1ms resolution, this ensures the game also runs at exactly 33 ticks. I also moved the window update out of the game logic loop so it will get redrawn every iteration.

Heres also a comparison video:
Before: https://share.epic-domain.com/2018-01-26%2020-19-23.mp4
After: https://share.epic-domain.com/2018-01-26%2020-09-14.mp4

Edit: I shall mention that GetHPFLocalTime is planned for another patch I know that it is currently unreferenced.
Attachments
windowdrag.patch
(6.04 KiB) Downloaded 132 times
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Google [Bot] and 11 guests