mirror of https://github.com/OpenTTD/OpenTTD
Compare commits
No commits in common. "c84219a42ee04582b0897bb7c6afc754d2223cce" and "fd79d34ba96ab4372519526adcfcc25dab105767" have entirely different histories.
c84219a42e
...
fd79d34ba9
|
@ -989,11 +989,8 @@
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</li>
|
</li>
|
||||||
<li>m6 bit 7: rail station / waypoint may have catenary pylons</li>
|
|
||||||
<li>m6 bit 6: rail station / waypoint may have catenary wires</li>
|
|
||||||
<li>m6 bits 5..3: the station type (rail, airport, truck, bus, oilrig, dock, buoy, waypoint)</li>
|
<li>m6 bits 5..3: the station type (rail, airport, truck, bus, oilrig, dock, buoy, waypoint)</li>
|
||||||
<li>m6 bit 2: pbs reservation state for railway stations/waypoints</li>
|
<li>m6 bit 2: pbs reservation state for railway stations/waypoints</li>
|
||||||
<li>m6 bit 0: rail station / waypoint is blocked</li>
|
|
||||||
|
|
||||||
<li>m7 bits 4..0: <a href="#OwnershipInfo">owner</a> of road (road stops)</li>
|
<li>m7 bits 4..0: <a href="#OwnershipInfo">owner</a> of road (road stops)</li>
|
||||||
<li>m7: animation frame (railway stations/waypoints, airports)</li>
|
<li>m7: animation frame (railway stations/waypoints, airports)</li>
|
||||||
|
|
|
@ -188,7 +188,7 @@ the array so you can quickly see what is used and what is not.
|
||||||
<td class="bits" rowspan=2><span class="used" title="Random bits">XXXX</span> <span class="free">OOOO</span></td>
|
<td class="bits" rowspan=2><span class="used" title="Random bits">XXXX</span> <span class="free">OOOO</span></td>
|
||||||
<td class="bits" rowspan=2><span class="used" title="Custom station specifications ID">XXXX XXXX</span></td>
|
<td class="bits" rowspan=2><span class="used" title="Custom station specifications ID">XXXX XXXX</span></td>
|
||||||
<td class="bits"><span class="used" title="Graphics index">XXXX XXXX</span></td>
|
<td class="bits"><span class="used" title="Graphics index">XXXX XXXX</span></td>
|
||||||
<td class="bits" rowspan=2><span class="used" title="May have pylons">X</span><span class="used" title="May have wires">X</span><span class="used" title="Station type">XXX</span> <span class="used" title="Reserved track">X</span><span class="free">O</span><span class="used" title="Tile is blocked">X</span></td>
|
<td class="bits" rowspan=2><span class="free">OO</span><span class="used" title="Station type">XXX</span> <span class="used" title="Reserved track">X</span><span class="free">OO</span></td>
|
||||||
<td class="bits" rowspan=2><span class="used" title="Animation frame">XXXX XXXX</span></td>
|
<td class="bits" rowspan=2><span class="used" title="Animation frame">XXXX XXXX</span></td>
|
||||||
<td class="bits" rowspan=2><span class="free">OOOO OOOO OO</span><span class="used" title="Railway type">XX XXXX</span></td>
|
<td class="bits" rowspan=2><span class="free">OOOO OOOO OO</span><span class="used" title="Railway type">XX XXXX</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -3400,7 +3400,6 @@ STR_NEWGRF_INSPECT_PARENT_TOOLTIP :{BLACK}Inspect
|
||||||
STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT :{STRING} at {HEX}
|
STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT :{STRING} at {HEX}
|
||||||
STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_OBJECT :Object
|
STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_OBJECT :Object
|
||||||
STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_RAIL_TYPE :Rail type
|
STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_RAIL_TYPE :Rail type
|
||||||
STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_ROAD_TYPE :Road type
|
|
||||||
|
|
||||||
STR_NEWGRF_INSPECT_QUERY_CAPTION :{WHITE}NewGRF variable 60+x parameter (hexadecimal)
|
STR_NEWGRF_INSPECT_QUERY_CAPTION :{WHITE}NewGRF variable 60+x parameter (hexadecimal)
|
||||||
|
|
||||||
|
|
|
@ -523,7 +523,6 @@ STR_NEWS_MENU_DELETE_ALL_MESSAGES :Xoá tất cả
|
||||||
# About menu
|
# About menu
|
||||||
###length 11
|
###length 11
|
||||||
STR_ABOUT_MENU_LAND_BLOCK_INFO :Thông tin vùng đất
|
STR_ABOUT_MENU_LAND_BLOCK_INFO :Thông tin vùng đất
|
||||||
STR_ABOUT_MENU_HELP :Trợ giúp & hướng dẫn
|
|
||||||
STR_ABOUT_MENU_SEPARATOR :
|
STR_ABOUT_MENU_SEPARATOR :
|
||||||
STR_ABOUT_MENU_TOGGLE_CONSOLE :Bật/tắt bảng lệnh
|
STR_ABOUT_MENU_TOGGLE_CONSOLE :Bật/tắt bảng lệnh
|
||||||
STR_ABOUT_MENU_AI_DEBUG :Gỡ rối AI / Game script
|
STR_ABOUT_MENU_AI_DEBUG :Gỡ rối AI / Game script
|
||||||
|
@ -2125,7 +2124,6 @@ STR_INTRO_MULTIPLAYER :{BLACK}Nhiều
|
||||||
|
|
||||||
STR_INTRO_GAME_OPTIONS :{BLACK}Cấu Hình Trò Chơi
|
STR_INTRO_GAME_OPTIONS :{BLACK}Cấu Hình Trò Chơi
|
||||||
STR_INTRO_HIGHSCORE :{BLACK}Bảng điểm chơi cao nhất
|
STR_INTRO_HIGHSCORE :{BLACK}Bảng điểm chơi cao nhất
|
||||||
STR_INTRO_HELP :{BLACK}Trợ giúp & hướng dẫn
|
|
||||||
STR_INTRO_CONFIG_SETTINGS_TREE :{BLACK}Thiết lập
|
STR_INTRO_CONFIG_SETTINGS_TREE :{BLACK}Thiết lập
|
||||||
STR_INTRO_NEWGRF_SETTINGS :{BLACK}Thiết Lập NewGRF
|
STR_INTRO_NEWGRF_SETTINGS :{BLACK}Thiết Lập NewGRF
|
||||||
STR_INTRO_ONLINE_CONTENT :{BLACK}Các Nội Dung Trên Mạng
|
STR_INTRO_ONLINE_CONTENT :{BLACK}Các Nội Dung Trên Mạng
|
||||||
|
@ -2147,7 +2145,6 @@ STR_INTRO_TOOLTIP_TOYLAND_LANDSCAPE :{BLACK}Chọn k
|
||||||
|
|
||||||
STR_INTRO_TOOLTIP_GAME_OPTIONS :{BLACK}Hiển thị cấu hình của trò chơi
|
STR_INTRO_TOOLTIP_GAME_OPTIONS :{BLACK}Hiển thị cấu hình của trò chơi
|
||||||
STR_INTRO_TOOLTIP_HIGHSCORE :{BLACK}Hiện bảng điểm chơi cao nhất
|
STR_INTRO_TOOLTIP_HIGHSCORE :{BLACK}Hiện bảng điểm chơi cao nhất
|
||||||
STR_INTRO_TOOLTIP_HELP :{BLACK}Truy cập vào tài liệu và tài nguyên trực tuyến
|
|
||||||
STR_INTRO_TOOLTIP_CONFIG_SETTINGS_TREE :{BLACK}Thiết lập hiển thị
|
STR_INTRO_TOOLTIP_CONFIG_SETTINGS_TREE :{BLACK}Thiết lập hiển thị
|
||||||
STR_INTRO_TOOLTIP_NEWGRF_SETTINGS :{BLACK}Hiển thị tùy chỉnh NewGRF
|
STR_INTRO_TOOLTIP_NEWGRF_SETTINGS :{BLACK}Hiển thị tùy chỉnh NewGRF
|
||||||
STR_INTRO_TOOLTIP_ONLINE_CONTENT :{BLACK}Kiểm tra những nội dung mới & cập nhật để tải về
|
STR_INTRO_TOOLTIP_ONLINE_CONTENT :{BLACK}Kiểm tra những nội dung mới & cập nhật để tải về
|
||||||
|
@ -2170,17 +2167,6 @@ STR_ABANDON_GAME_QUERY :{YELLOW}Bạn c
|
||||||
STR_ABANDON_SCENARIO_QUERY :{YELLOW}Bạn có chắc bạn muốn bỏ màn chơi kịch bản này?
|
STR_ABANDON_SCENARIO_QUERY :{YELLOW}Bạn có chắc bạn muốn bỏ màn chơi kịch bản này?
|
||||||
|
|
||||||
# Help window
|
# Help window
|
||||||
STR_HELP_WINDOW_CAPTION :{WHITE}Trợ giúp & hướng dẫn
|
|
||||||
STR_HELP_WINDOW_WEBSITES :{BLACK}Websites
|
|
||||||
STR_HELP_WINDOW_DOCUMENTS :{BLACK}Tài liệu
|
|
||||||
STR_HELP_WINDOW_README :{BLACK}Readme
|
|
||||||
STR_HELP_WINDOW_CHANGELOG :{BLACK}Lịch sử thay đổi
|
|
||||||
STR_HELP_WINDOW_KNOWN_BUGS :{BLACK}Các lỗi đã biết
|
|
||||||
STR_HELP_WINDOW_LICENSE :{BLACK}Giấy phép
|
|
||||||
STR_HELP_WINDOW_MAIN_WEBSITE :{BLACK}OpenTTD
|
|
||||||
STR_HELP_WINDOW_MANUAL_WIKI :{BLACK}Hướng dẫn / Wiki
|
|
||||||
STR_HELP_WINDOW_BUGTRACKER :{BLACK}Báo cáo lỗi
|
|
||||||
STR_HELP_WINDOW_COMMUNITY :{BLACK}Cộng đồng
|
|
||||||
|
|
||||||
# Cheat window
|
# Cheat window
|
||||||
STR_CHEATS :{WHITE}Cheats
|
STR_CHEATS :{WHITE}Cheats
|
||||||
|
@ -3400,7 +3386,6 @@ STR_NEWGRF_INSPECT_PARENT_TOOLTIP :{BLACK}Phân t
|
||||||
STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT :{STRING} tại {HEX}
|
STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT :{STRING} tại {HEX}
|
||||||
STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_OBJECT :Đối Tượng
|
STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_OBJECT :Đối Tượng
|
||||||
STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_RAIL_TYPE :Kiểu ray
|
STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_RAIL_TYPE :Kiểu ray
|
||||||
STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_ROAD_TYPE :Loại đường
|
|
||||||
|
|
||||||
STR_NEWGRF_INSPECT_QUERY_CAPTION :{WHITE}Biến số NewGRF là 60+x (dạng hexa)
|
STR_NEWGRF_INSPECT_QUERY_CAPTION :{WHITE}Biến số NewGRF là 60+x (dạng hexa)
|
||||||
|
|
||||||
|
@ -4716,11 +4701,6 @@ STR_AI_SETTINGS_SETTING :{STRING}: {ORAN
|
||||||
|
|
||||||
|
|
||||||
# Textfile window
|
# Textfile window
|
||||||
STR_TEXTFILE_JUMPLIST :{WHITE}Danh mục
|
|
||||||
STR_TEXTFILE_JUMPLIST_TOOLTIP :{BLACK}Dùng danh sách này để chuyển nhanh tới một phần trong tập tin được hiển thị
|
|
||||||
STR_TEXTFILE_JUMPLIST_ITEM :{WHITE}{STRING}
|
|
||||||
STR_TEXTFILE_NAVBACK_TOOLTIP :{BLACK}Trở về trước trong lịch sử điều hướng
|
|
||||||
STR_TEXTFILE_NAVFORWARD_TOOLTIP :{BLACK}Trở về sau trong lịch sử điều hướng
|
|
||||||
STR_TEXTFILE_WRAP_TEXT :{WHITE}Ép văn bản
|
STR_TEXTFILE_WRAP_TEXT :{WHITE}Ép văn bản
|
||||||
STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}Ép chữ cái vừa khung cửa sổ để khỏi phải cuộn chuột
|
STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK}Ép chữ cái vừa khung cửa sổ để khỏi phải cuộn chuột
|
||||||
STR_TEXTFILE_VIEW_README :{BLACK}Xem readme
|
STR_TEXTFILE_VIEW_README :{BLACK}Xem readme
|
||||||
|
@ -4731,7 +4711,6 @@ STR_TEXTFILE_README_CAPTION :{WHITE}Readme c
|
||||||
STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}Lịch sử thay đổi của {STRING} {STRING}
|
STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}Lịch sử thay đổi của {STRING} {STRING}
|
||||||
STR_TEXTFILE_LICENCE_CAPTION :{WHITE}Giấy phép của {STRING} {STRING}
|
STR_TEXTFILE_LICENCE_CAPTION :{WHITE}Giấy phép của {STRING} {STRING}
|
||||||
STR_TEXTFILE_SURVEY_RESULT_CAPTION :{WHITE}Xem trước kết quả khảo sát
|
STR_TEXTFILE_SURVEY_RESULT_CAPTION :{WHITE}Xem trước kết quả khảo sát
|
||||||
STR_TEXTFILE_GAME_MANUAL_CAPTION :{WHITE}Tài liệu OpenTTD '{STRING}'
|
|
||||||
|
|
||||||
|
|
||||||
# Vehicle loading indicators
|
# Vehicle loading indicators
|
||||||
|
|
|
@ -840,6 +840,46 @@ const StationSpec *GetStationSpec(TileIndex t)
|
||||||
return specindex < st->speclist.size() ? st->speclist[specindex].spec : nullptr;
|
return specindex < st->speclist.size() ? st->speclist[specindex].spec : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check whether a rail station tile is NOT traversable.
|
||||||
|
* @param tile %Tile to test.
|
||||||
|
* @return Station tile is blocked.
|
||||||
|
* @note This could be cached (during build) in the map array to save on all the dereferencing.
|
||||||
|
*/
|
||||||
|
bool IsStationTileBlocked(TileIndex tile)
|
||||||
|
{
|
||||||
|
const StationSpec *statspec = GetStationSpec(tile);
|
||||||
|
|
||||||
|
return statspec != nullptr && HasBit(statspec->blocked, GetStationGfx(tile));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a rail station tile shall have pylons when electrified.
|
||||||
|
* @param tile %Tile to test.
|
||||||
|
* @return Tile shall have pylons.
|
||||||
|
* @note This could be cached (during build) in the map array to save on all the dereferencing.
|
||||||
|
*/
|
||||||
|
bool CanStationTileHavePylons(TileIndex tile)
|
||||||
|
{
|
||||||
|
const StationSpec *statspec = GetStationSpec(tile);
|
||||||
|
uint gfx = GetStationGfx(tile);
|
||||||
|
/* Default stations do not draw pylons under roofs (gfx >= 4) */
|
||||||
|
return statspec != nullptr ? HasBit(statspec->pylons, gfx) : gfx < 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a rail station tile shall have wires when electrified.
|
||||||
|
* @param tile %Tile to test.
|
||||||
|
* @return Tile shall have wires.
|
||||||
|
* @note This could be cached (during build) in the map array to save on all the dereferencing.
|
||||||
|
*/
|
||||||
|
bool CanStationTileHaveWires(TileIndex tile)
|
||||||
|
{
|
||||||
|
const StationSpec *statspec = GetStationSpec(tile);
|
||||||
|
return statspec == nullptr || !HasBit(statspec->wires, GetStationGfx(tile));
|
||||||
|
}
|
||||||
|
|
||||||
/** Wrapper for animation control, see GetStationCallback. */
|
/** Wrapper for animation control, see GetStationCallback. */
|
||||||
uint16_t GetAnimStationCallback(CallbackID callback, uint32_t param1, uint32_t param2, const StationSpec *statspec, BaseStation *st, TileIndex tile, int)
|
uint16_t GetAnimStationCallback(CallbackID callback, uint32_t param1, uint32_t param2, const StationSpec *statspec, BaseStation *st, TileIndex tile, int)
|
||||||
{
|
{
|
||||||
|
|
|
@ -47,7 +47,6 @@
|
||||||
#include "../subsidy_base.h"
|
#include "../subsidy_base.h"
|
||||||
#include "../subsidy_func.h"
|
#include "../subsidy_func.h"
|
||||||
#include "../newgrf.h"
|
#include "../newgrf.h"
|
||||||
#include "../newgrf_station.h"
|
|
||||||
#include "../engine_func.h"
|
#include "../engine_func.h"
|
||||||
#include "../rail_gui.h"
|
#include "../rail_gui.h"
|
||||||
#include "../core/backup_type.hpp"
|
#include "../core/backup_type.hpp"
|
||||||
|
@ -2857,26 +2856,6 @@ bool AfterLoadGame()
|
||||||
_settings_game.script.settings_profile = IsInsideMM(_old_diff_level, SP_BEGIN, SP_END) ? _old_diff_level : (uint)SP_MEDIUM;
|
_settings_game.script.settings_profile = IsInsideMM(_old_diff_level, SP_BEGIN, SP_END) ? _old_diff_level : (uint)SP_MEDIUM;
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
/* Station blocked, wires and pylon flags need to be stored in the map. This is effectively cached data, so no
|
|
||||||
* version check is necessary. This is done here as the SLV_182 check below needs the blocked status. */
|
|
||||||
for (auto t : Map::Iterate()) {
|
|
||||||
if (HasStationTileRail(t)) {
|
|
||||||
StationGfx gfx = GetStationGfx(t);
|
|
||||||
const StationSpec *statspec = GetStationSpec(t);
|
|
||||||
|
|
||||||
bool blocked = statspec != nullptr && HasBit(statspec->blocked, gfx);
|
|
||||||
/* Default stations do not draw pylons under roofs (gfx >= 4) */
|
|
||||||
bool pylons = statspec != nullptr ? HasBit(statspec->pylons, gfx) : gfx < 4;
|
|
||||||
bool wires = statspec == nullptr || !HasBit(statspec->wires, gfx);
|
|
||||||
|
|
||||||
SetStationTileBlocked(t, blocked);
|
|
||||||
SetStationTileHavePylons(t, pylons);
|
|
||||||
SetStationTileHaveWires(t, wires);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (IsSavegameVersionBefore(SLV_182)) {
|
if (IsSavegameVersionBefore(SLV_182)) {
|
||||||
/* Aircraft acceleration variable was bonkers */
|
/* Aircraft acceleration variable was bonkers */
|
||||||
for (Aircraft *v : Aircraft::Iterate()) {
|
for (Aircraft *v : Aircraft::Iterate()) {
|
||||||
|
|
|
@ -1466,18 +1466,7 @@ CommandCost CmdBuildRailStation(DoCommandFlag flags, TileIndex tile_org, RailTyp
|
||||||
SetStationTileRandomBits(tile, GB(Random(), 0, 4));
|
SetStationTileRandomBits(tile, GB(Random(), 0, 4));
|
||||||
SetAnimationFrame(tile, 0);
|
SetAnimationFrame(tile, 0);
|
||||||
|
|
||||||
/* Should be the same as layout but axis component could be wrong... */
|
if (!IsStationTileBlocked(tile)) c->infrastructure.rail[rt]++;
|
||||||
StationGfx gfx = GetStationGfx(tile);
|
|
||||||
bool blocked = statspec != nullptr && HasBit(statspec->blocked, gfx);
|
|
||||||
/* Default stations do not draw pylons under roofs (gfx >= 4) */
|
|
||||||
bool pylons = statspec != nullptr ? HasBit(statspec->pylons, gfx) : gfx < 4;
|
|
||||||
bool wires = statspec == nullptr || !HasBit(statspec->wires, gfx);
|
|
||||||
|
|
||||||
SetStationTileBlocked(tile, blocked);
|
|
||||||
SetStationTileHavePylons(tile, pylons);
|
|
||||||
SetStationTileHaveWires(tile, wires);
|
|
||||||
|
|
||||||
if (!blocked) c->infrastructure.rail[rt]++;
|
|
||||||
c->infrastructure.station++;
|
c->infrastructure.station++;
|
||||||
|
|
||||||
if (statspec != nullptr) {
|
if (statspec != nullptr) {
|
||||||
|
|
|
@ -43,6 +43,12 @@ void UpdateStationDockingTiles(Station *st);
|
||||||
void RemoveDockingTile(TileIndex t);
|
void RemoveDockingTile(TileIndex t);
|
||||||
void ClearDockingTilesCheckingNeighbours(TileIndex tile);
|
void ClearDockingTilesCheckingNeighbours(TileIndex tile);
|
||||||
|
|
||||||
|
/* Check if a rail station tile is traversable. */
|
||||||
|
bool IsStationTileBlocked(TileIndex tile);
|
||||||
|
|
||||||
|
bool CanStationTileHavePylons(TileIndex tile);
|
||||||
|
bool CanStationTileHaveWires(TileIndex tile);
|
||||||
|
|
||||||
void UpdateAirportsNoise();
|
void UpdateAirportsNoise();
|
||||||
|
|
||||||
bool SplitGroundSpriteForOverlay(const TileInfo *ti, SpriteID *ground, RailTrackOffset *overlay_offset);
|
bool SplitGroundSpriteForOverlay(const TileInfo *ti, SpriteID *ground, RailTrackOffset *overlay_offset);
|
||||||
|
|
|
@ -329,78 +329,6 @@ static inline bool IsHangarTile(Tile t)
|
||||||
return IsTileType(t, MP_STATION) && IsHangar(t);
|
return IsTileType(t, MP_STATION) && IsHangar(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Is tile \a t a blocked tile?
|
|
||||||
* @pre HasStationRail(t)
|
|
||||||
* @param t Tile to check
|
|
||||||
* @return \c true if the tile is blocked
|
|
||||||
*/
|
|
||||||
static inline bool IsStationTileBlocked(Tile t)
|
|
||||||
{
|
|
||||||
assert(HasStationRail(t));
|
|
||||||
return HasBit(t.m6(), 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the blocked state of the rail station
|
|
||||||
* @pre HasStationRail(t)
|
|
||||||
* @param t the station tile
|
|
||||||
* @param b the blocked state
|
|
||||||
*/
|
|
||||||
static inline void SetStationTileBlocked(Tile t, bool b)
|
|
||||||
{
|
|
||||||
assert(HasStationRail(t));
|
|
||||||
SB(t.m6(), 0, 1, b ? 1 : 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Can tile \a t have catenary wires?
|
|
||||||
* @pre HasStationRail(t)
|
|
||||||
* @param t Tile to check
|
|
||||||
* @return \c true if the tile can have catenary wires
|
|
||||||
*/
|
|
||||||
static inline bool CanStationTileHaveWires(Tile t)
|
|
||||||
{
|
|
||||||
assert(HasStationRail(t));
|
|
||||||
return HasBit(t.m6(), 6);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the catenary wires state of the rail station
|
|
||||||
* @pre HasStationRail(t)
|
|
||||||
* @param t the station tile
|
|
||||||
* @param b the catenary wires state
|
|
||||||
*/
|
|
||||||
static inline void SetStationTileHaveWires(Tile t, bool b)
|
|
||||||
{
|
|
||||||
assert(HasStationRail(t));
|
|
||||||
SB(t.m6(), 6, 1, b ? 1 : 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Can tile \a t have catenary pylons?
|
|
||||||
* @pre HasStationRail(t)
|
|
||||||
* @param t Tile to check
|
|
||||||
* @return \c true if the tile can have catenary pylons
|
|
||||||
*/
|
|
||||||
static inline bool CanStationTileHavePylons(Tile t)
|
|
||||||
{
|
|
||||||
assert(HasStationRail(t));
|
|
||||||
return HasBit(t.m6(), 7);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the catenary pylon state of the rail station
|
|
||||||
* @pre HasStationRail(t)
|
|
||||||
* @param t the station tile
|
|
||||||
* @param b the catenary pylons state
|
|
||||||
*/
|
|
||||||
static inline void SetStationTileHavePylons(Tile t, bool b)
|
|
||||||
{
|
|
||||||
assert(HasStationRail(t));
|
|
||||||
SB(t.m6(), 7, 1, b ? 1 : 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the rail direction of a rail station.
|
* Get the rail direction of a rail station.
|
||||||
* @param t Tile to query
|
* @param t Tile to query
|
||||||
|
@ -451,10 +379,10 @@ static inline TrackBits GetRailStationTrackBits(Tile t)
|
||||||
static inline bool IsCompatibleTrainStationTile(Tile test_tile, Tile station_tile)
|
static inline bool IsCompatibleTrainStationTile(Tile test_tile, Tile station_tile)
|
||||||
{
|
{
|
||||||
assert(IsRailStationTile(station_tile));
|
assert(IsRailStationTile(station_tile));
|
||||||
return IsRailStationTile(test_tile) && !IsStationTileBlocked(test_tile) &&
|
return IsRailStationTile(test_tile) && IsCompatibleRail(GetRailType(test_tile), GetRailType(station_tile)) &&
|
||||||
IsCompatibleRail(GetRailType(test_tile), GetRailType(station_tile)) &&
|
|
||||||
GetRailStationAxis(test_tile) == GetRailStationAxis(station_tile) &&
|
GetRailStationAxis(test_tile) == GetRailStationAxis(station_tile) &&
|
||||||
GetStationIndex(test_tile) == GetStationIndex(station_tile);
|
GetStationIndex(test_tile) == GetStationIndex(station_tile) &&
|
||||||
|
!IsStationTileBlocked(test_tile);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -277,18 +277,6 @@ CommandCost CmdBuildRailWaypoint(DoCommandFlag flags, TileIndex start_tile, Axis
|
||||||
HasStationReservation(tile);
|
HasStationReservation(tile);
|
||||||
MakeRailWaypoint(tile, wp->owner, wp->index, axis, layout_ptr[i], GetRailType(tile));
|
MakeRailWaypoint(tile, wp->owner, wp->index, axis, layout_ptr[i], GetRailType(tile));
|
||||||
SetCustomStationSpecIndex(tile, map_spec_index);
|
SetCustomStationSpecIndex(tile, map_spec_index);
|
||||||
|
|
||||||
/* Should be the same as layout but axis component could be wrong... */
|
|
||||||
StationGfx gfx = GetStationGfx(tile);
|
|
||||||
bool blocked = spec != nullptr && HasBit(spec->blocked, gfx);
|
|
||||||
/* Default stations do not draw pylons under roofs (gfx >= 4) */
|
|
||||||
bool pylons = spec != nullptr ? HasBit(spec->pylons, gfx) : gfx < 4;
|
|
||||||
bool wires = spec == nullptr || !HasBit(spec->wires, gfx);
|
|
||||||
|
|
||||||
SetStationTileBlocked(tile, blocked);
|
|
||||||
SetStationTileHavePylons(tile, pylons);
|
|
||||||
SetStationTileHaveWires(tile, wires);
|
|
||||||
|
|
||||||
SetRailStationReservation(tile, reserved);
|
SetRailStationReservation(tile, reserved);
|
||||||
MarkTileDirtyByTile(tile);
|
MarkTileDirtyByTile(tile);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue