depot.h
changeset 2049 538e73c53f54
parent 1977 37bbebf94434
child 2085 876f20a0e843
equal deleted inserted replaced
2048:54fd558314dc 2049:538e73c53f54
    70 static inline bool IsTileDepotType(TileIndex tile, TransportType type)
    70 static inline bool IsTileDepotType(TileIndex tile, TransportType type)
    71 {
    71 {
    72 	switch(type)
    72 	switch(type)
    73 	{
    73 	{
    74 		case TRANSPORT_RAIL:
    74 		case TRANSPORT_RAIL:
    75 			return IsTileType(tile, MP_RAILWAY) && (_map5[tile] & 0xFC) == 0xC0;
    75 			return IsTileType(tile, MP_RAILWAY) && (_m[tile].m5 & 0xFC) == 0xC0;
    76 
    76 
    77 		case TRANSPORT_ROAD:
    77 		case TRANSPORT_ROAD:
    78 			return IsTileType(tile, MP_STREET) && (_map5[tile] & 0xF0) == 0x20;
    78 			return IsTileType(tile, MP_STREET) && (_m[tile].m5 & 0xF0) == 0x20;
    79 
    79 
    80 		case TRANSPORT_WATER:
    80 		case TRANSPORT_WATER:
    81 			return IsTileType(tile, MP_WATER) && (_map5[tile] & ~3) == 0x80;
    81 			return IsTileType(tile, MP_WATER) && (_m[tile].m5 & ~3) == 0x80;
    82 
    82 
    83 		default:
    83 		default:
    84 			assert(0);
    84 			assert(0);
    85 			return false;
    85 			return false;
    86 	}
    86 	}
    96 	switch (type)
    96 	switch (type)
    97 	{
    97 	{
    98 		case TRANSPORT_RAIL:
    98 		case TRANSPORT_RAIL:
    99 		case TRANSPORT_ROAD:
    99 		case TRANSPORT_ROAD:
   100 			/* Rail and road store a diagonal direction in bits 0 and 1 */
   100 			/* Rail and road store a diagonal direction in bits 0 and 1 */
   101 			return (DiagDirection)(_map5[tile] & 3);
   101 			return (DiagDirection)(_m[tile].m5 & 3);
   102 		case TRANSPORT_WATER:
   102 		case TRANSPORT_WATER:
   103 			/* Water is stubborn, it stores the directions in a different order. */
   103 			/* Water is stubborn, it stores the directions in a different order. */
   104 			switch (_map5[tile] & 3) {
   104 			switch (_m[tile].m5 & 3) {
   105 				case 0: return DIAGDIR_NE;
   105 				case 0: return DIAGDIR_NE;
   106 				case 1: return DIAGDIR_SW;
   106 				case 1: return DIAGDIR_SW;
   107 				case 2: return DIAGDIR_NW;
   107 				case 2: return DIAGDIR_NW;
   108 				case 3: return DIAGDIR_SE;
   108 				case 3: return DIAGDIR_SE;
   109 			}
   109 			}