From 46494c6d443738fcf4771216c9aa867023c6bfb4 Mon Sep 17 00:00:00 2001 From: frosch Date: Sat, 26 Apr 2025 20:08:10 +0200 Subject: [PATCH] Codechange: Rename GRFFileProps to SubstituteGRFFileProps. --- src/house.h | 2 +- src/industrytype.h | 4 ++-- src/newgrf_airport.h | 2 +- src/newgrf_airporttiles.h | 2 +- src/newgrf_commons.h | 8 +++++--- src/table/airport_defaults.h | 2 +- src/table/airporttiles.h | 4 ++-- src/table/build_industry.h | 4 ++-- src/table/town_land.h | 2 +- 9 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/house.h b/src/house.h index 4175a501c9..512665ae71 100644 --- a/src/house.h +++ b/src/house.h @@ -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) diff --git a/src/industrytype.h b/src/industrytype.h index 4b6a9e3e74..1f06ab64e6 100644 --- a/src/industrytype.h +++ b/src/industrytype.h @@ -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 random_sounds; ///< Random sounds; std::vector badges; @@ -165,7 +165,7 @@ struct IndustryTileSpec { AnimationInfo 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 badges; std::array, INDUSTRY_ORIGINAL_NUM_INPUTS> accepts_cargo_label; ///< Cargo labels of accepted cargo for default industry tiles. diff --git a/src/newgrf_airport.h b/src/newgrf_airport.h index 59e811b80e..b21e265e1f 100644 --- a/src/newgrf_airport.h +++ b/src/newgrf_airport.h @@ -119,7 +119,7 @@ struct AirportSpec : NewGRFSpecBase { 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 badges; static const AirportSpec *Get(uint8_t type); diff --git a/src/newgrf_airporttiles.h b/src/newgrf_airporttiles.h index 67db07743b..34b37cf5e7 100644 --- a/src/newgrf_airporttiles.h +++ b/src/newgrf_airporttiles.h @@ -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 badges; static const AirportTileSpec *Get(StationGfx gfx); diff --git a/src/newgrf_commons.h b/src/newgrf_commons.h index 7cf7441b24..f4d38e7ee1 100644 --- a/src/newgrf_commons.h +++ b/src/newgrf_commons.h @@ -394,10 +394,12 @@ struct CargoGRFFileProps : VariableGRFFileProps { 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 diff --git a/src/table/airport_defaults.h b/src/table/airport_defaults.h index 1212046f9e..0afa91a7b6 100644 --- a/src/table/airport_defaults.h +++ b/src/table/airport_defaults.h @@ -378,7 +378,7 @@ static const std::initializer_list _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) \ diff --git a/src/table/airporttiles.h b/src/table/airporttiles.h index f3f9deb6d1..056777bf65 100644 --- a/src/table/airporttiles.h +++ b/src/table/airporttiles.h @@ -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{}, STR_NULL, AirportTileCallbackMasks{}, 0, true, GRFFileProps(INVALID_AIRPORTTILE), {}} +#define AT_NOANIM {AnimationInfo{}, STR_NULL, AirportTileCallbackMasks{}, 0, true, SubstituteGRFFileProps(INVALID_AIRPORTTILE), {}} /** * All default airport tiles. diff --git a/src/table/build_industry.h b/src/table/build_industry.h index d2ddf914a4..b86484e28d 100644 --- a/src/table/build_industry.h +++ b/src/table/build_industry.h @@ -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{}, IndustryTileSpecialFlags{}, true, GRFFileProps(INVALID_INDUSTRYTILE), {}, {c1, c2, c3} \ + {ca1, ca2, ca3}, sl, a1, a2, a3, IndustryTileCallbackMasks{}, AnimationInfo{}, IndustryTileSpecialFlags{}, true, SubstituteGRFFileProps(INVALID_INDUSTRYTILE), {}, {c1, c2, c3} \ } static const IndustryTileSpec _origin_industry_tile_specs[NEW_INDUSTRYTILEOFFSET] = { /* Coal Mine */ diff --git a/src/table/town_land.h b/src/table/town_land.h index 012ad0086a..98f3c11b5f 100644 --- a/src/table/town_land.h +++ b/src/table/town_land.h @@ -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{}, 0, 0, 0, {}, {cg1, cg2, cg3}, } /** House specifications from original data */ extern const HouseSpec _original_house_specs[] = {