src/road_cmd.cpp
branchgamebalance
changeset 9909 dce9a6923bb7
parent 9908 0fa543611bbe
child 9910 0b2aebc8283e
equal deleted inserted replaced
9908:0fa543611bbe 9909:dce9a6923bb7
    88 	return CheckAllowRemoveRoad(tile, remove, IsLevelCrossingTile(tile) ? GetCrossingRoadOwner(tile) : GetTileOwner(tile), edge_road);
    88 	return CheckAllowRemoveRoad(tile, remove, IsLevelCrossingTile(tile) ? GetCrossingRoadOwner(tile) : GetTileOwner(tile), edge_road);
    89 }
    89 }
    90 
    90 
    91 /** Delete a piece of road.
    91 /** Delete a piece of road.
    92  * @param tile tile where to remove road from
    92  * @param tile tile where to remove road from
       
    93  * @param flags operation to perform
    93  * @param p1 bit 0..3 road pieces to remove (RoadBits)
    94  * @param p1 bit 0..3 road pieces to remove (RoadBits)
    94  * @param p2 unused
    95  * @param p2 unused
    95  */
    96  */
    96 int32 CmdRemoveRoad(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
    97 int32 CmdRemoveRoad(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
    97 {
    98 {
   249 	return CMD_ERROR;
   250 	return CMD_ERROR;
   250 }
   251 }
   251 
   252 
   252 /** Build a piece of road.
   253 /** Build a piece of road.
   253  * @param tile tile where to build road
   254  * @param tile tile where to build road
       
   255  * @param flags operation to perform
   254  * @param p1 bit 0..3 road pieces to build (RoadBits)
   256  * @param p1 bit 0..3 road pieces to build (RoadBits)
   255  * @param p2 the town that is building the road (0 if not applicable)
   257  * @param p2 the town that is building the road (0 if not applicable)
   256  */
   258  */
   257 int32 CmdBuildRoad(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
   259 int32 CmdBuildRoad(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
   258 {
   260 {
   404 }
   406 }
   405 
   407 
   406 
   408 
   407 /** Build a long piece of road.
   409 /** Build a long piece of road.
   408  * @param end_tile end tile of drag
   410  * @param end_tile end tile of drag
       
   411  * @param flags operation to perform
   409  * @param p1 start tile of drag
   412  * @param p1 start tile of drag
   410  * @param p2 various bitstuffed elements
   413  * @param p2 various bitstuffed elements
   411  * - p2 = (bit 0) - start tile starts in the 2nd half of tile (p2 & 1)
   414  * - p2 = (bit 0) - start tile starts in the 2nd half of tile (p2 & 1)
   412  * - p2 = (bit 1) - end tile starts in the 2nd half of tile (p2 & 2)
   415  * - p2 = (bit 1) - end tile starts in the 2nd half of tile (p2 & 2)
   413  * - p2 = (bit 2) - direction: 0 = along x-axis, 1 = along y-axis (p2 & 4)
   416  * - p2 = (bit 2) - direction: 0 = along x-axis, 1 = along y-axis (p2 & 4)
   460 	return (cost == 0) ? CMD_ERROR : cost;
   463 	return (cost == 0) ? CMD_ERROR : cost;
   461 }
   464 }
   462 
   465 
   463 /** Remove a long piece of road.
   466 /** Remove a long piece of road.
   464  * @param end_tile end tile of drag
   467  * @param end_tile end tile of drag
       
   468  * @param flags operation to perform
   465  * @param p1 start tile of drag
   469  * @param p1 start tile of drag
   466  * @param p2 various bitstuffed elements
   470  * @param p2 various bitstuffed elements
   467  * - p2 = (bit 0) - start tile starts in the 2nd half of tile (p2 & 1)
   471  * - p2 = (bit 0) - start tile starts in the 2nd half of tile (p2 & 1)
   468  * - p2 = (bit 1) - end tile starts in the 2nd half of tile (p2 & 2)
   472  * - p2 = (bit 1) - end tile starts in the 2nd half of tile (p2 & 2)
   469  * - p2 = (bit 2) - direction: 0 = along x-axis, 1 = along y-axis (p2 & 4)
   473  * - p2 = (bit 2) - direction: 0 = along x-axis, 1 = along y-axis (p2 & 4)
   514 	return (cost == 0) ? CMD_ERROR : cost;
   518 	return (cost == 0) ? CMD_ERROR : cost;
   515 }
   519 }
   516 
   520 
   517 /** Build a road depot.
   521 /** Build a road depot.
   518  * @param tile tile where to build the depot
   522  * @param tile tile where to build the depot
       
   523  * @param flags operation to perform
   519  * @param p1 bit 0..1 entrance direction (DiagDirection)
   524  * @param p1 bit 0..1 entrance direction (DiagDirection)
   520  * @param p2 unused
   525  * @param p2 unused
   521  *
   526  *
   522  * @todo When checking for the tile slope,
   527  * @todo When checking for the tile slope,
   523  * distingush between "Flat land required" and "land sloped in wrong direction"
   528  * distingush between "Flat land required" and "land sloped in wrong direction"
   663 };
   668 };
   664 
   669 
   665 /**
   670 /**
   666  * Draw ground sprite and road pieces
   671  * Draw ground sprite and road pieces
   667  * @param ti TileInfo
   672  * @param ti TileInfo
   668  * @param road RoadBits to draw
       
   669  */
   673  */
   670 static void DrawRoadBits(TileInfo* ti)
   674 static void DrawRoadBits(TileInfo* ti)
   671 {
   675 {
   672 	RoadBits road = GetRoadBits(ti->tile);
   676 	RoadBits road = GetRoadBits(ti->tile);
   673 	const DrawRoadTileStruct *drts;
   677 	const DrawRoadTileStruct *drts;