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:

committed by
Jonathan G Rennison

parent
59677d5c6f
commit
5cc56d6ad9
@@ -196,7 +196,7 @@ static void PlaceRail_Station(TileIndex tile)
|
||||
VpStartPlaceSizing(tile, VPM_X_AND_Y_LIMITED, DDSP_BUILD_STATION);
|
||||
VpSetPlaceSizingLimit(_settings_game.station.station_spread);
|
||||
} else {
|
||||
uint32 p1 = _cur_railtype | _railstation.orientation << 4 | _settings_client.gui.station_numtracks << 8 | _settings_client.gui.station_platlength << 16 | _ctrl_pressed << 24;
|
||||
uint32 p1 = _cur_railtype | _railstation.orientation << 5 | _settings_client.gui.station_numtracks << 8 | _settings_client.gui.station_platlength << 16 | _ctrl_pressed << 24;
|
||||
uint32 p2 = _railstation.station_class | _railstation.station_type << 8 | INVALID_STATION << 16;
|
||||
|
||||
int w = _settings_client.gui.station_numtracks;
|
||||
@@ -373,7 +373,7 @@ static void BuildRailClick_Remove(Window *w)
|
||||
|
||||
static void DoRailroadTrack(int mode)
|
||||
{
|
||||
DoCommandP(TileVirtXY(_thd.selstart.x, _thd.selstart.y), TileVirtXY(_thd.selend.x, _thd.selend.y), _cur_railtype | (mode << 4),
|
||||
DoCommandP(TileVirtXY(_thd.selstart.x, _thd.selstart.y), TileVirtXY(_thd.selend.x, _thd.selend.y), _cur_railtype | (mode << 5),
|
||||
_remove_button_clicked ?
|
||||
CMD_REMOVE_RAILROAD_TRACK | CMD_MSG(STR_ERROR_CAN_T_REMOVE_RAILROAD_TRACK) :
|
||||
CMD_BUILD_RAILROAD_TRACK | CMD_MSG(STR_ERROR_CAN_T_BUILD_RAILROAD_TRACK),
|
||||
@@ -732,7 +732,7 @@ struct BuildRailToolbarWindow : Window {
|
||||
break;
|
||||
|
||||
case DDSP_CONVERT_RAIL:
|
||||
DoCommandP(end_tile, start_tile, _cur_railtype | (_ctrl_pressed ? 0x10 : 0), CMD_CONVERT_RAIL | CMD_MSG(STR_ERROR_CAN_T_CONVERT_RAIL), CcPlaySound10);
|
||||
DoCommandP(end_tile, start_tile, _cur_railtype | (_ctrl_pressed ? (1 << 5) : 0), CMD_CONVERT_RAIL | CMD_MSG(STR_ERROR_CAN_T_CONVERT_RAIL), CcPlaySound10);
|
||||
break;
|
||||
|
||||
case DDSP_REMOVE_STATION:
|
||||
@@ -907,7 +907,7 @@ static void HandleStationPlacement(TileIndex start, TileIndex end)
|
||||
|
||||
if (_railstation.orientation == AXIS_X) Swap(numtracks, platlength);
|
||||
|
||||
uint32 p1 = _cur_railtype | _railstation.orientation << 4 | numtracks << 8 | platlength << 16 | _ctrl_pressed << 24;
|
||||
uint32 p1 = _cur_railtype | _railstation.orientation << 5 | numtracks << 8 | platlength << 16 | _ctrl_pressed << 24;
|
||||
uint32 p2 = _railstation.station_class | _railstation.station_type << 8 | INVALID_STATION << 16;
|
||||
|
||||
CommandContainer cmdcont = { ta.tile, p1, p2, CMD_BUILD_RAIL_STATION | CMD_MSG(STR_ERROR_CAN_T_BUILD_RAILROAD_STATION), CcStation, 0, "" };
|
||||
|
Reference in New Issue
Block a user