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

Function TrackExitdirToTrackdir

src/track_func.h:461–467  ·  view source on GitHub ↗

* Maps a track and an (4-way) dir to the trackdir that represents the track * with the exit in the given direction. * * For the diagonal tracks the resulting track direction are clear for a given * DiagDirection. It either matches the direction or it returns INVALID_TRACKDIR, * as a TRACK_X cannot be applied with DIAG_SE. * For the straight tracks the resulting track direction will be the *

Source from the content-addressed store, hash-verified

459 * @return The resulting track direction or INVALID_TRACKDIR if not possible.
460 */
461inline Trackdir TrackExitdirToTrackdir(Track track, DiagDirection diagdir)
462{
463 assert(IsValidTrack(track));
464 assert(IsValidDiagDirection(diagdir));
465 extern const Trackdir _track_exitdir_to_trackdir[TRACK_END][DIAGDIR_END];
466 return _track_exitdir_to_trackdir[track][diagdir];
467}
468
469/**
470 * Maps a track and an (4-way) dir to the trackdir that represents the track

Callers

nothing calls this directly

Calls 2

IsValidTrackFunction · 0.85
IsValidDiagDirectionFunction · 0.85

Tested by

no test coverage detected