NewGRF: Allow mapping a feature ID to the town scope

pull/507/head
Jonathan G Rennison 1 year ago
parent 57c5cc32d0
commit 5acf18fb37

@ -5352,6 +5352,7 @@ static const char *_feature_names[] = {
"TRAMTYPES",
"ROADSTOPS",
"NEWLANDSCAPE",
"TOWN",
};
static_assert(lengthof(_feature_names) == GSF_END);
@ -5490,6 +5491,7 @@ static void FeatureChangeInfo(ByteReader *buf)
/* GSF_TRAMTYPES */ TramTypeChangeInfo,
/* GSF_ROADSTOPS */ RoadStopChangeInfo,
/* GSF_NEWLANDSCAPE */ NewLandscapeChangeInfo,
/* GSF_FAKE_TOWNS */ nullptr,
};
static_assert(GSF_END == lengthof(handler));
static_assert(lengthof(handler) == lengthof(_cur.grffile->action0_property_remaps), "Action 0 feature list length mismatch");

@ -90,12 +90,12 @@ enum GrfSpecFeature : uint8 {
GSF_ROADSTOPS,
GSF_NEWLANDSCAPE,
GSF_FAKE_TOWNS, ///< Fake (but mappable) town GrfSpecFeature for NewGRF debugging (parent scope), and generic callbacks
GSF_END,
GSF_REAL_FEATURE_END = GSF_NEWLANDSCAPE,
GSF_FAKE_TOWNS = GSF_END, ///< Fake town GrfSpecFeature for NewGRF debugging (parent scope)
GSF_FAKE_STATION_STRUCT, ///< Fake station struct GrfSpecFeature for NewGRF debugging
GSF_FAKE_STATION_STRUCT = GSF_END, ///< Fake station struct GrfSpecFeature for NewGRF debugging
GSF_FAKE_END, ///< End of the fake features
GSF_ERROR_ON_USE = 0xFE, ///< An invalid value which generates an immediate error on mapping

@ -62,6 +62,7 @@ extern const GRFFeatureInfo _grf_feature_list[] = {
GRFFeatureInfo("new_landscape", 2),
GRFFeatureInfo("more_objects_per_grf", 1, GFTOF_MORE_OBJECTS_PER_GRF),
GRFFeatureInfo("more_action2_ids", 1, GFTOF_MORE_ACTION2_IDS),
GRFFeatureInfo("town_feature", 1),
GRFFeatureInfo(),
};
@ -69,6 +70,7 @@ extern const GRFFeatureInfo _grf_feature_list[] = {
extern const GRFFeatureMapDefinition _grf_remappable_features[] = {
GRFFeatureMapDefinition(GSF_ROADSTOPS, "road_stops"),
GRFFeatureMapDefinition(GSF_NEWLANDSCAPE, "new_landscape"),
GRFFeatureMapDefinition(GSF_FAKE_TOWNS, "town"),
GRFFeatureMapDefinition(),
};

Loading…
Cancel
Save