station_cmd.c
changeset 3540 3bcf5348842b
parent 3527 a4e4b90a54f7
child 3545 b08ce1bbb589
equal deleted inserted replaced
3539:bbc5b0e6fc41 3540:3bcf5348842b
  2064 
  2064 
  2065 static void TileLoop_Station(TileIndex tile)
  2065 static void TileLoop_Station(TileIndex tile)
  2066 {
  2066 {
  2067 	// FIXME -- GetTileTrackStatus_Station -> animated stationtiles
  2067 	// FIXME -- GetTileTrackStatus_Station -> animated stationtiles
  2068 	// hardcoded.....not good
  2068 	// hardcoded.....not good
  2069 	switch (_m[tile].m5) {
  2069 	switch (GetStationGfx(tile)) {
  2070 		case 0x27: // large big airport
  2070 		case 0x27: // large big airport
  2071 		case 0x3A: // flag small airport
  2071 		case 0x3A: // flag small airport
  2072 		case 0x5A: // radar international airport
  2072 		case 0x5A: // radar international airport
  2073 		case 0x66: // radar metropolitan airport
  2073 		case 0x66: // radar metropolitan airport
  2074 			AddAnimatedTile(tile);
  2074 			AddAnimatedTile(tile);
  2084 }
  2084 }
  2085 
  2085 
  2086 
  2086 
  2087 static void AnimateTile_Station(TileIndex tile)
  2087 static void AnimateTile_Station(TileIndex tile)
  2088 {
  2088 {
  2089 	byte m5 = _m[tile].m5;
  2089 	byte gfx = GetStationGfx(tile);
  2090 	//FIXME -- AnimateTile_Station -> not nice code, lots of things double
  2090 	//FIXME -- AnimateTile_Station -> not nice code, lots of things double
  2091   // again hardcoded...was a quick hack
  2091   // again hardcoded...was a quick hack
  2092 
  2092 
  2093   // turning radar / windsack on airport
  2093   // turning radar / windsack on airport
  2094 	if (m5 >= 39 && m5 <= 50) { // turning radar (39 - 50)
  2094 	if (gfx >= 39 && gfx <= 50) { // turning radar (39 - 50)
  2095 		if (_tick_counter & 3)
  2095 		if (_tick_counter & 3)
  2096 			return;
  2096 			return;
  2097 
  2097 
  2098 		if (++m5 == 50+1)
  2098 		if (++gfx == 50+1)
  2099 			m5 = 39;
  2099 			gfx = 39;
  2100 
  2100 
  2101 		_m[tile].m5 = m5;
  2101 		SetStationGfx(tile, gfx);
  2102 		MarkTileDirtyByTile(tile);
  2102 		MarkTileDirtyByTile(tile);
  2103   //added - begin
  2103   //added - begin
  2104 	} else if (m5 >= 90 && m5 <= 113) { // turning radar with ground under it (different fences) (90 - 101 | 102 - 113)
  2104 	} else if (gfx >= 90 && gfx <= 113) { // turning radar with ground under it (different fences) (90 - 101 | 102 - 113)
  2105 		if (_tick_counter & 3)
  2105 		if (_tick_counter & 3)
  2106 			return;
  2106 			return;
  2107 
  2107 
  2108 		m5++;
  2108 		gfx++;
  2109 
  2109 
  2110 		if (m5 == 101+1) {m5 = 90;}  // radar with fences in south
  2110 		if (gfx == 101+1) {gfx = 90;}  // radar with fences in south
  2111 		else if (m5 == 113+1) {m5 = 102;} // radar with fences in north
  2111 		else if (gfx == 113+1) {gfx = 102;} // radar with fences in north
  2112 
  2112 
  2113 		_m[tile].m5 = m5;
  2113 		SetStationGfx(tile, gfx);
  2114 		MarkTileDirtyByTile(tile);
  2114 		MarkTileDirtyByTile(tile);
  2115 	//added - end
  2115 	//added - end
  2116 	} else if (m5 >= 0x3A && m5 <= 0x3D) {  // windsack (58 - 61)
  2116 	} else if (gfx >= 0x3A && gfx <= 0x3D) {  // windsack (58 - 61)
  2117 		if (_tick_counter & 1)
  2117 		if (_tick_counter & 1)
  2118 			return;
  2118 			return;
  2119 
  2119 
  2120 		if (++m5 == 0x3D+1)
  2120 		if (++gfx == 0x3D+1)
  2121 			m5 = 0x3A;
  2121 			gfx = 0x3A;
  2122 
  2122 
  2123 		_m[tile].m5 = m5;
  2123 		SetStationGfx(tile, gfx);
  2124 		MarkTileDirtyByTile(tile);
  2124 		MarkTileDirtyByTile(tile);
  2125 	}
  2125 	}
  2126 }
  2126 }
  2127 
  2127 
  2128 
  2128