use json for region map sections

- update nlohmann/json and pantor/inja in tools/
  - create new inja template
This commit is contained in:
garakmon 2022-04-04 23:22:43 -04:00
parent 5160520639
commit 3fe423a6f4
8 changed files with 14642 additions and 12588 deletions

View File

@ -6,3 +6,9 @@ $(DATA_SRC_SUBDIR)/wild_encounters.h: $(DATA_SRC_SUBDIR)/wild_encounters.json $(
$(JSONPROC) $^ $@
$(C_BUILDDIR)/wild_encounter.o: c_dep += $(DATA_SRC_SUBDIR)/wild_encounters.h
AUTO_GEN_TARGETS += $(DATA_SRC_SUBDIR)/region_map/region_map_entries.h
$(DATA_SRC_SUBDIR)/region_map/region_map_entries.h: $(DATA_SRC_SUBDIR)/region_map/region_map_sections.json $(DATA_SRC_SUBDIR)/region_map/region_map_sections.json.txt
$(JSONPROC) $^ $@
$(C_BUILDDIR)/region_map.o: c_dep += $(DATA_SRC_SUBDIR)/region_map/region_map_entries.h

View File

@ -1,418 +0,0 @@
#ifndef GUARD_DATA_REGION_MAP_REGION_MAP_ENTRIES_H
#define GUARD_DATA_REGION_MAP_REGION_MAP_ENTRIES_H
static const u8 sMapName_LittlerootTown[] = _("LITTLEROOT TOWN");
static const u8 sMapName_OldaleTown[] = _("OLDALE TOWN");
static const u8 sMapName_DewfordTown[] = _("DEWFORD TOWN");
static const u8 sMapName_LavaridgeTown[] = _("LAVARIDGE TOWN");
static const u8 sMapName_FallarborTown[] = _("FALLARBOR TOWN");
static const u8 sMapName_VerdanturfTown[] = _("VERDANTURF TOWN");
static const u8 sMapName_PacifidlogTown[] = _("PACIFIDLOG TOWN");
static const u8 sMapName_PetalburgCity[] = _("PETALBURG CITY");
static const u8 sMapName_SlateportCity[] = _("SLATEPORT CITY");
static const u8 sMapName_MauvilleCity[] = _("MAUVILLE CITY");
static const u8 sMapName_RustboroCity[] = _("RUSTBORO CITY");
static const u8 sMapName_FortreeCity[] = _("FORTREE CITY");
static const u8 sMapName_LilycoveCity[] = _("LILYCOVE CITY");
static const u8 sMapName_MossdeepCity[] = _("MOSSDEEP CITY");
static const u8 sMapName_SootopolisCity[] = _("SOOTOPOLIS CITY");
static const u8 sMapName_EverGrandeCity[] = _("EVER GRANDE CITY");
static const u8 sMapName_Route101[] = _("ROUTE 101");
static const u8 sMapName_Route102[] = _("ROUTE 102");
static const u8 sMapName_Route103[] = _("ROUTE 103");
static const u8 sMapName_Route104[] = _("ROUTE 104");
static const u8 sMapName_Route105[] = _("ROUTE 105");
static const u8 sMapName_Route106[] = _("ROUTE 106");
static const u8 sMapName_Route107[] = _("ROUTE 107");
static const u8 sMapName_Route108[] = _("ROUTE 108");
static const u8 sMapName_Route109[] = _("ROUTE 109");
static const u8 sMapName_Route110[] = _("ROUTE 110");
static const u8 sMapName_Route111[] = _("ROUTE 111");
static const u8 sMapName_Route112[] = _("ROUTE 112");
static const u8 sMapName_Route113[] = _("ROUTE 113");
static const u8 sMapName_Route114[] = _("ROUTE 114");
static const u8 sMapName_Route115[] = _("ROUTE 115");
static const u8 sMapName_Route116[] = _("ROUTE 116");
static const u8 sMapName_Route117[] = _("ROUTE 117");
static const u8 sMapName_Route118[] = _("ROUTE 118");
static const u8 sMapName_Route119[] = _("ROUTE 119");
static const u8 sMapName_Route120[] = _("ROUTE 120");
static const u8 sMapName_Route121[] = _("ROUTE 121");
static const u8 sMapName_Route122[] = _("ROUTE 122");
static const u8 sMapName_Route123[] = _("ROUTE 123");
static const u8 sMapName_Route124[] = _("ROUTE 124");
static const u8 sMapName_Route125[] = _("ROUTE 125");
static const u8 sMapName_Route126[] = _("ROUTE 126");
static const u8 sMapName_Route127[] = _("ROUTE 127");
static const u8 sMapName_Route128[] = _("ROUTE 128");
static const u8 sMapName_Route129[] = _("ROUTE 129");
static const u8 sMapName_Route130[] = _("ROUTE 130");
static const u8 sMapName_Route131[] = _("ROUTE 131");
static const u8 sMapName_Route132[] = _("ROUTE 132");
static const u8 sMapName_Route133[] = _("ROUTE 133");
static const u8 sMapName_Route134[] = _("ROUTE 134");
static const u8 sMapName_Underwater[] = _("UNDERWATER");
static const u8 sMapName_GraniteCave[] = _("GRANITE CAVE");
static const u8 sMapName_MtChimney[] = _("MT. CHIMNEY");
static const u8 sMapName_SafariZone[] = _("SAFARI ZONE");
static const u8 sMapName_BattleFrontier[] = _("BATTLE FRONTIER");
static const u8 sMapName_PetalburgWoods[] = _("PETALBURG WOODS");
static const u8 sMapName_RusturfTunnel[] = _("RUSTURF TUNNEL");
static const u8 sMapName_AbandonedShip[] = _("ABANDONED SHIP");
static const u8 sMapName_NewMauville[] = _("NEW MAUVILLE");
static const u8 sMapName_MeteorFalls[] = _("METEOR FALLS");
static const u8 sMapName_MtPyre[] = _("MT. PYRE");
static const u8 sMapName_AquaHideoutOld[] = _("{AQUA} HIDEOUT");
static const u8 sMapName_ShoalCave[] = _("SHOAL CAVE");
static const u8 sMapName_SeafloorCavern[] = _("SEAFLOOR CAVERN");
static const u8 sMapName_VictoryRoad[] = _("VICTORY ROAD");
static const u8 sMapName_MirageIsland[] = _("MIRAGE ISLAND");
static const u8 sMapName_CaveOfOrigin[] = _("CAVE OF ORIGIN");
static const u8 sMapName_SouthernIsland[] = _("SOUTHERN ISLAND");
static const u8 sMapName_FieryPath[] = _("FIERY PATH");
static const u8 sMapName_JaggedPass[] = _("JAGGED PASS");
static const u8 sMapName_SealedChamber[] = _("SEALED CHAMBER");
static const u8 sMapName_ScorchedSlab[] = _("SCORCHED SLAB");
static const u8 sMapName_IslandCave[] = _("ISLAND CAVE");
static const u8 sMapName_DesertRuins[] = _("DESERT RUINS");
static const u8 sMapName_AncientTomb[] = _("ANCIENT TOMB");
static const u8 sMapName_InsideOfTruck[] = _("INSIDE OF TRUCK");
static const u8 sMapName_SkyPillar[] = _("SKY PILLAR");
static const u8 sMapName_SecretBase[] = _("SECRET BASE");
static const u8 sMapName_None[] = _("");
static const u8 sMapName_PalletTown[] = _("PALLET TOWN");
static const u8 sMapName_ViridianCity[] = _("VIRIDIAN CITY");
static const u8 sMapName_PewterCity[] = _("PEWTER CITY");
static const u8 sMapName_CeruleanCity[] = _("CERULEAN CITY");
static const u8 sMapName_LavenderTown[] = _("LAVENDER TOWN");
static const u8 sMapName_VermilionCity[] = _("VERMILION CITY");
static const u8 sMapName_CeladonCity[] = _("CELADON CITY");
static const u8 sMapName_FuchsiaCity[] = _("FUCHSIA CITY");
static const u8 sMapName_CinnabarIsland[] = _("CINNABAR ISLAND");
static const u8 sMapName_IndigoPlateau[] = _("INDIGO PLATEAU");
static const u8 sMapName_SaffronCity[] = _("SAFFRON CITY");
static const u8 sMapName_Route4[] = _("ROUTE 4");
static const u8 sMapName_Route10[] = _("ROUTE 10");
static const u8 sMapName_Route1[] = _("ROUTE 1");
static const u8 sMapName_Route2[] = _("ROUTE 2");
static const u8 sMapName_Route3[] = _("ROUTE 3");
static const u8 sMapName_Route4_2[] = _("ROUTE 4");
static const u8 sMapName_Route5[] = _("ROUTE 5");
static const u8 sMapName_Route6[] = _("ROUTE 6");
static const u8 sMapName_Route7[] = _("ROUTE 7");
static const u8 sMapName_Route8[] = _("ROUTE 8");
static const u8 sMapName_Route9[] = _("ROUTE 9");
static const u8 sMapName_Route10_2[] = _("ROUTE 10");
static const u8 sMapName_Route11[] = _("ROUTE 11");
static const u8 sMapName_Route12[] = _("ROUTE 12");
static const u8 sMapName_Route13[] = _("ROUTE 13");
static const u8 sMapName_Route14[] = _("ROUTE 14");
static const u8 sMapName_Route15[] = _("ROUTE 15");
static const u8 sMapName_Route16[] = _("ROUTE 16");
static const u8 sMapName_Route17[] = _("ROUTE 17");
static const u8 sMapName_Route18[] = _("ROUTE 18");
static const u8 sMapName_Route19[] = _("ROUTE 19");
static const u8 sMapName_Route20[] = _("ROUTE 20");
static const u8 sMapName_Route21[] = _("ROUTE 21");
static const u8 sMapName_Route22[] = _("ROUTE 22");
static const u8 sMapName_Route23[] = _("ROUTE 23");
static const u8 sMapName_Route24[] = _("ROUTE 24");
static const u8 sMapName_Route25[] = _("ROUTE 25");
static const u8 sMapName_ViridianForest[] = _("VIRIDIAN FOREST");
static const u8 sMapName_MtMoon[] = _("MT. MOON");
static const u8 sMapName_SSAnne[] = _("S.S. ANNE");
static const u8 sMapName_UndergroundPath[] = _("UNDERGROUND PATH");
static const u8 sMapName_UndergroundPath2[] = _("UNDERGROUND PATH");
static const u8 sMapName_DiglettsCave[] = _("DIGLETT'S CAVE");
static const u8 sMapName_KantoVictoryRoad[] = _("VICTORY ROAD");
static const u8 sMapName_RocketHideout[] = _("ROCKET HIDEOUT");
static const u8 sMapName_SilphCo[] = _("SILPH CO.");
static const u8 sMapName_PokemonMansion[] = _("POKéMON MANSION");
static const u8 sMapName_KantoSafariZone[] = _("SAFARI ZONE");
static const u8 sMapName_PokemonLeague[] = _("POKéMON LEAGUE");
static const u8 sMapName_RockTunnel[] = _("ROCK TUNNEL");
static const u8 sMapName_SeafoamIslands[] = _("SEAFOAM ISLANDS");
static const u8 sMapName_PokemonTower[] = _("POKéMON TOWER");
static const u8 sMapName_CeruleanCave[] = _("CERULEAN CAVE");
static const u8 sMapName_PowerPlant[] = _("POWER PLANT");
static const u8 sMapName_OneIsland[] = _("ONE ISLAND");
static const u8 sMapName_TwoIsland[] = _("TWO ISLAND");
static const u8 sMapName_ThreeIsland[] = _("THREE ISLAND");
static const u8 sMapName_FourIsland[] = _("FOUR ISLAND");
static const u8 sMapName_FiveIsland[] = _("FIVE ISLAND");
static const u8 sMapName_SevenIsland[] = _("SEVEN ISLAND");
static const u8 sMapName_SixIsland[] = _("SIX ISLAND");
static const u8 sMapName_KindleRoad[] = _("KINDLE ROAD");
static const u8 sMapName_TreasureBeach[] = _("TREASURE BEACH");
static const u8 sMapName_CapeBrink[] = _("CAPE BRINK");
static const u8 sMapName_BondBridge[] = _("BOND BRIDGE");
static const u8 sMapName_ThreeIslePort[] = _("THREE ISLE PORT");
static const u8 sMapName_SeviiIsle6[] = _("SEVII ISLE 6");
static const u8 sMapName_SeviiIsle7[] = _("SEVII ISLE 7");
static const u8 sMapName_SeviiIsle8[] = _("SEVII ISLE 8");
static const u8 sMapName_SeviiIsle9[] = _("SEVII ISLE 9");
static const u8 sMapName_ResortGorgeous[] = _("RESORT GORGEOUS");
static const u8 sMapName_WaterLabyrinth[] = _("WATER LABYRINTH");
static const u8 sMapName_FiveIsleMeadow[] = _("FIVE ISLE MEADOW");
static const u8 sMapName_MemorialPillar[] = _("MEMORIAL PILLAR");
static const u8 sMapName_OutcastIsland[] = _("OUTCAST ISLAND");
static const u8 sMapName_GreenPath[] = _("GREEN PATH");
static const u8 sMapName_WaterPath[] = _("WATER PATH");
static const u8 sMapName_RuinValley[] = _("RUIN VALLEY");
static const u8 sMapName_TrainerTower[] = _("TRAINER TOWER");
static const u8 sMapName_CanyonEntrance[] = _("CANYON ENTRANCE");
static const u8 sMapName_SevaultCanyon[] = _("SEVAULT CANYON");
static const u8 sMapName_TanobyRuins[] = _("TANOBY RUINS");
static const u8 sMapName_SeviiIsle22[] = _("SEVII ISLE 22");
static const u8 sMapName_SeviiIsle23[] = _("SEVII ISLE 23");
static const u8 sMapName_SeviiIsle24[] = _("SEVII ISLE 24");
static const u8 sMapName_NavelRock[] = _("NAVEL ROCK");
static const u8 sMapName_MtEmber[] = _("MT. EMBER");
static const u8 sMapName_BerryForest[] = _("BERRY FOREST");
static const u8 sMapName_IcefallCave[] = _("ICEFALL CAVE");
static const u8 sMapName_RocketWarehouse[] = _("ROCKET WAREHOUSE");
static const u8 sMapName_TrainerTower2[] = _("TRAINER TOWER");
static const u8 sMapName_DottedHole[] = _("DOTTED HOLE");
static const u8 sMapName_LostCave[] = _("LOST CAVE");
static const u8 sMapName_PatternBush[] = _("PATTERN BUSH");
static const u8 sMapName_AlteringCave[] = _("ALTERING CAVE");
static const u8 sMapName_TanobyChambers[] = _("TANOBY CHAMBERS");
static const u8 sMapName_ThreeIslePath[] = _("THREE ISLE PATH");
static const u8 sMapName_TanobyKey[] = _("TANOBY KEY");
static const u8 sMapName_BirthIsland[] = _("BIRTH ISLAND");
static const u8 sMapName_MoneanChamber[] = _("MONEAN CHAMBER");
static const u8 sMapName_LiptooChamber[] = _("LIPTOO CHAMBER");
static const u8 sMapName_WeepthChamber[] = _("WEEPTH CHAMBER");
static const u8 sMapName_DilfordChamber[] = _("DILFORD CHAMBER");
static const u8 sMapName_ScufibChamber[] = _("SCUFIB CHAMBER");
static const u8 sMapName_RixyChamber[] = _("RIXY CHAMBER");
static const u8 sMapName_ViapoisChamber[] = _("VIAPOIS CHAMBER");
static const u8 sMapName_EmberSpa[] = _("EMBER SPA");
static const u8 sMapName_SpecialArea[] = _("SPECIAL AREA");
static const u8 sMapName_AquaHideout[] = _("AQUA HIDEOUT");
static const u8 sMapName_MagmaHideout[] = _("MAGMA HIDEOUT");
static const u8 sMapName_MirageTower[] = _("MIRAGE TOWER");
static const u8 sMapName_FarawayIsland[] = _("FARAWAY ISLAND");
static const u8 sMapName_ArtisanCave[] = _("ARTISAN CAVE");
static const u8 sMapName_MarineCave[] = _("MARINE CAVE");
static const u8 sMapName_TerraCave[] = _("TERRA CAVE");
static const u8 sMapName_DesertUnderpass[] = _("DESERT UNDERPASS");
static const u8 sMapName_TrainerHill[] = _("TRAINER HILL");
const struct RegionMapLocation gRegionMapEntries[] = {
[MAPSEC_LITTLEROOT_TOWN] = { 4, 11, 1, 1, sMapName_LittlerootTown},
[MAPSEC_OLDALE_TOWN] = { 4, 9, 1, 1, sMapName_OldaleTown},
[MAPSEC_DEWFORD_TOWN] = { 2, 14, 1, 1, sMapName_DewfordTown},
[MAPSEC_LAVARIDGE_TOWN] = { 5, 3, 1, 1, sMapName_LavaridgeTown},
[MAPSEC_FALLARBOR_TOWN] = { 3, 0, 1, 1, sMapName_FallarborTown},
[MAPSEC_VERDANTURF_TOWN] = { 4, 6, 1, 1, sMapName_VerdanturfTown},
[MAPSEC_PACIFIDLOG_TOWN] = {17, 10, 1, 1, sMapName_PacifidlogTown},
[MAPSEC_PETALBURG_CITY] = { 1, 9, 1, 1, sMapName_PetalburgCity},
[MAPSEC_SLATEPORT_CITY] = { 8, 10, 1, 2, sMapName_SlateportCity},
[MAPSEC_MAUVILLE_CITY] = { 8, 6, 2, 1, sMapName_MauvilleCity},
[MAPSEC_RUSTBORO_CITY] = { 0, 5, 1, 2, sMapName_RustboroCity},
[MAPSEC_FORTREE_CITY] = {12, 0, 1, 1, sMapName_FortreeCity},
[MAPSEC_LILYCOVE_CITY] = {18, 3, 2, 1, sMapName_LilycoveCity},
[MAPSEC_MOSSDEEP_CITY] = {24, 5, 2, 1, sMapName_MossdeepCity},
[MAPSEC_SOOTOPOLIS_CITY] = {21, 7, 1, 1, sMapName_SootopolisCity},
[MAPSEC_EVER_GRANDE_CITY] = {27, 8, 1, 2, sMapName_EverGrandeCity},
[MAPSEC_ROUTE_101] = { 4, 10, 1, 1, sMapName_Route101},
[MAPSEC_ROUTE_102] = { 2, 9, 2, 1, sMapName_Route102},
[MAPSEC_ROUTE_103] = { 4, 8, 4, 1, sMapName_Route103},
[MAPSEC_ROUTE_104] = { 0, 7, 1, 3, sMapName_Route104},
[MAPSEC_ROUTE_105] = { 0, 10, 1, 3, sMapName_Route105},
[MAPSEC_ROUTE_106] = { 0, 13, 2, 1, sMapName_Route106},
[MAPSEC_ROUTE_107] = { 3, 14, 3, 1, sMapName_Route107},
[MAPSEC_ROUTE_108] = { 6, 14, 2, 1, sMapName_Route108},
[MAPSEC_ROUTE_109] = { 8, 12, 1, 3, sMapName_Route109},
[MAPSEC_ROUTE_110] = { 8, 7, 1, 3, sMapName_Route110},
[MAPSEC_ROUTE_111] = { 8, 0, 1, 6, sMapName_Route111},
[MAPSEC_ROUTE_112] = { 6, 3, 2, 1, sMapName_Route112},
[MAPSEC_ROUTE_113] = { 4, 0, 4, 1, sMapName_Route113},
[MAPSEC_ROUTE_114] = { 1, 0, 2, 3, sMapName_Route114},
[MAPSEC_ROUTE_115] = { 0, 2, 1, 3, sMapName_Route115},
[MAPSEC_ROUTE_116] = { 1, 5, 4, 1, sMapName_Route116},
[MAPSEC_ROUTE_117] = { 5, 6, 3, 1, sMapName_Route117},
[MAPSEC_ROUTE_118] = {10, 6, 2, 1, sMapName_Route118},
[MAPSEC_ROUTE_119] = {11, 0, 1, 6, sMapName_Route119},
[MAPSEC_ROUTE_120] = {13, 0, 1, 4, sMapName_Route120},
[MAPSEC_ROUTE_121] = {14, 3, 4, 1, sMapName_Route121},
[MAPSEC_ROUTE_122] = {16, 4, 1, 2, sMapName_Route122},
[MAPSEC_ROUTE_123] = {12, 6, 5, 1, sMapName_Route123},
[MAPSEC_ROUTE_124] = {20, 3, 4, 3, sMapName_Route124},
[MAPSEC_ROUTE_125] = {24, 3, 2, 2, sMapName_Route125},
[MAPSEC_ROUTE_126] = {20, 6, 3, 3, sMapName_Route126},
[MAPSEC_ROUTE_127] = {23, 6, 3, 3, sMapName_Route127},
[MAPSEC_ROUTE_128] = {23, 9, 4, 1, sMapName_Route128},
[MAPSEC_ROUTE_129] = {24, 10, 2, 1, sMapName_Route129},
[MAPSEC_ROUTE_130] = {21, 10, 3, 1, sMapName_Route130},
[MAPSEC_ROUTE_131] = {18, 10, 3, 1, sMapName_Route131},
[MAPSEC_ROUTE_132] = {15, 10, 2, 1, sMapName_Route132},
[MAPSEC_ROUTE_133] = {12, 10, 3, 1, sMapName_Route133},
[MAPSEC_ROUTE_134] = { 9, 10, 3, 1, sMapName_Route134},
[MAPSEC_UNDERWATER_124] = {20, 3, 4, 3, sMapName_Underwater},
[MAPSEC_UNDERWATER_126] = {20, 6, 3, 3, sMapName_Underwater},
[MAPSEC_UNDERWATER_127] = {23, 6, 3, 3, sMapName_Underwater},
[MAPSEC_UNDERWATER_128] = {23, 9, 4, 1, sMapName_Underwater},
[MAPSEC_UNDERWATER_SOOTOPOLIS] = {21, 7, 1, 1, sMapName_Underwater},
[MAPSEC_GRANITE_CAVE] = { 1, 13, 1, 1, sMapName_GraniteCave},
[MAPSEC_MT_CHIMNEY] = { 6, 2, 1, 1, sMapName_MtChimney},
[MAPSEC_SAFARI_ZONE] = {16, 2, 1, 1, sMapName_SafariZone},
[MAPSEC_BATTLE_FRONTIER] = {22, 12, 1, 1, sMapName_BattleFrontier},
[MAPSEC_PETALBURG_WOODS] = { 0, 8, 1, 1, sMapName_PetalburgWoods},
[MAPSEC_RUSTURF_TUNNEL] = { 2, 5, 1, 1, sMapName_RusturfTunnel},
[MAPSEC_ABANDONED_SHIP] = { 6, 14, 1, 1, sMapName_AbandonedShip},
[MAPSEC_NEW_MAUVILLE] = { 8, 7, 1, 1, sMapName_NewMauville},
[MAPSEC_METEOR_FALLS] = { 0, 3, 1, 1, sMapName_MeteorFalls},
[MAPSEC_METEOR_FALLS2] = { 1, 2, 1, 1, sMapName_MeteorFalls},
[MAPSEC_MT_PYRE] = {16, 4, 1, 1, sMapName_MtPyre},
[MAPSEC_AQUA_HIDEOUT_OLD] = {19, 3, 1, 1, sMapName_AquaHideoutOld},
[MAPSEC_SHOAL_CAVE] = {24, 4, 1, 1, sMapName_ShoalCave},
[MAPSEC_SEAFLOOR_CAVERN] = {24, 9, 1, 1, sMapName_SeafloorCavern},
[MAPSEC_UNDERWATER_SEAFLOOR_CAVERN] = {24, 9, 1, 1, sMapName_Underwater},
[MAPSEC_VICTORY_ROAD] = {27, 9, 1, 1, sMapName_VictoryRoad},
[MAPSEC_MIRAGE_ISLAND] = {17, 10, 1, 1, sMapName_MirageIsland},
[MAPSEC_CAVE_OF_ORIGIN] = {21, 7, 1, 1, sMapName_CaveOfOrigin},
[MAPSEC_SOUTHERN_ISLAND] = {12, 14, 1, 1, sMapName_SouthernIsland},
[MAPSEC_FIERY_PATH] = { 6, 3, 1, 1, sMapName_FieryPath},
[MAPSEC_FIERY_PATH2] = { 7, 3, 1, 1, sMapName_FieryPath},
[MAPSEC_JAGGED_PASS] = { 6, 3, 1, 1, sMapName_JaggedPass},
[MAPSEC_JAGGED_PASS2] = { 7, 2, 1, 1, sMapName_JaggedPass},
[MAPSEC_SEALED_CHAMBER] = {11, 10, 1, 1, sMapName_SealedChamber},
[MAPSEC_UNDERWATER_SEALED_CHAMBER] = {11, 10, 1, 1, sMapName_Underwater},
[MAPSEC_SCORCHED_SLAB] = {13, 0, 1, 1, sMapName_ScorchedSlab},
[MAPSEC_ISLAND_CAVE] = { 0, 10, 1, 1, sMapName_IslandCave},
[MAPSEC_DESERT_RUINS] = { 8, 3, 1, 1, sMapName_DesertRuins},
[MAPSEC_ANCIENT_TOMB] = {13, 2, 1, 1, sMapName_AncientTomb},
[MAPSEC_INSIDE_OF_TRUCK] = { 0, 0, 1, 1, sMapName_InsideOfTruck},
[MAPSEC_SKY_PILLAR] = {19, 10, 1, 1, sMapName_SkyPillar},
[MAPSEC_SECRET_BASE] = { 0, 0, 1, 1, sMapName_SecretBase},
[MAPSEC_DYNAMIC] = { 0, 0, 1, 1, sMapName_None},
[MAPSEC_PALLET_TOWN] = { 0, 0, 1, 1, sMapName_PalletTown},
[MAPSEC_VIRIDIAN_CITY] = { 0, 0, 1, 1, sMapName_ViridianCity},
[MAPSEC_PEWTER_CITY] = { 0, 0, 1, 1, sMapName_PewterCity},
[MAPSEC_CERULEAN_CITY] = { 0, 0, 1, 1, sMapName_CeruleanCity},
[MAPSEC_LAVENDER_TOWN] = { 0, 0, 1, 1, sMapName_LavenderTown},
[MAPSEC_VERMILION_CITY] = { 0, 0, 1, 1, sMapName_VermilionCity},
[MAPSEC_CELADON_CITY] = { 0, 0, 1, 1, sMapName_CeladonCity},
[MAPSEC_FUCHSIA_CITY] = { 0, 0, 1, 1, sMapName_FuchsiaCity},
[MAPSEC_CINNABAR_ISLAND] = { 0, 0, 1, 1, sMapName_CinnabarIsland},
[MAPSEC_INDIGO_PLATEAU] = { 0, 0, 1, 1, sMapName_IndigoPlateau},
[MAPSEC_SAFFRON_CITY] = { 0, 0, 1, 1, sMapName_SaffronCity},
[MAPSEC_ROUTE_4_FLYDUP] = { 0, 0, 1, 1, sMapName_Route4},
[MAPSEC_ROUTE_10_FLYDUP] = { 0, 0, 1, 1, sMapName_Route10},
[MAPSEC_ROUTE_1] = { 0, 0, 1, 1, sMapName_Route1},
[MAPSEC_ROUTE_2] = { 0, 0, 1, 1, sMapName_Route2},
[MAPSEC_ROUTE_3] = { 0, 0, 1, 1, sMapName_Route3},
[MAPSEC_ROUTE_4] = { 0, 0, 1, 1, sMapName_Route4_2},
[MAPSEC_ROUTE_5] = { 0, 0, 1, 1, sMapName_Route5},
[MAPSEC_ROUTE_6] = { 0, 0, 1, 1, sMapName_Route6},
[MAPSEC_ROUTE_7] = { 0, 0, 1, 1, sMapName_Route7},
[MAPSEC_ROUTE_8] = { 0, 0, 1, 1, sMapName_Route8},
[MAPSEC_ROUTE_9] = { 0, 0, 1, 1, sMapName_Route9},
[MAPSEC_ROUTE_10] = { 0, 0, 1, 1, sMapName_Route10_2},
[MAPSEC_ROUTE_11] = { 0, 0, 1, 1, sMapName_Route11},
[MAPSEC_ROUTE_12] = { 0, 0, 1, 1, sMapName_Route12},
[MAPSEC_ROUTE_13] = { 0, 0, 1, 1, sMapName_Route13},
[MAPSEC_ROUTE_14] = { 0, 0, 1, 1, sMapName_Route14},
[MAPSEC_ROUTE_15] = { 0, 0, 1, 1, sMapName_Route15},
[MAPSEC_ROUTE_16] = { 0, 0, 1, 1, sMapName_Route16},
[MAPSEC_ROUTE_17] = { 0, 0, 1, 1, sMapName_Route17},
[MAPSEC_ROUTE_18] = { 0, 0, 1, 1, sMapName_Route18},
[MAPSEC_ROUTE_19] = { 0, 0, 1, 1, sMapName_Route19},
[MAPSEC_ROUTE_20] = { 0, 0, 1, 1, sMapName_Route20},
[MAPSEC_ROUTE_21] = { 0, 0, 1, 1, sMapName_Route21},
[MAPSEC_ROUTE_22] = { 0, 0, 1, 1, sMapName_Route22},
[MAPSEC_ROUTE_23] = { 0, 0, 1, 1, sMapName_Route23},
[MAPSEC_ROUTE_24] = { 0, 0, 1, 1, sMapName_Route24},
[MAPSEC_ROUTE_25] = { 0, 0, 1, 1, sMapName_Route25},
[MAPSEC_VIRIDIAN_FOREST] = { 0, 0, 1, 1, sMapName_ViridianForest},
[MAPSEC_MT_MOON] = { 0, 0, 1, 1, sMapName_MtMoon},
[MAPSEC_S_S_ANNE] = { 0, 0, 1, 1, sMapName_SSAnne},
[MAPSEC_UNDERGROUND_PATH] = { 0, 0, 1, 1, sMapName_UndergroundPath},
[MAPSEC_UNDERGROUND_PATH_2] = { 0, 0, 1, 1, sMapName_UndergroundPath2},
[MAPSEC_DIGLETTS_CAVE] = { 0, 0, 1, 1, sMapName_DiglettsCave},
[MAPSEC_KANTO_VICTORY_ROAD] = { 0, 0, 1, 1, sMapName_KantoVictoryRoad},
[MAPSEC_ROCKET_HIDEOUT] = { 0, 0, 1, 1, sMapName_RocketHideout},
[MAPSEC_SILPH_CO] = { 0, 0, 1, 1, sMapName_SilphCo},
[MAPSEC_POKEMON_MANSION] = { 0, 0, 1, 1, sMapName_PokemonMansion},
[MAPSEC_KANTO_SAFARI_ZONE] = { 0, 0, 1, 1, sMapName_KantoSafariZone},
[MAPSEC_POKEMON_LEAGUE] = { 0, 0, 1, 1, sMapName_PokemonLeague},
[MAPSEC_ROCK_TUNNEL] = { 0, 0, 1, 1, sMapName_RockTunnel},
[MAPSEC_SEAFOAM_ISLANDS] = { 0, 0, 1, 1, sMapName_SeafoamIslands},
[MAPSEC_POKEMON_TOWER] = { 0, 0, 1, 1, sMapName_PokemonTower},
[MAPSEC_CERULEAN_CAVE] = { 0, 0, 1, 1, sMapName_CeruleanCave},
[MAPSEC_POWER_PLANT] = { 0, 0, 1, 1, sMapName_PowerPlant},
[MAPSEC_ONE_ISLAND] = { 0, 0, 1, 1, sMapName_OneIsland},
[MAPSEC_TWO_ISLAND] = { 0, 0, 1, 1, sMapName_TwoIsland},
[MAPSEC_THREE_ISLAND] = { 0, 0, 1, 1, sMapName_ThreeIsland},
[MAPSEC_FOUR_ISLAND] = { 0, 0, 1, 1, sMapName_FourIsland},
[MAPSEC_FIVE_ISLAND] = { 0, 0, 1, 1, sMapName_FiveIsland},
[MAPSEC_SEVEN_ISLAND] = { 0, 0, 1, 1, sMapName_SevenIsland},
[MAPSEC_SIX_ISLAND] = { 0, 0, 1, 1, sMapName_SixIsland},
[MAPSEC_KINDLE_ROAD] = { 0, 0, 1, 1, sMapName_KindleRoad},
[MAPSEC_TREASURE_BEACH] = { 0, 0, 1, 1, sMapName_TreasureBeach},
[MAPSEC_CAPE_BRINK] = { 0, 0, 1, 1, sMapName_CapeBrink},
[MAPSEC_BOND_BRIDGE] = { 0, 0, 1, 1, sMapName_BondBridge},
[MAPSEC_THREE_ISLE_PORT] = { 0, 0, 1, 1, sMapName_ThreeIslePort},
[MAPSEC_SEVII_ISLE_6] = { 0, 0, 1, 1, sMapName_SeviiIsle6},
[MAPSEC_SEVII_ISLE_7] = { 0, 0, 1, 1, sMapName_SeviiIsle7},
[MAPSEC_SEVII_ISLE_8] = { 0, 0, 1, 1, sMapName_SeviiIsle8},
[MAPSEC_SEVII_ISLE_9] = { 0, 0, 1, 1, sMapName_SeviiIsle9},
[MAPSEC_RESORT_GORGEOUS] = { 0, 0, 1, 1, sMapName_ResortGorgeous},
[MAPSEC_WATER_LABYRINTH] = { 0, 0, 1, 1, sMapName_WaterLabyrinth},
[MAPSEC_FIVE_ISLE_MEADOW] = { 0, 0, 1, 1, sMapName_FiveIsleMeadow},
[MAPSEC_MEMORIAL_PILLAR] = { 0, 0, 1, 1, sMapName_MemorialPillar},
[MAPSEC_OUTCAST_ISLAND] = { 0, 0, 1, 1, sMapName_OutcastIsland},
[MAPSEC_GREEN_PATH] = { 0, 0, 1, 1, sMapName_GreenPath},
[MAPSEC_WATER_PATH] = { 0, 0, 1, 1, sMapName_WaterPath},
[MAPSEC_RUIN_VALLEY] = { 0, 0, 1, 1, sMapName_RuinValley},
[MAPSEC_TRAINER_TOWER] = { 0, 0, 1, 1, sMapName_TrainerTower},
[MAPSEC_CANYON_ENTRANCE] = { 0, 0, 1, 1, sMapName_CanyonEntrance},
[MAPSEC_SEVAULT_CANYON] = { 0, 0, 1, 1, sMapName_SevaultCanyon},
[MAPSEC_TANOBY_RUINS] = { 0, 0, 1, 1, sMapName_TanobyRuins},
[MAPSEC_SEVII_ISLE_22] = { 0, 0, 1, 1, sMapName_SeviiIsle22},
[MAPSEC_SEVII_ISLE_23] = { 0, 0, 1, 1, sMapName_SeviiIsle23},
[MAPSEC_SEVII_ISLE_24] = { 0, 0, 1, 1, sMapName_SeviiIsle24},
[MAPSEC_NAVEL_ROCK_FRLG] = { 0, 0, 1, 1, sMapName_NavelRock},
[MAPSEC_MT_EMBER] = { 0, 0, 1, 1, sMapName_MtEmber},
[MAPSEC_BERRY_FOREST] = { 0, 0, 1, 1, sMapName_BerryForest},
[MAPSEC_ICEFALL_CAVE] = { 0, 0, 1, 1, sMapName_IcefallCave},
[MAPSEC_ROCKET_WAREHOUSE] = { 0, 0, 1, 1, sMapName_RocketWarehouse},
[MAPSEC_TRAINER_TOWER_2] = { 0, 0, 1, 1, sMapName_TrainerTower2},
[MAPSEC_DOTTED_HOLE] = { 0, 0, 1, 1, sMapName_DottedHole},
[MAPSEC_LOST_CAVE] = { 0, 0, 1, 1, sMapName_LostCave},
[MAPSEC_PATTERN_BUSH] = { 0, 0, 1, 1, sMapName_PatternBush},
[MAPSEC_ALTERING_CAVE_FRLG] = { 0, 0, 1, 1, sMapName_AlteringCave},
[MAPSEC_TANOBY_CHAMBERS] = { 0, 0, 1, 1, sMapName_TanobyChambers},
[MAPSEC_THREE_ISLE_PATH] = { 0, 0, 1, 1, sMapName_ThreeIslePath},
[MAPSEC_TANOBY_KEY] = { 0, 0, 1, 1, sMapName_TanobyKey},
[MAPSEC_BIRTH_ISLAND_FRLG] = { 0, 0, 1, 1, sMapName_BirthIsland},
[MAPSEC_MONEAN_CHAMBER] = { 0, 0, 1, 1, sMapName_MoneanChamber},
[MAPSEC_LIPTOO_CHAMBER] = { 0, 0, 1, 1, sMapName_LiptooChamber},
[MAPSEC_WEEPTH_CHAMBER] = { 0, 0, 1, 1, sMapName_WeepthChamber},
[MAPSEC_DILFORD_CHAMBER] = { 0, 0, 1, 1, sMapName_DilfordChamber},
[MAPSEC_SCUFIB_CHAMBER] = { 0, 0, 1, 1, sMapName_ScufibChamber},
[MAPSEC_RIXY_CHAMBER] = { 0, 0, 1, 1, sMapName_RixyChamber},
[MAPSEC_VIAPOIS_CHAMBER] = { 0, 0, 1, 1, sMapName_ViapoisChamber},
[MAPSEC_EMBER_SPA] = { 0, 0, 1, 1, sMapName_EmberSpa},
[MAPSEC_SPECIAL_AREA] = { 0, 0, 1, 1, sMapName_SpecialArea},
[MAPSEC_AQUA_HIDEOUT] = {19, 3, 1, 1, sMapName_AquaHideout},
[MAPSEC_MAGMA_HIDEOUT] = { 6, 3, 1, 1, sMapName_MagmaHideout},
[MAPSEC_MIRAGE_TOWER] = { 8, 2, 1, 1, sMapName_MirageTower},
[MAPSEC_BIRTH_ISLAND] = { 0, 0, 1, 1, sMapName_BirthIsland},
[MAPSEC_FARAWAY_ISLAND] = { 0, 0, 1, 1, sMapName_FarawayIsland},
[MAPSEC_ARTISAN_CAVE] = {22, 12, 1, 1, sMapName_ArtisanCave},
[MAPSEC_MARINE_CAVE] = { 0, 0, 1, 1, sMapName_MarineCave},
[MAPSEC_UNDERWATER_MARINE_CAVE] = { 0, 0, 1, 1, sMapName_Underwater},
[MAPSEC_TERRA_CAVE] = { 0, 0, 1, 1, sMapName_TerraCave},
[MAPSEC_UNDERWATER_105] = { 0, 10, 1, 3, sMapName_Underwater},
[MAPSEC_UNDERWATER_125] = {24, 3, 2, 2, sMapName_Underwater},
[MAPSEC_UNDERWATER_129] = {24, 10, 2, 1, sMapName_Underwater},
[MAPSEC_DESERT_UNDERPASS] = { 2, 0, 1, 1, sMapName_DesertUnderpass},
[MAPSEC_ALTERING_CAVE] = { 6, 8, 1, 1, sMapName_AlteringCave},
[MAPSEC_NAVEL_ROCK] = { 0, 0, 1, 1, sMapName_NavelRock},
[MAPSEC_TRAINER_HILL] = { 8, 4, 1, 1, sMapName_TrainerHill}
};
#endif //GUARD_DATA_REGION_MAP_REGION_MAP_ENTRIES_H

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,24 @@
{{ doNotModifyHeader }}
#ifndef GUARD_DATA_REGION_MAP_REGION_MAP_ENTRIES_H
#define GUARD_DATA_REGION_MAP_REGION_MAP_ENTRIES_H
## for map_section in map_sections
{% if isEmptyString(getVar(map_section.name)) and not existsIn(map_section, "name_clone") %}{{ setVar(map_section.name, map_section.map_section) }}{% endif %}
## endfor
## for map_section in map_sections
{% if getVar(map_section.name) == map_section.map_section %}
static const u8 sMapName_{{ cleanString(map_section.name) }}[] = _("{{ map_section.name }}");
{% endif %}
{% if existsIn(map_section, "name_clone") %}
static const u8 sMapName_{{ cleanString(map_section.name) }}_Clone[] = _("{{ map_section.name }}");
{% endif %}
## endfor
const struct RegionMapLocation gRegionMapEntries[] = {
## for map_section in map_sections
[{{ map_section.map_section }}] = { {{ map_section.x }}, {{ map_section.y }}, {{ map_section.width }}, {{ map_section.height }}, sMapName_{{ cleanString(map_section.name) }}{% if existsIn(map_section, "name_clone") %}_Clone{% endif %} },
## endfor
};
#endif // GUARD_DATA_REGION_MAP_REGION_MAP_ENTRIES_H

View File

@ -1,6 +1,6 @@
CXX ?= g++
CXXFLAGS := -Wall -std=c++11 -O2
CXXFLAGS := -Wall -std=c++17 -O2
INCLUDES := -I .

File diff suppressed because it is too large Load Diff

View File

@ -7,6 +7,9 @@
#include <string>
using std::string; using std::to_string;
#include <algorithm>
using std::replace_if;
#include <inja.hpp>
using namespace inja;
using json = nlohmann::json;
@ -33,6 +36,7 @@ int main(int argc, char *argv[])
string outputFilepath = argv[3];
Environment env;
env.set_trim_blocks(true);
// Add custom command callbacks.
env.add_callback("doNotModifyHeader", 0, [jsonfilepath, templateFilepath](Arguments& args) {
@ -96,6 +100,19 @@ int main(int argc, char *argv[])
return args.at(0)->empty();
});
env.add_callback("isEmptyString", 1, [](Arguments& args) {
return args.at(0)->get<string>().empty();
});
env.add_callback("cleanString", 1, [](Arguments& args) {
string badChars = ".'{} \n\t-_\u00e9";
string str = args.at(0)->get<string>();
str.erase(remove_if(str.begin(), str.end(), [&badChars](const char &c) {
return badChars.find(c) != std::string::npos;
}), str.end());
return str;
});
try
{
env.write_with_json_file(templateFilepath, jsonfilepath, outputFilepath);

File diff suppressed because it is too large Load Diff