Changeset - r2182:c25721cf181e
[Not reviewed]
master
0 3 0
tron - 19 years ago 2005-07-23 19:48:24
tron@openttd.org
(svn r2696) Remove stray semicolons
3 files changed with 17 insertions and 17 deletions:
npf.c
2
2
pbs.c
14
14
0 comments (0 inline, 0 general)
npf.c
Show inline comments
 
@@ -67,13 +67,13 @@ bool IsEndOfLine(TileIndex tile, Trackdi
 
				// if one way signal not pointing towards us, stop going in this direction.
 
				return true;
 
		}
 

	
 
		return false;
 
	}
 
};
 
}
 

	
 
#if 0
 
static uint NTPHash(uint key1, uint key2)
 
{
 
	/* This function uses the old hash, which is fixed on 10 bits (1024 buckets) */
 
	return PATHFIND_HASH_TILE(key1);
 
@@ -124,13 +124,13 @@ static TileIndex CalcClosestStationTile(
 

	
 
	// same for y coordinate, see above comment
 
	y = clamp(TileY(tile), miny, maxy);
 

	
 
	// return the tile of our target coordinates
 
	return TileXY(x, y);
 
};
 
}
 

	
 
/* On PBS pathfinding runs, this is called before pathfinding ends (BeforeExit aystar callback), and will
 
 * reserve the appropriate tracks, if needed. */
 
void NPFReservePBSPath(AyStar *as)
 
{
 
	NPFFoundTargetData* ftd = (NPFFoundTargetData*)as->user_path;
pbs.c
Show inline comments
 
@@ -37,13 +37,13 @@ static const byte encrt_to_reserved[16] 
 

	
 
/**
 
 * maps an encoded reserved track (from map3lo bits 4..7)
 
 * to the track(dir)s that are unavailable due to reservations.
 
 * 0xFFFF are invalid entries and should never be accessed.
 
 */
 
static const int16 encrt_to_unavail[16] = {
 
static const uint16 encrt_to_unavail[16] = {
 
	0x0000, 0x3F3F, 0x3F3F, 0x3737, 0x3B3B, 0x1F1F, 0x2F2F, 0xFFFF,
 
	0xFFFF, 0xFFFF, 0xFFFF, 0x3F3F, 0x3F3F, 0x3F3F, 0x3F3F, 0xFFFF
 
};
 

	
 
void PBSReserveTrack(TileIndex tile, Track track) {
 
	assert(IsValidTile(tile));
 
@@ -76,13 +76,13 @@ void PBSReserveTrack(TileIndex tile, Tra
 
			// make sure it is a railroad crossing
 
			if (!IsLevelCrossing(tile)) return;
 
			SETBIT(_m[tile].m5, 0);
 
			break;
 
		default:
 
			return;
 
	};
 
	}
 
	// if debugging, mark tile dirty to show reserved status
 
	if (_debug_pbs_level >= 1)
 
		MarkTileDirtyByTile(tile);
 
}
 

	
 
byte PBSTileReserved(TileIndex tile) {
 
@@ -97,13 +97,13 @@ byte PBSTileReserved(TileIndex tile) {
 
				return HASBIT(_m[tile].m5, 0) ? 2 : 1;
 
			} else {
 
				// normal track
 
				byte res = encrt_to_reserved[(_m[tile].m4 & 0xF0) >> 4];
 
				assert(res != 0xFF);
 
				return res;
 
			};
 
			}
 
		case MP_TUNNELBRIDGE:
 
			return (_m[tile].m4 & 3);
 
		case MP_STATION:
 
			// check if its reserved
 
			if (!HASBIT(_m[tile].m3, 6)) return 0;
 
			// return the track for the correct direction
 
@@ -114,14 +114,14 @@ byte PBSTileReserved(TileIndex tile) {
 
			// check if its reserved
 
			if (!HASBIT(_m[tile].m5, 0)) return 0;
 
			// return the track for the correct direction
 
			return HASBIT(_m[tile].m5, 3) ? 1 : 2;
 
		default:
 
			return 0;
 
	};
 
};
 
	}
 
}
 

	
 
uint16 PBSTileUnavail(TileIndex tile) {
 
	assert(IsValidTile(tile));
 
	switch (GetTileType(tile)) {
 
		case MP_RAILWAY:
 
			if ((_m[tile].m5 & ~1) == 0xC4) {
 
@@ -129,26 +129,26 @@ uint16 PBSTileUnavail(TileIndex tile) {
 
				return HASBIT(_m[tile].m3, 6) ? TRACKDIR_BIT_MASK : 0;
 
			} else {
 
				// normal track
 
				uint16 res = encrt_to_unavail[(_m[tile].m4 & 0xF0) >> 4];
 
				assert(res != 0xFFFF);
 
				return res;
 
			};
 
			}
 
		case MP_TUNNELBRIDGE:
 
			return (_m[tile].m4 & 3) | ((_m[tile].m4 & 3) << 8);
 
		case MP_STATION:
 
			return HASBIT(_m[tile].m3, 6) ? TRACKDIR_BIT_MASK : 0;
 
		case MP_STREET:
 
			// make sure its a railroad crossing
 
			if (!IsLevelCrossing(tile)) return 0;
 
			// check if its reserved
 
			return (HASBIT(_m[tile].m5, 0)) ? TRACKDIR_BIT_MASK : 0;
 
		default:
 
			return 0;
 
	};
 
};
 
	}
 
}
 

	
 
void PBSClearTrack(TileIndex tile, Track track) {
 
	assert(IsValidTile(tile));
 
	assert(track <= 5);
 
	switch (GetTileType(tile)) {
 
		case MP_RAILWAY:
 
@@ -180,17 +180,17 @@ void PBSClearTrack(TileIndex tile, Track
 
			// make sure it is a railroad crossing
 
			if (!IsLevelCrossing(tile)) return;
 
			CLRBIT(_m[tile].m5, 0);
 
			break;
 
		default:
 
			return;
 
	};
 
	}
 
	// if debugging, mark tile dirty to show reserved status
 
	if (_debug_pbs_level >= 1)
 
		MarkTileDirtyByTile(tile);
 
};
 
}
 

	
 
void PBSClearPath(TileIndex tile, Trackdir trackdir, TileIndex end_tile, Trackdir end_trackdir) {
 
	uint16 res;
 
	FindLengthOfTunnelResult flotr;
 
	assert(IsValidTile(tile));
 
	assert(IsValidTrackdir(trackdir));
 
@@ -206,21 +206,21 @@ void PBSClearPath(TileIndex tile, Trackd
 
			flotr = FindLengthOfTunnel(tile, TrackdirToExitdir(trackdir));
 

	
 
			tile = flotr.tile;
 
		} else {
 
			byte exitdir = TrackdirToExitdir(trackdir);
 
			tile = AddTileIndexDiffCWrap(tile, TileIndexDiffCByDir(exitdir));
 
		};
 
		}
 

	
 
		res = PBSTileReserved(tile);
 
		res |= res << 8;
 
		res &= TrackdirReachesTrackdirs(trackdir);
 
		trackdir = FindFirstBit2x64(res);
 

	
 
	} while (res != 0);
 
};
 
}
 

	
 
bool PBSIsPbsSignal(TileIndex tile, Trackdir trackdir)
 
{
 
	assert(IsValidTile(tile));
 
	assert(IsValidTrackdir(trackdir));
 

	
 
@@ -237,13 +237,13 @@ bool PBSIsPbsSignal(TileIndex tile, Trac
 
		return false;
 

	
 
	if (GetSignalType(tile, TrackdirToTrack(trackdir)) == 4)
 
		return true;
 
	else
 
		return false;
 
};
 
}
 

	
 
typedef struct SetSignalsDataPbs {
 
	int cur;
 

	
 
	// these are used to keep track of the signals.
 
	byte bit[NUM_SSD_ENTRY];
 
@@ -282,10 +282,10 @@ bool PBSIsPbsSegment(uint tile, Trackdir
 
	for(i=0; i!=ssd.cur; i++) {
 
		uint tile = ssd.tile[i];
 
		byte bit = ssd.bit[i];
 
		if (!PBSIsPbsSignal(tile, bit) && !PBSIsPbsSignal(tile, bit | 8))
 
			return false;
 
		result = true;
 
	};
 
	}
 

	
 
	return result;
 
}
train_cmd.c
Show inline comments
 
@@ -1307,13 +1307,13 @@ TileIndex GetVehicleTileOutOfTunnel(cons
 
	for (tile = v->tile;; tile += delta) {
 
		if (IsTunnelTile(tile) && (_m[tile].m5 & 0x3) != (direction) && GetTileZ(tile) == v->z_pos)
 
 			break;
 
 	}
 
 	return tile;
 

	
 
};
 
}
 

	
 
static void ReverseTrainDirection(Vehicle *v)
 
{
 
	int l = 0, r = -1;
 
	Vehicle *u;
 
	TileIndex tile;
0 comments (0 inline, 0 general)