Changeset - r17513:7d4f7d6b1159
[Not reviewed]
master
0 1 0
yexo - 14 years ago 2011-04-01 19:55:56
yexo@openttd.org
(svn r22286) -Fix: [NewGRF] the c and p parts of station vars 40, 41 and 49 were incorrect for large stations
1 file changed with 8 insertions and 11 deletions:
0 comments (0 inline, 0 general)
src/newgrf_station.cpp
Show inline comments
 
@@ -107,30 +107,27 @@ uint32 GetPlatformInfo(Axis axis, byte t
 

	
 
	if (axis == AXIS_X) {
 
		Swap(platforms, length);
 
		Swap(x, y);
 
	}
 

	
 
	/* Limit our sizes to 4 bits */
 
	platforms = min(15, platforms);
 
	length    = min(15, length);
 
	x = min(15, x);
 
	y = min(15, y);
 
	if (centred) {
 
		x -= platforms / 2;
 
		y -= length / 2;
 
		x = Clamp(x, -8, 7);
 
		y = Clamp(x, -8, 7);
 
		SB(retval,  0, 4, y & 0xF);
 
		SB(retval,  4, 4, x & 0xF);
 
	} else {
 
		SB(retval,  0, 4, y);
 
		SB(retval,  4, 4, length - y - 1);
 
		SB(retval,  8, 4, x);
 
		SB(retval, 12, 4, platforms - x - 1);
 
		SB(retval,  0, 4, min(15, y));
 
		SB(retval,  4, 4, min(15, length - y - 1));
 
		SB(retval,  8, 4, min(15, x));
 
		SB(retval, 12, 4, min(15, platforms - x - 1));
 
	}
 
	SB(retval, 16, 4, length);
 
	SB(retval, 20, 4, platforms);
 
	SB(retval, 16, 4, min(15, length));
 
	SB(retval, 20, 4, min(15, platforms));
 
	SB(retval, 24, 4, tile);
 

	
 
	return retval;
 
}
 

	
 

	
0 comments (0 inline, 0 general)