1
0
Fork 0

Codechange: Rename GRFFileProps to SubstituteGRFFileProps.

pull/14139/head
frosch 2025-04-26 20:08:10 +02:00 committed by frosch
parent 298e02d593
commit 46494c6d44
9 changed files with 16 additions and 14 deletions

View File

@ -106,7 +106,7 @@ struct HouseSpec {
bool enabled; ///< the house is available to build (true by default, but can be disabled by newgrf)
/* NewHouses properties */
GRFFileProps grf_prop; ///< Properties related the the grf file
SubstituteGRFFileProps grf_prop; ///< Properties related the the grf file
HouseCallbackMasks callback_mask; ///< Bitmask of house callbacks that have to be called
Colours random_colour[4]; ///< 4 "random" colours
uint8_t probability; ///< Relative probability of appearing (16 is the standard value)

View File

@ -131,7 +131,7 @@ struct IndustrySpec {
/* Newgrf data */
IndustryCallbackMasks callback_mask; ///< Bitmask of industry callbacks that have to be called
bool enabled; ///< entity still available (by default true).newgrf can disable it, though
GRFFileProps grf_prop; ///< properties related to the grf file
SubstituteGRFFileProps grf_prop; ///< properties related to the grf file
std::vector<uint8_t> random_sounds; ///< Random sounds;
std::vector<BadgeID> badges;
@ -165,7 +165,7 @@ struct IndustryTileSpec {
AnimationInfo<IndustryAnimationTriggers> animation; ///< Information about the animation (is it looping, how many loops etc)
IndustryTileSpecialFlags special_flags; ///< Bitmask of extra flags used by the tile
bool enabled; ///< entity still available (by default true).newgrf can disable it, though
GRFFileProps grf_prop; ///< properties related to the grf file
SubstituteGRFFileProps grf_prop; ///< properties related to the grf file
std::vector<BadgeID> badges;
std::array<std::variant<CargoLabel, MixedCargoType>, INDUSTRY_ORIGINAL_NUM_INPUTS> accepts_cargo_label; ///< Cargo labels of accepted cargo for default industry tiles.

View File

@ -119,7 +119,7 @@ struct AirportSpec : NewGRFSpecBase<AirportClassID> {
uint16_t maintenance_cost; ///< maintenance cost multiplier
/* Newgrf data */
bool enabled; ///< Entity still available (by default true). Newgrf can disable it, though.
struct GRFFileProps grf_prop; ///< Properties related to the grf file.
SubstituteGRFFileProps grf_prop; ///< Properties related to the grf file.
std::vector<BadgeID> badges;
static const AirportSpec *Get(uint8_t type);

View File

@ -73,7 +73,7 @@ struct AirportTileSpec {
AirportTileCallbackMasks callback_mask; ///< Bitmask telling which grf callback is set
uint8_t animation_special_flags; ///< Extra flags to influence the animation
bool enabled; ///< entity still available (by default true). newgrf can disable it, though
GRFFileProps grf_prop; ///< properties related the the grf file
SubstituteGRFFileProps grf_prop; ///< properties related the the grf file
std::vector<BadgeID> badges;
static const AirportTileSpec *Get(StationGfx gfx);

View File

@ -394,10 +394,12 @@ struct CargoGRFFileProps : VariableGRFFileProps<CargoType> {
static constexpr CargoType SG_DEFAULT_NA = NUM_CARGO + 2; ///< Used only by stations and roads when no more-specific cargo matches.
};
/** Data related to the handling of grf files. */
struct GRFFileProps : SingleGRFFileProps {
/**
* NewGRF entities which can replace default entities.
*/
struct SubstituteGRFFileProps : SingleGRFFileProps {
/** Set all default data constructor for the props. */
constexpr GRFFileProps(uint16_t subst_id = 0) : subst_id(subst_id), override_id(subst_id) {}
constexpr SubstituteGRFFileProps(uint16_t subst_id = 0) : subst_id(subst_id), override_id(subst_id) {}
uint16_t subst_id;
uint16_t override_id; ///< id of the entity been replaced by

View File

@ -378,7 +378,7 @@ static const std::initializer_list<AirportTileLayout> _tile_table_helistation =
/** General AirportSpec definition. */
#define AS_GENERIC(fsm, layouts, depots, size_x, size_y, noise, catchment, min_year, max_year, maint_cost, ttdpatch_type, class_id, name, preview, enabled) \
{{class_id, 0}, fsm, layouts, depots, size_x, size_y, noise, catchment, TimerGameCalendar::Year{min_year}, TimerGameCalendar::Year{max_year}, name, ttdpatch_type, preview, maint_cost, enabled, GRFFileProps(AT_INVALID), {}}
{{class_id, 0}, fsm, layouts, depots, size_x, size_y, noise, catchment, TimerGameCalendar::Year{min_year}, TimerGameCalendar::Year{max_year}, name, ttdpatch_type, preview, maint_cost, enabled, SubstituteGRFFileProps(AT_INVALID), {}}
/** AirportSpec definition for airports without any depot. */
#define AS_ND(ap_name, size_x, size_y, min_year, max_year, catchment, noise, maint_cost, ttdpatch_type, class_id, name, preview) \

View File

@ -13,9 +13,9 @@
#include "table/strings.h"
/** Writes all airport tile properties in the AirportTile struct */
#define AT(num_frames, anim_speed) {{num_frames, AnimationStatus::Looping, anim_speed, {}}, STR_NULL, AirportTileCallbackMasks{}, 0, true, GRFFileProps(INVALID_AIRPORTTILE), {}}
#define AT(num_frames, anim_speed) {{num_frames, AnimationStatus::Looping, anim_speed, {}}, STR_NULL, AirportTileCallbackMasks{}, 0, true, SubstituteGRFFileProps(INVALID_AIRPORTTILE), {}}
/** Writes an airport tile without animation in the AirportTile struct */
#define AT_NOANIM {AnimationInfo<AirportAnimationTriggers>{}, STR_NULL, AirportTileCallbackMasks{}, 0, true, GRFFileProps(INVALID_AIRPORTTILE), {}}
#define AT_NOANIM {AnimationInfo<AirportAnimationTriggers>{}, STR_NULL, AirportTileCallbackMasks{}, 0, true, SubstituteGRFFileProps(INVALID_AIRPORTTILE), {}}
/**
* All default airport tiles.

View File

@ -1135,7 +1135,7 @@ enum IndustryTypes : uint8_t {
{INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO}, \
{{im1, 0}, {im2, 0}, {im3, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}}, \
pr, clim, bev, col, in, intx, s1, s2, s3, STR_UNDEFINED, {ai1, ai2, ai3, ai4}, {ag1, ag2, ag3, ag4}, \
IndustryCallbackMasks{}, true, GRFFileProps(IT_INVALID), snd, {}, \
IndustryCallbackMasks{}, true, SubstituteGRFFileProps(IT_INVALID), snd, {}, \
{{p1, p2}}, {{a1, a2, a3}}}
/* Format:
tile table count and sounds table
@ -1535,7 +1535,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = {
*/
#define MT(ca1, c1, ca2, c2, ca3, c3, sl, a1, a2, a3) { \
{INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO}, \
{ca1, ca2, ca3}, sl, a1, a2, a3, IndustryTileCallbackMasks{}, AnimationInfo<IndustryAnimationTriggers>{}, IndustryTileSpecialFlags{}, true, GRFFileProps(INVALID_INDUSTRYTILE), {}, {c1, c2, c3} \
{ca1, ca2, ca3}, sl, a1, a2, a3, IndustryTileCallbackMasks{}, AnimationInfo<IndustryAnimationTriggers>{}, IndustryTileSpecialFlags{}, true, SubstituteGRFFileProps(INVALID_INDUSTRYTILE), {}, {c1, c2, c3} \
}
static const IndustryTileSpec _origin_industry_tile_specs[NEW_INDUSTRYTILEOFFSET] = {
/* Coal Mine */

View File

@ -1813,7 +1813,7 @@ static_assert(lengthof(_town_draw_tile_data) == (NEW_HOUSE_OFFSET) * 4 * 4);
{TimerGameCalendar::Year{mnd}, TimerGameCalendar::Year{mxd}, p, rc, bn, rr, mg, \
{ca1, ca2, ca3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, \
{INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO}, \
bf, ba, true, GRFFileProps(INVALID_HOUSE_ID), HouseCallbackMasks{}, {COLOUR_BEGIN, COLOUR_BEGIN, COLOUR_BEGIN, COLOUR_BEGIN}, \
bf, ba, true, SubstituteGRFFileProps(INVALID_HOUSE_ID), HouseCallbackMasks{}, {COLOUR_BEGIN, COLOUR_BEGIN, COLOUR_BEGIN, COLOUR_BEGIN}, \
16, HouseExtraFlags{}, HOUSE_NO_CLASS, AnimationInfo<void>{}, 0, 0, 0, {}, {cg1, cg2, cg3}, }
/** House specifications from original data */
extern const HouseSpec _original_house_specs[] = {