From 7ae06124ae4467188f783b61ad7622d1b39db5c1 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Sun, 19 Jun 2022 01:55:38 +0100 Subject: [PATCH] Add signal style flag for no aspect increase behaviour (banner repeater) --- docs/newgrf-additions-nml.html | 6 ++++ docs/newgrf-additions.html | 7 ++++ src/lang/english.txt | 1 + src/misc.cpp | 1 + src/newgrf.cpp | 9 +++++ src/newgrf_extension.cpp | 1 + src/newgrf_extension.h | 1 + src/newgrf_newsignals.h | 7 +++- src/openttd.cpp | 1 + src/rail_cmd.cpp | 6 +++- src/saveload/afterload.cpp | 1 + src/saveload/extended_ver_sl.cpp | 2 +- src/saveload/misc_sl.cpp | 7 ++-- src/signal.cpp | 61 +++++++++++++++++++++++++------- src/signal_func.h | 11 +++++- 15 files changed, 104 insertions(+), 18 deletions(-) diff --git a/docs/newgrf-additions-nml.html b/docs/newgrf-additions-nml.html index 782f29635b..3902597023 100644 --- a/docs/newgrf-additions-nml.html +++ b/docs/newgrf-additions-nml.html @@ -460,6 +460,12 @@ item (FEAT_GLOBALVARS) { This property should be used if using the define_style property, as otherwise the style will have no name. + style_no_aspect_increase0 or 1 + + Set whether the most recently defined style (defined using the define_style property) does not increase + the signal aspect with respect to the signals either side (i.e. function like a banner repeater). + + no_default_style0 or 1 When enabled, custom signal graphics from this GRF are only used for custom signal styles, not the default style diff --git a/docs/newgrf-additions.html b/docs/newgrf-additions.html index c880899f1f..7e1170ee47 100644 --- a/docs/newgrf-additions.html +++ b/docs/newgrf-additions.html @@ -431,6 +431,13 @@ The Action 0 Id field is not used, the value is ignored.

This is indicated by the feature name: action0_signals_style, version 1

+

Set custom signal style no aspect increase mode (mappable property: signals_style_no_aspect_increase)

+

This applies to the most recent custom signal style defined using the signals_define_style property.
+ When enabled, signals using this style do not increase the signal aspect with respect to the signals either side (i.e. function like a banner repeater).

+

The property length is 1 byte. 0 is disabled (default). 1 is enabled.
+ The Action 0 Id field is not used, the value is ignored. +

+

This is indicated by the feature name: action0_signals_style, version 1

Set whether custom signal sprites should not be used for the default signal style (mappable property: signals_no_default_style)

This applies to Action 2/3 Signals (Feature 0E) custom signal sprites for this GRF.
When enabled, this GRF is not used for the default signal style, it is only used for custom signal styles defined with signals_define_style.

diff --git a/src/lang/english.txt b/src/lang/english.txt index c8041b2ca5..51de0ab88b 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -6266,6 +6266,7 @@ STR_ERROR_CAN_T_REMOVE_SIGNALS_FROM :{WHITE}Can't re STR_ERROR_SIGNAL_CAN_T_CONVERT_SIGNALS_HERE :{WHITE}Can't convert signals here... STR_ERROR_THERE_IS_NO_RAILROAD_TRACK :{WHITE}... there is no railway track STR_ERROR_THERE_ARE_NO_SIGNALS :{WHITE}... there are no signals +STR_ERROR_UNSUITABLE_SIGNAL_TYPE :{WHITE}... unsuitable signal type STR_ERROR_CAN_T_CONVERT_RAIL :{WHITE}Can't convert rail type here... diff --git a/src/misc.cpp b/src/misc.cpp index b1a483c686..a0412c634c 100644 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -99,6 +99,7 @@ void InitializeGame(uint size_x, uint size_y, bool reset_date, bool reset_settin _extra_station_names_used = 0; _extra_station_names_probability = 0; _extra_aspects = 0; + _aspect_cfg_hash = 0; _loadgame_DBGL_data.clear(); if (reset_settings) MakeNewgameSettingsLive(); diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 72f37204e0..0a93687e0e 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -4225,6 +4225,15 @@ static ChangeInfoResult SignalsChangeInfo(uint id, int numinfo, int prop, const break; } + case A0RPI_SIGNALS_STYLE_NO_ASPECT_INCREASE: { + if (MappedPropertyLengthMismatch(buf, 1, mapping_entry)) break; + uint8 value = buf->ReadByte(); + if (_cur.grffile->current_new_signal_style != nullptr) { + SB(_cur.grffile->current_new_signal_style->style_flags, NSSF_NO_ASPECT_INC, 1, (value != 0 ? 1 : 0)); + } + break; + } + default: ret = HandleAction0PropertyDefault(buf, prop); break; diff --git a/src/newgrf_extension.cpp b/src/newgrf_extension.cpp index 16b7de4383..18e8dc2ac6 100644 --- a/src/newgrf_extension.cpp +++ b/src/newgrf_extension.cpp @@ -94,6 +94,7 @@ extern const GRFPropertyMapDefinition _grf_action0_remappable_properties[] = { GRFPropertyMapDefinition(GSF_SIGNALS, A0RPI_SIGNALS_NO_DEFAULT_STYLE, "signals_no_default_style"), GRFPropertyMapDefinition(GSF_SIGNALS, A0RPI_SIGNALS_DEFINE_STYLE, "signals_define_style"), GRFPropertyMapDefinition(GSF_SIGNALS, A0RPI_SIGNALS_STYLE_NAME, "signals_style_name"), + GRFPropertyMapDefinition(GSF_SIGNALS, A0RPI_SIGNALS_STYLE_NO_ASPECT_INCREASE, "signals_style_no_aspect_increase"), GRFPropertyMapDefinition(GSF_OBJECTS, A0RPI_OBJECT_USE_LAND_GROUND, "object_use_land_ground"), GRFPropertyMapDefinition(GSF_OBJECTS, A0RPI_OBJECT_EDGE_FOUNDATION_MODE, "object_edge_foundation_mode"), GRFPropertyMapDefinition(GSF_OBJECTS, A0RPI_OBJECT_FLOOD_RESISTANT, "object_flood_resistant"), diff --git a/src/newgrf_extension.h b/src/newgrf_extension.h index ca2824e56e..b0d9632e61 100644 --- a/src/newgrf_extension.h +++ b/src/newgrf_extension.h @@ -38,6 +38,7 @@ enum Action0RemapPropertyIds { A0RPI_SIGNALS_NO_DEFAULT_STYLE, A0RPI_SIGNALS_DEFINE_STYLE, A0RPI_SIGNALS_STYLE_NAME, + A0RPI_SIGNALS_STYLE_NO_ASPECT_INCREASE, A0RPI_OBJECT_USE_LAND_GROUND, A0RPI_OBJECT_EDGE_FOUNDATION_MODE, A0RPI_OBJECT_FLOOD_RESISTANT, diff --git a/src/newgrf_newsignals.h b/src/newgrf_newsignals.h index 41df70775f..14776e908b 100644 --- a/src/newgrf_newsignals.h +++ b/src/newgrf_newsignals.h @@ -24,10 +24,15 @@ enum { MAX_NEW_SIGNAL_STYLES = 15, }; +enum NewSignalStyleFlags { + NSSF_NO_ASPECT_INC = 0, +}; + struct NewSignalStyle { const GRFFile *grffile; - StringID name = 0; + StringID name; uint8 grf_local_id; + uint8 style_flags; PalSpriteID signals[SIGTYPE_END][2][2]; }; diff --git a/src/openttd.cpp b/src/openttd.cpp index ae49d20841..cb84cf535f 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -476,6 +476,7 @@ static void ShutdownGame() _extra_station_names_used = 0; _extra_station_names_probability = 0; _extra_aspects = 0; + _aspect_cfg_hash = 0; _loadgame_DBGL_data.clear(); _loadgame_DBGC_data.clear(); } diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp index a9506ce75f..e892339aa2 100644 --- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -1517,7 +1517,10 @@ CommandCost CmdBuildSingleSignal(TileIndex tile, DoCommandFlag flags, uint32 p1, bool p2_active = p2_signal_in || p2_signal_out; if (!IsTunnelBridgeWithSignalSimulation(tile)) { // toggle signal zero costs. if (convert_signal) return_cmd_error(STR_ERROR_THERE_ARE_NO_SIGNALS); - if (!(p2_signal_in && p2_signal_out)) cost = CommandCost(EXPENSES_CONSTRUCTION, _price[PR_BUILD_SIGNALS] * ((GetTunnelBridgeLength(tile, tile_exit) + 4) >> 2) * (bidirectional ? 2 : 1)); // minimal 1 + if (!(p2_signal_in && p2_signal_out)) { + cost = CommandCost(EXPENSES_CONSTRUCTION, _price[PR_BUILD_SIGNALS] * ((GetTunnelBridgeLength(tile, tile_exit) + 4) >> 2) * (bidirectional ? 2 : 1)); // minimal 1 + if (HasBit(_no_tunnel_bridge_style_mask, signal_style)) return_cmd_error(STR_ERROR_UNSUITABLE_SIGNAL_TYPE); + } } else { if (HasBit(p1, 17)) return CommandCost(); bool is_bidi = IsTunnelBridgeSignalSimulationBidirectional(tile); @@ -1526,6 +1529,7 @@ CommandCost CmdBuildSingleSignal(TileIndex tile, DoCommandFlag flags, uint32 p1, if (convert_signal) { will_be_bidi = bidirectional && !ctrl_pressed; change_style = (signal_style != GetTunnelBridgeSignalStyle(tile)); + if (HasBit(_no_tunnel_bridge_style_mask, signal_style)) return_cmd_error(STR_ERROR_UNSUITABLE_SIGNAL_TYPE); } else if (ctrl_pressed) { will_be_bidi = false; } diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index 271a18c11b..1a2ca35cb9 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -3670,6 +3670,7 @@ bool AfterLoadGame() } /* force aspect re-calculation */ _extra_aspects = 0; + _aspect_cfg_hash = 0; } if (SlXvIsFeatureMissing(XSLFI_CUSTOM_BRIDGE_HEADS)) { diff --git a/src/saveload/extended_ver_sl.cpp b/src/saveload/extended_ver_sl.cpp index 67951d4067..fa77378927 100644 --- a/src/saveload/extended_ver_sl.cpp +++ b/src/saveload/extended_ver_sl.cpp @@ -151,7 +151,7 @@ const SlxiSubChunkInfo _sl_xv_sub_chunk_infos[] = { { XSLFI_ANIMATED_TILE_EXTRA, XSCF_NULL, 1, 1, "animated_tile_extra", nullptr, nullptr, nullptr }, { XSLFI_NEWGRF_INFO_EXTRA, XSCF_NULL, 1, 1, "newgrf_info_extra", nullptr, nullptr, nullptr }, { XSLFI_INDUSTRY_CARGO_ADJ, XSCF_IGNORABLE_UNKNOWN, 1, 1, "industry_cargo_adj", nullptr, nullptr, nullptr }, - { XSLFI_REALISTIC_TRAIN_BRAKING,XSCF_NULL, 6, 6, "realistic_train_braking", nullptr, nullptr, "VLKA" }, + { XSLFI_REALISTIC_TRAIN_BRAKING,XSCF_NULL, 7, 7, "realistic_train_braking", nullptr, nullptr, "VLKA" }, { XSLFI_INFLATION_FIXED_DATES, XSCF_IGNORABLE_ALL, 1, 1, "inflation_fixed_dates", nullptr, nullptr, nullptr }, { XSLFI_WATER_FLOODING, XSCF_NULL, 2, 2, "water_flooding", nullptr, nullptr, nullptr }, { XSLFI_MORE_HOUSES, XSCF_NULL, 2, 2, "more_houses", nullptr, nullptr, nullptr }, diff --git a/src/saveload/misc_sl.cpp b/src/saveload/misc_sl.cpp index ddd9db4cd5..13bdae69ec 100644 --- a/src/saveload/misc_sl.cpp +++ b/src/saveload/misc_sl.cpp @@ -28,6 +28,7 @@ extern TileIndex _cur_tileloop_tile; extern uint16 _disaster_delay; extern byte _trees_tick_ctr; extern uint8 _extra_aspects; +extern uint64 _aspect_cfg_hash; /* Keep track of current game position */ int _saved_scrollpos_x; @@ -97,7 +98,8 @@ static const SaveLoad _date_desc[] = { SLEG_CONDVAR(_pause_mode, SLE_UINT8, SLV_4, SL_MAX_VERSION), SLEG_CONDVAR_X(_game_events_overall, SLE_UINT32, SL_MIN_VERSION, SL_MAX_VERSION, SlXvFeatureTest(XSLFTO_AND, XSLFI_GAME_EVENTS)), SLEG_CONDVAR_X(_road_layout_change_counter, SLE_UINT32, SL_MIN_VERSION, SL_MAX_VERSION, SlXvFeatureTest(XSLFTO_AND, XSLFI_ROAD_LAYOUT_CHANGE_CTR)), - SLEG_CONDVAR_X(_extra_aspects, SLE_UINT8, SL_MIN_VERSION, SL_MAX_VERSION, SlXvFeatureTest(XSLFTO_AND, XSLFI_REALISTIC_TRAIN_BRAKING, 4)), + SLE_CONDNULL_X(1, SL_MIN_VERSION, SL_MAX_VERSION, SlXvFeatureTest(XSLFTO_AND, XSLFI_REALISTIC_TRAIN_BRAKING, 4, 6)), // _extra_aspects + SLEG_CONDVAR_X(_aspect_cfg_hash, SLE_UINT64, SL_MIN_VERSION, SL_MAX_VERSION, SlXvFeatureTest(XSLFTO_AND, XSLFI_REALISTIC_TRAIN_BRAKING, 7)), SLE_CONDNULL(4, SLV_11, SLV_120), }; @@ -126,7 +128,8 @@ static const SaveLoad _date_check_desc[] = { SLE_CONDNULL(1, SLV_4, SL_MAX_VERSION), // _pause_mode SLE_CONDNULL_X(4, SL_MIN_VERSION, SL_MAX_VERSION, SlXvFeatureTest(XSLFTO_AND, XSLFI_GAME_EVENTS)), // _game_events_overall SLE_CONDNULL_X(4, SL_MIN_VERSION, SL_MAX_VERSION, SlXvFeatureTest(XSLFTO_AND, XSLFI_ROAD_LAYOUT_CHANGE_CTR)), // _road_layout_change_counter - SLE_CONDNULL_X(1, SL_MIN_VERSION, SL_MAX_VERSION, SlXvFeatureTest(XSLFTO_AND, XSLFI_REALISTIC_TRAIN_BRAKING, 4)), // _extra_aspects + SLE_CONDNULL_X(1, SL_MIN_VERSION, SL_MAX_VERSION, SlXvFeatureTest(XSLFTO_AND, XSLFI_REALISTIC_TRAIN_BRAKING, 4, 6)), // _extra_aspects + SLE_CONDNULL_X(8, SL_MIN_VERSION, SL_MAX_VERSION, SlXvFeatureTest(XSLFTO_AND, XSLFI_REALISTIC_TRAIN_BRAKING, 7)), // _aspect_cfg_hash SLE_CONDNULL(4, SLV_11, SLV_120), }; diff --git a/src/signal.cpp b/src/signal.cpp index 76d44f5840..1db24fd75e 100644 --- a/src/signal.cpp +++ b/src/signal.cpp @@ -23,10 +23,15 @@ #include "tunnelbridge.h" #include "bridge_signal_map.h" #include "newgrf_newsignals.h" +#include "core/checksum_func.hpp" +#include "core/hash_func.hpp" #include "safeguards.h" uint8 _extra_aspects = 0; +uint64 _aspect_cfg_hash = 0; +uint16 _non_aspect_inc_style_mask = 0; +uint16 _no_tunnel_bridge_style_mask = 0; bool _signal_sprite_oversized = false; /// List of signals dependent upon this one @@ -614,7 +619,9 @@ uint8 GetForwardAspectFollowingTrack(TileIndex tile, Trackdir trackdir) if (HasSignalOnTrack(tile, track)) { // now check whole track, not trackdir if (HasSignalOnTrackdir(tile, trackdir)) { if (GetSignalStateByTrackdir(tile, trackdir) == SIGNAL_STATE_RED) return 0; - return GetSignalAspect(tile, track); + uint8 aspect = GetSignalAspect(tile, track); + AdjustSignalAspectIfNonIncStyle(tile, track, aspect); + return aspect; } else if (IsOnewaySignal(tile, track)) { return 0; // one-way signal facing the wrong way } @@ -666,7 +673,7 @@ uint8 GetForwardAspectFollowingTrack(TileIndex tile, Trackdir trackdir) trackdir = TrackEnterdirToTrackdir(track, ReverseDiagDir(enterdir)); if (IsTunnelBridgeWithSignalSimulation(tile) && HasTrack(GetAcrossTunnelBridgeTrackBits(tile), track)) { - return GetSignalAspectGeneric(tile, trackdir); + return GetSignalAspectGeneric(tile, trackdir, false); } if (TrackdirEntersTunnelBridge(tile, trackdir)) { @@ -694,7 +701,7 @@ static uint8 GetForwardAspect(const SigInfo &info, TileIndex tile, Trackdir trac if (info.flags & SF_JUNCTION) { return GetForwardAspectFollowingTrack(tile, trackdir); } else { - return (info.out_signal_tile != INVALID_TILE) ? GetSignalAspectGeneric(info.out_signal_tile, info.out_signal_trackdir) : 0; + return (info.out_signal_tile != INVALID_TILE) ? GetSignalAspectGeneric(info.out_signal_tile, info.out_signal_trackdir, true) : 0; } } @@ -828,7 +835,7 @@ static void UpdateSignalsAroundSegment(SigInfo info) if (newstate == SIGNAL_STATE_GREEN) { aspect = 1; if (info.out_signal_tile != INVALID_TILE) { - aspect = std::min(GetSignalAspectGeneric(info.out_signal_tile, info.out_signal_trackdir) + 1, _extra_aspects + 1); + aspect = std::min(GetSignalAspectGeneric(info.out_signal_tile, info.out_signal_trackdir, true) + 1, _extra_aspects + 1); } } else { aspect = 0; @@ -1220,12 +1227,14 @@ void CheckRemoveSignal(TileIndex tile, Track track) } } -uint8 GetSignalAspectGeneric(TileIndex tile, Trackdir trackdir) +uint8 GetSignalAspectGeneric(TileIndex tile, Trackdir trackdir, bool check_non_inc_style) { switch (GetTileType(tile)) { case MP_RAILWAY: if (HasSignalOnTrackdir(tile, trackdir) && GetSignalStateByTrackdir(tile, trackdir) == SIGNAL_STATE_GREEN) { - return GetSignalAspect(tile, TrackdirToTrack(trackdir)); + uint8 aspect = GetSignalAspect(tile, TrackdirToTrack(trackdir)); + if (check_non_inc_style) AdjustSignalAspectIfNonIncStyle(tile, TrackdirToTrack(trackdir), aspect); + return aspect; } break; @@ -1245,6 +1254,11 @@ uint8 GetSignalAspectGeneric(TileIndex tile, Trackdir trackdir) return 0; } +void AdjustSignalAspectIfNonIncStyleIntl(TileIndex tile, Track track, uint8 &aspect) +{ + if (IsTileType(tile, MP_RAILWAY) && HasBit(_non_aspect_inc_style_mask, GetSignalStyle(tile, track))) aspect--; +} + static void RefreshBridgeOnExitAspectChange(TileIndex entrance, TileIndex exit) { const uint simulated_wormhole_signals = GetTunnelBridgeSignalSimulationSpacing(entrance); @@ -1263,6 +1277,8 @@ static void RefreshBridgeOnExitAspectChange(TileIndex entrance, TileIndex exit) void PropagateAspectChange(TileIndex tile, Trackdir trackdir, uint8 aspect) { + AdjustSignalAspectIfNonIncStyle(tile, TrackdirToTrack(trackdir), aspect); + aspect = std::min(aspect + 1, _extra_aspects + 1); Owner owner = GetTileOwner(tile); DiagDirection exitdir = TrackdirToExitdir(ReverseTrackdir(trackdir)); @@ -1310,6 +1326,7 @@ void PropagateAspectChange(TileIndex tile, Trackdir trackdir, uint8 aspect) if (GetSignalAspect(tile, track) == aspect) return; // aspect already correct SetSignalAspect(tile, track, aspect); MarkSingleSignalDirty(tile, reversedir); + AdjustSignalAspectIfNonIncStyle(tile, TrackdirToTrack(trackdir), aspect); aspect = std::min(aspect + 1, _extra_aspects + 1); } else if (IsOnewaySignal(tile, track)) { return; // one-way signal facing the wrong way @@ -1479,10 +1496,14 @@ void UpdateAllSignalAspects() } } -static uint8 DetermineExtraAspectsVariable() +static bool DetermineExtraAspectsVariable() { + bool changed = false; uint8 new_extra_aspects = 0; + _non_aspect_inc_style_mask = 0; + _no_tunnel_bridge_style_mask = 0; + if (_settings_game.vehicle.train_braking_model == TBM_REALISTIC) { for (RailType r = RAILTYPE_BEGIN; r != RAILTYPE_END; r++) { const RailtypeInfo *rti = GetRailTypeInfo(r); @@ -1491,17 +1512,33 @@ static uint8 DetermineExtraAspectsVariable() for (const GRFFile *grf : _new_signals_grfs) { new_extra_aspects = std::max(new_extra_aspects, grf->new_signal_extra_aspects); } + for (uint i = 0; i < _num_new_signal_styles; i++) { + if (HasBit(_new_signal_styles[i].style_flags, NSSF_NO_ASPECT_INC)) { + SetBit(_non_aspect_inc_style_mask, i + 1); + SetBit(_no_tunnel_bridge_style_mask, i + 1); + } + } + } + + _extra_aspects = new_extra_aspects; + + SimpleChecksum64 checksum; + checksum.Update(SimpleHash32(_extra_aspects)); + checksum.Update(SimpleHash32(_non_aspect_inc_style_mask)); + + if (checksum.state != _aspect_cfg_hash) { + _aspect_cfg_hash = checksum.state; + changed = true; } - return new_extra_aspects; + return changed; } void UpdateExtraAspectsVariable() { - uint8 new_extra_aspects = DetermineExtraAspectsVariable(); + bool changed = DetermineExtraAspectsVariable(); - if (new_extra_aspects != _extra_aspects) { - _extra_aspects = new_extra_aspects; + if (changed) { if (_extra_aspects > 0) UpdateAllSignalAspects(); MarkWholeScreenDirty(); } @@ -1509,5 +1546,5 @@ void UpdateExtraAspectsVariable() void InitialiseExtraAspectsVariable() { - _extra_aspects = DetermineExtraAspectsVariable(); + DetermineExtraAspectsVariable(); } diff --git a/src/signal_func.h b/src/signal_func.h index 4ea4ab1ac1..0021179654 100644 --- a/src/signal_func.h +++ b/src/signal_func.h @@ -20,6 +20,9 @@ #include "vehicle_type.h" extern uint8 _extra_aspects; +extern uint64 _aspect_cfg_hash; +extern uint16 _non_aspect_inc_style_mask; +extern uint16 _no_tunnel_bridge_style_mask; extern bool _signal_sprite_oversized; /** @@ -170,7 +173,7 @@ void AddSideToSignalBuffer(TileIndex tile, DiagDirection side, Owner owner); void UpdateSignalsInBuffer(); void UpdateSignalsInBufferIfOwnerNotAddable(Owner owner); uint8 GetForwardAspectFollowingTrack(TileIndex tile, Trackdir trackdir); -uint8 GetSignalAspectGeneric(TileIndex tile, Trackdir trackdir); +uint8 GetSignalAspectGeneric(TileIndex tile, Trackdir trackdir, bool check_non_inc_style); void PropagateAspectChange(TileIndex tile, Trackdir trackdir, uint8 aspect); void UpdateAspectDeferred(TileIndex tile, Trackdir trackdir); void FlushDeferredAspectUpdates(); @@ -178,6 +181,12 @@ void UpdateAllSignalAspects(); void UpdateExtraAspectsVariable(); void InitialiseExtraAspectsVariable(); +inline void AdjustSignalAspectIfNonIncStyle(TileIndex tile, Track track, uint8 &aspect) +{ + extern void AdjustSignalAspectIfNonIncStyleIntl(TileIndex tile, Track track, uint8 &aspect); + if (aspect > 0 && _non_aspect_inc_style_mask != 0) AdjustSignalAspectIfNonIncStyleIntl(tile, track, aspect); +} + inline uint8 GetForwardAspectFollowingTrackAndIncrement(TileIndex tile, Trackdir trackdir) { return std::min(GetForwardAspectFollowingTrack(tile, trackdir) + 1, _extra_aspects + 1);