74 GrfMsg(1,
"RoadStopChangeInfo: RoadStop {} is invalid, max {}, ignoring", last,
NUM_ROADSTOPS_PER_GRF);
78 if (_cur_gps.grffile->roadstops.size() < last) _cur_gps.grffile->roadstops.resize(last);
80 for (uint
id = first;
id < last; ++id) {
81 auto &rs = _cur_gps.grffile->roadstops[id];
83 if (rs ==
nullptr && prop != 0x08) {
84 GrfMsg(1,
"RoadStopChangeInfo: Attempt to modify undefined road stop {}, ignoring",
id);
86 if (cir > ret) ret = cir;
93 rs = std::make_unique<RoadStopSpec>();
122 rs->animation.frames = buf.
ReadByte();
127 rs->animation.speed = buf.
ReadByte();
144 for (uint j = 0; j != tiles; ++j) {
145 if (j < std::size(rs->bridgeable_info)) {
146 rs->bridgeable_info[j].height = buf.
ReadByte();
156 for (uint j = 0; j != tiles; ++j) {
157 if (j < std::size(rs->bridgeable_info)) {
167 rs->build_cost_multiplier = buf.
ReadByte();
168 rs->clear_cost_multiplier = buf.
ReadByte();
constexpr enable_if_t< is_integral_v< T >, T > byteswap(T x) noexcept
Custom implementation of std::byteswap; remove once we build with C++23.
EnumBitSet< BridgePillarFlag, uint8_t > BridgePillarFlags
Bitset of BridgePillarFlag elements.
Class to read from a NewGRF file.
uint32_t ReadDWord()
Read a single DWord (32 bits).
uint16_t ReadWord()
Read a single Word (16 bits).
uint16_t ReadExtendedByte()
Read a single Extended Byte (8 or 16 bits).
uint8_t ReadByte()
Read a single byte (8 bits).
static RoadStopClassID Allocate(uint32_t global_id)
static NewGRFClass * Get(RoadStopClassID class_index)
StringID name
Name of this class.
Functions related to debugging.
CargoTypes TranslateRefitMask(uint32_t refit_mask)
Translate the refit mask.
@ RoadStops
Road stops feature.
std::vector< BadgeID > ReadBadgeList(ByteReader &buf, GrfSpecFeature feature)
Read a list of badges.
void SkipBadgeList(ByteReader &buf)
Skip a list of badges.
static ChangeInfoResult IgnoreRoadStopProperty(uint prop, ByteReader &buf)
Ignore properties for roadstops.
AnimationStatus
Statuses of animation within NewGRFs.
NewGRF buffer reader definition.
EnumBitSet< RoadStopCallbackMask, uint8_t > RoadStopCallbackMasks
Bitset of RoadStopCallbackMask elements.
Functions for NewGRF engines.
NewGRF internal processing state.
ChangeInfoResult
Possible return values for the GrfChangeInfoHandler functions.
@ Success
Variable was parsed and read.
@ Unhandled
Variable was parsed but unread.
@ Unknown
Variable is unknown.
@ InvalidId
Attempt to modify an invalid ID.
NewGRF definitions and structures for road stops.
EnumBitSet< RoadStopSpecFlag, uint8_t > RoadStopSpecFlags
Bitset of RoadStopSpecFlag elements.
EnumBitSet< RoadStopDrawMode, uint8_t > RoadStopDrawModes
Bitset of RoadStopDrawMode elements.
RoadStopAvailabilityType
Various different options for availability, restricting the roadstop to be only for busses or for tru...
static const int NUM_ROADSTOPS_PER_GRF
The maximum amount of roadstops a single GRF is allowed to add.
void AddStringForMapping(GRFStringID source, std::function< void(StringID)> &&func)
Record a static StringID for getting translated later.
NewGRF string mapping definition.
StrongType::Typedef< uint32_t, struct GRFStringIDTag, StrongType::Compare, StrongType::Integer > GRFStringID
Type for GRF-internal string IDs.
A number of safeguards to prevent using unsafe methods.
EnumBitSet< StationAnimationTrigger, uint16_t > StationAnimationTriggers
Bitset of StationAnimationTrigger elements.
Definition of base types and functions in a cross-platform compatible way.
uint32_t StringID
Numeric value that represents a string, independent of the selected language.
static ChangeInfoResult Reserve(uint first, uint last, int prop, ByteReader &buf)
Implementation of the GrfLoadingStage::Reserve stage of this feature.
static ChangeInfoResult Activation(uint first, uint last, int prop, ByteReader &buf)
Implementation of the GrfLoadingStage::Activation stage of this feature.