Skip to content

Commit

Permalink
Ports: Disable GetPerformanceTimer() for OpenTTD
Browse files Browse the repository at this point in the history
OpenTTD calls gettimeofday() so many times per second that the
game becomes unusable after joining a reasonably active network
game.
  • Loading branch information
gunnarbeutner authored and linusg committed May 1, 2021
1 parent f6aad70 commit 03f4c48
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Ports/openttd/patches/perf-timer.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff -Naur openttd-1.11.0/src/framerate_gui.cpp openttd-1.11.0.serenity/src/framerate_gui.cpp
--- openttd-1.11.0/src/framerate_gui.cpp 2021-04-29 23:45:25.247427868 +0200
+++ openttd-1.11.0.serenity/src/framerate_gui.cpp 2021-04-29 23:41:57.679926623 +0200
@@ -222,8 +222,9 @@
*/
static TimingMeasurement GetPerformanceTimer()
{
- using namespace std::chrono;
- return (TimingMeasurement)time_point_cast<microseconds>(high_resolution_clock::now()).time_since_epoch().count();
+ //using namespace std::chrono;
+ //return (TimingMeasurement)time_point_cast<microseconds>(high_resolution_clock::now()).time_since_epoch().count();
+ return 0;
}


0 comments on commit 03f4c48

Please sign in to comment.