14 auto *config_group = app.add_option_group(
"Config Options",
"Override configuration values");
15 config_group->footer(
"");
18 config_group->add_option(
19 "--num-tiles-in-primary",
21 "Number Of Tiles In Primary - The NUM_TILES_IN_PRIMARY setting from include/fieldmap.h.");
24 config_group->add_option(
27 "Number Of Tiles Total - The NUM_TILES_TOTAL setting from include/fieldmap.h.");
30 config_group->add_option(
31 "--num-metatiles-in-primary",
33 "Number Of Metatiles In Primary - The NUM_METATILES_IN_PRIMARY setting from include/fieldmap.h.");
36 config_group->add_option(
37 "--num-metatiles-total",
39 "Number Of Metatiles Total - The NUM_METATILES_TOTAL setting from include/fieldmap.h.");
42 config_group->add_option(
43 "--num-pals-in-primary",
45 "Number Of Palettes In Primary - The NUM_PALS_IN_PRIMARY setting from include/fieldmap.h.");
48 config_group->add_option(
51 "Number Of Palettes Total - The NUM_PALS_TOTAL setting from include/fieldmap.h.");
54 config_group->add_option(
55 "--max-map-data-size",
57 "Max Map Data Size - The MAX_MAP_DATA_SIZE setting from include/fieldmap.h.");
60 config_group->add_option(
61 "--num-tiles-per-metatile",
63 "Number Of Tiles Per Metatile - The NUM_TILES_PER_METATILE setting from include/fieldmap.h.");
68 "--extrinsic-transparency",
70 "Extrinsic Transparency - The RGB color to treat as transparent during compilation. (format: R,G,B or "
71 "R,G,B,A, values 0-255)")
72 ->type_name(
"R,G,B[,A]");
75 config_group->add_flag(
76 "--ignore-triple-layer-content,!--no-ignore-triple-layer-content",
77 [&storage](std::int64_t count) {
86 "Ignore Triple Layer Content - Demote the triple-layer-content-in-dual-mode error to a warning. When on, a "
87 "metatile with content on all three layers compiles in dual mode by dropping one layer group instead of "
88 "failing. The dropped layer follows the metatile's effective layer type: a 'layer_type' role pin if you set "
89 "one, otherwise the bottom layer.");
96 "Tiles Edit Mode - The allowed edit mode for the tiles.png artifact.")
97 ->type_name(
"{locked|patch|optimize}");
104 "Palettes Edit Mode - The allowed edit mode for the palettes/ artifacts.")
105 ->type_name(
"{locked|patch|optimize}");
108 config_group->add_flag(
109 "--pal-hints-enabled,!--no-pal-hints-enabled",
110 [&storage](std::int64_t count) {
114 else if (count < 0) {
119 "Palette Hints Enabled - Enable configured palette hints.");
124 "--packing-strategy",
126 "Packing Strategy - The palette packing algorithm to use during compilation.")
127 ->type_name(
"{best-fusion|backtracking|overload-and-remove}");
132 "--tile-sharing-packing",
134 "Tile Sharing Packing - Controls whether palette packing considers tile sharing.")
135 ->type_name(
"{off|biased|optimal}");
140 "--tile-sharing-alignment",
142 "Tile Sharing Alignment - Controls palette slot alignment strategy for tile sharing.")
143 ->type_name(
"{off|greedy|optimal}");
150 "Tiles Palette Mode - The color mode to use when saving the tiles.png artifact.")
151 ->type_name(
"{true-color|greyscale}");
157 "--anim-pal-resolution-strategy",
159 "Global Animation Palette Resolution Strategy - The global strategy for determining which palette to use "
160 "when decompiling animation tiles.")
162 "{scan-local-metatiles|palette-00|palette-01|palette-02|palette-03|palette-04|palette-05|palette-06|"
163 "palette-07|palette-08|palette-09|palette-10|palette-11|palette-12|palette-13|palette-14|palette-15|"
164 "internal-png-palette|scan-all-tilesets}");
170 "--anim-key-frame-resolution-strategy",
172 "Global Animation Key Frame Resolution Strategy - The strategy to use when decompilation encounters "
173 "duplicate key frame subtiles.")
174 ->type_name(
"{error|warning|mangle}");
180 "--anim-multi-pal-subtile-resolution-strategy",
182 "Global Animation Multi-Palette Subtile Resolution Strategy - The strategy for handling animation subtiles "
183 "referenced with multiple palettes.")
184 ->type_name(
"{error|warning|split}");
191 "Global Frame Linking - The global default frame linking mode for animations.")
192 ->type_name(
"{automatic|manual|hybrid}");
195 config_group->add_flag(
196 "--cross-tileset-anim-linking,!--no-cross-tileset-anim-linking",
197 [&storage](std::int64_t count) {
201 else if (count < 0) {
206 "Cross-Tileset Animation Linking - Enable automatic matching of secondary tiles against primary animation key "
210 config_group->add_flag(
211 "--verify-checksums,!--no-verify-checksums",
212 [&storage](std::int64_t count) {
216 else if (count < 0) {
221 "Verify Checksums - Enable or disable artifact checksum verification.");
226 "--primary-pairing-mode",
228 "Primary Pairing Mode - How a secondary tileset resolves its partner primary for compilation.")
229 ->type_name(
"{off|manual|automatic}");
232 config_group->add_option(
233 "--primary-pairing-partners",
235 "Primary Pairing Partners - Tileset names to use as partner primaries in manual pairing mode.");
238 config_group->add_option(
239 "--diagnostic-warnings-exclude",
241 "Diagnostic Warnings Exclude - Regex patterns for warning tags to exclude (overrides includes).");
244 config_group->add_option(
245 "--diagnostic-warnings-include",
247 "Diagnostic Warnings Include - Regex patterns for warning tags to show. Warnings are hidden unless a pattern "
248 "matches their tag.");
251 config_group->add_option(
252 "--diagnostic-remarks-exclude",
254 "Diagnostic Remarks Exclude - Regex patterns for remark tags to exclude (overrides includes).");
257 config_group->add_option(
258 "--diagnostic-remarks-include",
260 "Diagnostic Remarks Include - Regex patterns for remark tags to show. Remarks are hidden unless a pattern "
261 "matches their tag.");
264 config_group->add_option(
265 "--tileset-paths-primary-src",
267 "Tileset Paths Primary Source - The directory for primary tileset Porytiles component assets.");
270 config_group->add_option(
271 "--tileset-paths-primary-bin",
273 "Tileset Paths Primary Bin - The directory for primary tileset Porymap component assets.");
276 config_group->add_option(
277 "--tileset-paths-secondary-src",
279 "Tileset Paths Secondary Source - The directory for secondary tileset Porytiles component assets.");
282 config_group->add_option(
283 "--tileset-paths-secondary-bin",
285 "Tileset Paths Secondary Bin - The directory for secondary tileset Porymap component assets.");
288 config_group->add_option(
289 "--metatile-attribute-size",
291 "Metatile Attribute Size - Pins the size in bytes of each metatile attribute entry (1, 2, or 4). When unset, "
292 "Porytiles derives the size from the resolved attribute field masks, which struct Tileset's declared element "
293 "width must corroborate exactly. Must be set explicitly on projects that declare more than one mask layout "
294 "(pokeemerald-expansion), one value per build flavor, and on projects whose masks and struct Tileset "
295 "declaration disagree or whose declaration is unusable. Project-global.");
298 config_group->add_option(
299 "--metatile-attribute-declaration-size",
301 "Metatile Attribute Declaration Size - The declared element width in bytes (1, 2, or 4) for generated "
302 "gMetatileAttributes_* C declarations (const uN / INCBIN_UN). Normally inferred from struct Tileset's "
303 "metatileAttributes member in include/global.fieldmap.h. Required when that declaration is missing, "
304 "unreadable, or not a pointer to u8, u16, or u32, since nothing else in a project implies this width. "
308 config_group->add_flag(
309 "--tileset-animations-wire-anim-code,!--no-tileset-animations-wire-anim-code",
310 [&storage](std::int64_t count) {
314 else if (count < 0) {
319 "Tileset Animations Wire Anim Code - Enable or disable automatic animation code wiring.");
void register_config_options(CLI::App &app, CliOptionStorage &storage)
Registers all config options with a CLI11 App.
Storage struct for CLI option values.
std::optional< std::string > tiles_palette_mode
std::vector< std::string > diagnostic_remarks_include
std::optional< std::string > num_metatiles_in_primary
std::optional< std::string > tileset_paths_primary_bin
std::optional< std::string > packing_strategy
std::optional< std::string > cross_tileset_anim_linking
std::optional< std::string > palettes_edit_mode
std::optional< std::string > tiles_edit_mode
std::optional< std::string > num_tiles_total
std::optional< std::string > metatile_attribute_declaration_size
std::optional< std::string > tileset_paths_secondary_bin
std::optional< std::string > tileset_animations_wire_anim_code
std::optional< std::string > num_tiles_per_metatile
std::optional< std::string > max_map_data_size
std::optional< std::string > metatile_attribute_size
std::optional< std::string > global_anim_palette_resolution_strategy
std::optional< std::string > tileset_paths_primary_src
std::optional< std::string > tileset_paths_secondary_src
std::optional< std::string > global_anim_multi_palette_subtile_resolution_strategy
std::optional< std::string > tile_sharing_packing
std::optional< std::string > num_tiles_in_primary
std::optional< std::string > num_palettes_in_primary
std::optional< std::string > num_palettes_total
std::vector< std::string > diagnostic_warnings_include
std::optional< std::string > global_frame_linking
std::optional< std::string > global_anim_key_frame_resolution_strategy
std::vector< std::string > diagnostic_remarks_exclude
std::optional< std::string > ignore_triple_layer_content
std::optional< std::string > palette_hints_enabled
std::optional< std::string > num_metatiles_total
std::optional< std::string > extrinsic_transparency
std::vector< std::string > diagnostic_warnings_exclude
std::optional< std::string > tile_sharing_alignment
std::optional< std::string > primary_pairing_mode
std::optional< std::string > verify_checksums
std::vector< std::string > primary_pairing_partners