Make 32 instead of 16 rail types possible. by using one free bit of m1 in the map array.

(cherry picked from commit b44843800880cdc186f5183301ee0f42afbb5f84)

Also set non-rail type M3 bits to 0 where applicable.
Change savegame versioning to SLXI format.
This commit is contained in:
keldorkatarn
2016-04-01 21:27:19 +02:00
committed by Jonathan G Rennison
parent 59677d5c6f
commit 5cc56d6ad9
15 changed files with 90 additions and 59 deletions

View File

@@ -248,7 +248,7 @@ CommandCost CheckBridgeAvailability(BridgeType bridge_type, uint bridge_len, DoC
* @param p1 packed start tile coords (~ dx)
* @param p2 various bitstuffed elements
* - p2 = (bit 0- 7) - bridge type (hi bh)
* - p2 = (bit 8-11) - rail type or road types.
* - p2 = (bit 8-12) - rail type or road types.
* - p2 = (bit 15-16) - transport type.
* @param text unused
* @return the cost of this operation or an error
@@ -275,7 +275,7 @@ CommandCost CmdBuildBridge(TileIndex end_tile, DoCommandFlag flags, uint32 p1, u
break;
case TRANSPORT_RAIL:
railtype = Extract<RailType, 8, 4>(p2);
railtype = Extract<RailType, 8, 5>(p2);
if (!ValParamRailtype(railtype)) return CMD_ERROR;
break;
@@ -590,7 +590,7 @@ CommandCost CmdBuildBridge(TileIndex end_tile, DoCommandFlag flags, uint32 p1, u
* Build Tunnel.
* @param start_tile start tile of tunnel
* @param flags type of operation
* @param p1 bit 0-3 railtype or roadtypes
* @param p1 bit 0-4 railtype or roadtypes
* bit 8-9 transport type
* @param p2 unused
* @param text unused
@@ -607,7 +607,7 @@ CommandCost CmdBuildTunnel(TileIndex start_tile, DoCommandFlag flags, uint32 p1,
_build_tunnel_endtile = 0;
switch (transport_type) {
case TRANSPORT_RAIL:
railtype = Extract<RailType, 0, 4>(p1);
railtype = Extract<RailType, 0, 5>(p1);
if (!ValParamRailtype(railtype)) return CMD_ERROR;
break;