Changeset - r28621:60ceb3bdd74c
[Not reviewed]
master
0 1 0
frosch - 10 months ago 2024-01-30 21:30:17
frosch@openttd.org
Codechange: replace a macro with a lambda.
1 file changed with 3 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/rail_cmd.cpp
Show inline comments
 
@@ -2387,7 +2387,9 @@ static void DrawTrackBits(TileInfo *ti, 
 

	
 
static void DrawSignals(TileIndex tile, TrackBits rails, const RailTypeInfo *rti)
 
{
 
#define MAYBE_DRAW_SIGNAL(x, y, z, t) if (IsSignalPresent(tile, x)) DrawSingleSignal(tile, rti, t, GetSingleSignalState(tile, x), y, z)
 
	auto MAYBE_DRAW_SIGNAL = [&](byte signalbit, SignalOffsets image, uint pos, Track track) {
 
		if (IsSignalPresent(tile, signalbit)) DrawSingleSignal(tile, rti, track, GetSingleSignalState(tile, signalbit), image, pos);
 
	};
 

	
 
	if (!(rails & TRACK_BIT_Y)) {
 
		if (!(rails & TRACK_BIT_X)) {
0 comments (0 inline, 0 general)