Changeset - r16412:3785137aceac
[Not reviewed]
master
0 1 0
rubidium - 14 years ago 2010-11-10 23:13:37
rubidium@openttd.org
(svn r21138) -Codechange: Introduce the concepts of frame and position in the tunnel / bridge entering code (Hirundo)
1 file changed with 4 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/tunnelbridge_cmd.cpp
Show inline comments
 
@@ -1502,6 +1502,10 @@ static VehicleEnterTileStatus VehicleEnt
 
	const DiagDirection dir = GetTunnelBridgeDirection(tile);
 
	/* Direction of the vehicle */
 
	const DiagDirection vdir = DirToDiagDir(v->direction);
 
	/* New position of the vehicle on the tile */
 
	byte pos = (DiagDirToAxis(vdir) == AXIS_X ? x : y) & TILE_UNIT_MASK;
 
	/* Number of units moved by the vehicle since entering the tile */
 
	byte frame = (vdir == DIAGDIR_NE || vdir == DIAGDIR_NW) ? TILE_SIZE - 1 - pos : pos;
 

	
 
	if (IsTunnel(tile)) {
 
		byte fc = (x & 0xF) + (y << 4);
0 comments (0 inline, 0 general)