MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / OnTick_LinkGraph

Function OnTick_LinkGraph

src/linkgraph/linkgraphschedule.cpp:202–217  ·  view source on GitHub ↗

* Spawn or join a link graph job or compress a link graph if any link graph is * due to do so. */

Source from the content-addressed store, hash-verified

200 * due to do so.
201 */
202void OnTick_LinkGraph()
203{
204 if (TimerGameEconomy::date_fract != LinkGraphSchedule::SPAWN_JOIN_TICK) return;
205 TimerGameEconomy::Date offset{TimerGameEconomy::date.base() % (_settings_game.linkgraph.recalc_interval / EconomyTime::SECONDS_PER_DAY)};
206 if (offset == 0) {
207 LinkGraphSchedule::instance.SpawnNext();
208 } else if (offset == (_settings_game.linkgraph.recalc_interval / EconomyTime::SECONDS_PER_DAY) / 2) {
209 if (!_networking || _network_server) {
210 PerformanceMeasurer::SetInactive(PFE_GL_LINKGRAPH);
211 LinkGraphSchedule::instance.JoinNext();
212 } else {
213 PerformanceMeasurer framerate(PFE_GL_LINKGRAPH);
214 LinkGraphSchedule::instance.JoinNext();
215 }
216 }
217}
218
219

Callers 1

CallLandscapeTickFunction · 0.85

Calls 3

SpawnNextMethod · 0.80
JoinNextMethod · 0.80
baseMethod · 0.45

Tested by

no test coverage detected