We already have the names and order of the MAPSEC values in region_map_sections.json, so we can generate the constants automatically when we process this file. As a bonus we'll put them in an enum to ensure MAPSEC_NONE / MAPSEC_COUNT will be updated as values are added or removed.
The only necessary changes are to json_data_rules.mk and to the new region_map_sections.constants.json.txt file. The changes to region_map_sections.json and region_map_sections.json.txt are motivated by pokefirered (to support elements in that JSON file that will only specify id, and so will only output the constant and not any C data)
We already have the names and order of the
MAPSEC
values in region_map_sections.json, so we can generate the constants automatically when we process this file. As a bonus we'll put them in an enum to ensureMAPSEC_NONE
/MAPSEC_COUNT
will be updated as values are added or removed.The only necessary changes are to
json_data_rules.mk
and to the newregion_map_sections.constants.json.txt
file. The changes toregion_map_sections.json
andregion_map_sections.json.txt
are motivated by pokefirered (to support elements in that JSON file that will only specifyid
, and so will only output the constant and not any C data)