1777 void MarkSingleVehicleDirty(const Vehicle *v) |
1777 void MarkSingleVehicleDirty(const Vehicle *v) |
1778 { |
1778 { |
1779 MarkAllViewportsDirty(v->left_coord, v->top_coord, v->right_coord + 1, v->bottom_coord + 1); |
1779 MarkAllViewportsDirty(v->left_coord, v->top_coord, v->right_coord + 1, v->bottom_coord + 1); |
1780 } |
1780 } |
1781 |
1781 |
1782 /* returns true if staying in the same tile */ |
1782 /** |
|
1783 * Get position information of a vehicle when moving one pixel in the direction it is facing |
|
1784 * @param v Vehicle to move |
|
1785 * @return Position information after the move */ |
1783 GetNewVehiclePosResult GetNewVehiclePos(const Vehicle *v) |
1786 GetNewVehiclePosResult GetNewVehiclePos(const Vehicle *v) |
1784 { |
1787 { |
1785 static const int8 _delta_coord[16] = { |
1788 static const int8 _delta_coord[16] = { |
1786 -1,-1,-1, 0, 1, 1, 1, 0, /* x */ |
1789 -1,-1,-1, 0, 1, 1, 1, 0, /* x */ |
1787 -1, 0, 1, 1, 1, 0,-1,-1, /* y */ |
1790 -1, 0, 1, 1, 1, 0,-1,-1, /* y */ |
1868 default: return INVALID_TRACKDIR; |
1871 default: return INVALID_TRACKDIR; |
1869 } |
1872 } |
1870 } |
1873 } |
1871 |
1874 |
1872 /** |
1875 /** |
1873 * Returns some meta-data over the to be entered tile. |
1876 * Call the tile callback function for a vehicle entering a tile |
|
1877 * @param v Vehicle entering the tile |
|
1878 * @param tile Tile entered |
|
1879 * @param x X position |
|
1880 * @param y Y position |
|
1881 * @return Some meta-data over the to be entered tile. |
1874 * @see VehicleEnterTileStatus to see what the bits in the return value mean. |
1882 * @see VehicleEnterTileStatus to see what the bits in the return value mean. |
1875 */ |
1883 */ |
1876 uint32 VehicleEnterTile(Vehicle *v, TileIndex tile, int x, int y) |
1884 uint32 VehicleEnterTile(Vehicle *v, TileIndex tile, int x, int y) |
1877 { |
1885 { |
1878 return _tile_type_procs[GetTileType(tile)]->vehicle_enter_tile_proc(v, tile, x, y); |
1886 return _tile_type_procs[GetTileType(tile)]->vehicle_enter_tile_proc(v, tile, x, y); |