From 03f4c48de12ab101d6942b73c6afa696f1224dcc Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Thu, 29 Apr 2021 23:45:51 +0200 Subject: [PATCH] Ports: Disable GetPerformanceTimer() for OpenTTD OpenTTD calls gettimeofday() so many times per second that the game becomes unusable after joining a reasonably active network game. --- Ports/openttd/patches/perf-timer.patch | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Ports/openttd/patches/perf-timer.patch diff --git a/Ports/openttd/patches/perf-timer.patch b/Ports/openttd/patches/perf-timer.patch new file mode 100644 index 00000000000..fb8535e21ca --- /dev/null +++ b/Ports/openttd/patches/perf-timer.patch @@ -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(high_resolution_clock::now()).time_since_epoch().count(); ++ //using namespace std::chrono; ++ //return (TimingMeasurement)time_point_cast(high_resolution_clock::now()).time_since_epoch().count(); ++ return 0; + } + +