From a462db5e69a47763ac40798a04b132c28c5be89a Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Fri, 9 Sep 2022 23:34:05 -0400 Subject: [PATCH] Automated creation of MAP_GROUP_COUNT for the debug menu --- src/data/map_group_count.h | 1 + src/debug.c | 5 +---- tools/mapjson/mapjson.cpp | 16 +++++++++------- 3 files changed, 11 insertions(+), 11 deletions(-) create mode 100644 src/data/map_group_count.h diff --git a/src/data/map_group_count.h b/src/data/map_group_count.h new file mode 100644 index 0000000000..4fe8a21b3b --- /dev/null +++ b/src/data/map_group_count.h @@ -0,0 +1 @@ +static const u8 MAP_GROUP_COUNT[] = {57, 5, 5, 6, 7, 8, 9, 7, 7, 14, 8, 17, 10, 23, 13, 15, 15, 2, 2, 2, 3, 1, 1, 1, 108, 61, 89, 2, 1, 13, 1, 1, 3, 1, 0}; diff --git a/src/debug.c b/src/debug.c index 4cc1ac6168..e5a2d851af 100644 --- a/src/debug.c +++ b/src/debug.c @@ -282,10 +282,7 @@ extern u8 Debug_CheatStart[]; extern u8 PlayersHouse_2F_EventScript_SetWallClock[]; extern u8 PlayersHouse_2F_EventScript_CheckWallClock[]; - -// ******************************* -//Maps per map group COPY FROM /include/constants/map_groups.h -static const u8 MAP_GROUP_COUNT[] = {57, 5, 5, 6, 7, 8, 9, 7, 7, 14, 8, 17, 10, 23, 13, 15, 15, 2, 2, 2, 3, 1, 1, 1, 108, 61, 89, 2, 1, 13, 1, 1, 3, 1, 0}; +#include "data/map_group_count.h" // Text // Main Menu diff --git a/tools/mapjson/mapjson.cpp b/tools/mapjson/mapjson.cpp index 8de9ff8d01..4694bfaca2 100644 --- a/tools/mapjson/mapjson.cpp +++ b/tools/mapjson/mapjson.cpp @@ -386,6 +386,7 @@ string generate_map_constants_text(string groups_filepath, Json groups_data) { char dir_separator = file_dir.back(); ostringstream text; + ostringstream mapCountText; text << "#ifndef GUARD_CONSTANTS_MAP_GROUPS_H\n" << "#define GUARD_CONSTANTS_MAP_GROUPS_H\n\n"; @@ -424,15 +425,16 @@ string generate_map_constants_text(string groups_filepath, Json groups_data) { } text << "#define MAP_GROUPS_COUNT " << group_num << "\n\n"; - - text << "// static const u8 MAP_GROUP_COUNT[] = {"; //DEBUG - for(int i=0; i