17 : scope_type_{scope_type}, scope_{std::move(scope)}, source_info_{std::move(source_info)}
23 return "OverrideConfigProvider(" + source_info_ +
")";
26bool OverrideConfigProvider::scope_matches(
ConfigScopeType type,
const std::string &scope)
const
28 return type == scope_type_ && scope == scope_;
33 num_tiles_in_primary_override_ = std::move(value);
38 num_tiles_total_override_ = std::move(value);
43 num_metatiles_in_primary_override_ = std::move(value);
48 num_metatiles_total_override_ = std::move(value);
53 num_pals_in_primary_override_ = std::move(value);
58 num_pals_total_override_ = std::move(value);
63 max_map_data_size_override_ = std::move(value);
68 num_tiles_per_metatile_override_ = std::move(value);
73 extrinsic_transparency_override_ = std::move(value);
78 tiles_edit_mode_override_ = std::move(value);
83 pals_edit_mode_override_ = std::move(value);
88 pal_hints_enabled_override_ = std::move(value);
93 pal_hints_override_ = std::move(value);
98 packing_strategy_override_ = std::move(value);
103 packing_strategy_params_override_ = std::move(value);
108 tile_sharing_packing_override_ = std::move(value);
113 tile_sharing_alignment_override_ = std::move(value);
118 tiles_pal_mode_override_ = std::move(value);
123 global_anim_pal_resolution_strategy_override_ = std::move(value);
128 global_anim_key_frame_resolution_strategy_override_ = std::move(value);
133 global_anim_multi_pal_subtile_resolution_strategy_override_ = std::move(value);
138 global_frame_linking_override_ = std::move(value);
143 per_anim_overrides_override_ = std::move(value);
148 cross_tileset_anim_linking_override_ = std::move(value);
153 verify_checksums_override_ = std::move(value);
158 primary_pairing_mode_override_ = std::move(value);
163 primary_pairing_partners_override_ = std::move(value);
168 diagnostic_warnings_exclude_override_ = std::move(value);
173 diagnostic_warnings_include_override_ = std::move(value);
178 diagnostic_remarks_exclude_override_ = std::move(value);
183 diagnostic_remarks_include_override_ = std::move(value);
188 tileset_paths_primary_src_override_ = std::move(value);
193 tileset_paths_primary_bin_override_ = std::move(value);
198 tileset_paths_secondary_src_override_ = std::move(value);
203 tileset_paths_secondary_bin_override_ = std::move(value);
208 metatile_attr_size_override_ = std::move(value);
213 tileset_animations_wire_anim_code_override_ = std::move(value);
219 if (!scope_matches(type, scope) || !num_tiles_in_primary_override_.has_value()) {
223 num_tiles_in_primary_override_.value(),
"num_tiles_in_primary", source_info_);
229 if (!scope_matches(type, scope) || !num_tiles_total_override_.has_value()) {
233 num_tiles_total_override_.value(),
"num_tiles_total", source_info_);
239 if (!scope_matches(type, scope) || !num_metatiles_in_primary_override_.has_value()) {
243 num_metatiles_in_primary_override_.value(),
"num_metatiles_in_primary", source_info_);
249 if (!scope_matches(type, scope) || !num_metatiles_total_override_.has_value()) {
253 num_metatiles_total_override_.value(),
"num_metatiles_total", source_info_);
259 if (!scope_matches(type, scope) || !num_pals_in_primary_override_.has_value()) {
263 num_pals_in_primary_override_.value(),
"num_pals_in_primary", source_info_);
269 if (!scope_matches(type, scope) || !num_pals_total_override_.has_value()) {
273 num_pals_total_override_.value(),
"num_pals_total", source_info_);
279 if (!scope_matches(type, scope) || !max_map_data_size_override_.has_value()) {
283 max_map_data_size_override_.value(),
"max_map_data_size", source_info_);
289 if (!scope_matches(type, scope) || !num_tiles_per_metatile_override_.has_value()) {
293 num_tiles_per_metatile_override_.value(),
"num_tiles_per_metatile", source_info_);
299 if (!scope_matches(type, scope) || !extrinsic_transparency_override_.has_value()) {
303 extrinsic_transparency_override_.value(),
"extrinsic_transparency", source_info_);
309 if (!scope_matches(type, scope) || !tiles_edit_mode_override_.has_value()) {
313 tiles_edit_mode_override_.value(),
"tiles_edit_mode", source_info_);
319 if (!scope_matches(type, scope) || !pals_edit_mode_override_.has_value()) {
323 pals_edit_mode_override_.value(),
"pals_edit_mode", source_info_);
329 if (!scope_matches(type, scope) || !pal_hints_enabled_override_.has_value()) {
333 pal_hints_enabled_override_.value(),
"pal_hints_enabled", source_info_);
339 if (!scope_matches(type, scope) || !pal_hints_override_.has_value()) {
343 pal_hints_override_.value(),
"pal_hints", source_info_);
349 if (!scope_matches(type, scope) || !packing_strategy_override_.has_value()) {
353 packing_strategy_override_.value(),
"packing_strategy", source_info_);
359 if (!scope_matches(type, scope) || !packing_strategy_params_override_.has_value()) {
363 packing_strategy_params_override_.value(),
"packing_strategy_params", source_info_);
369 if (!scope_matches(type, scope) || !tile_sharing_packing_override_.has_value()) {
373 tile_sharing_packing_override_.value(),
"tile_sharing_packing", source_info_);
379 if (!scope_matches(type, scope) || !tile_sharing_alignment_override_.has_value()) {
383 tile_sharing_alignment_override_.value(),
"tile_sharing_alignment", source_info_);
389 if (!scope_matches(type, scope) || !tiles_pal_mode_override_.has_value()) {
393 tiles_pal_mode_override_.value(),
"tiles_pal_mode", source_info_);
399 if (!scope_matches(type, scope) || !global_anim_pal_resolution_strategy_override_.has_value()) {
403 global_anim_pal_resolution_strategy_override_.value(),
"global_anim_pal_resolution_strategy", source_info_);
409 if (!scope_matches(type, scope) || !global_anim_key_frame_resolution_strategy_override_.has_value()) {
413 global_anim_key_frame_resolution_strategy_override_.value(),
"global_anim_key_frame_resolution_strategy", source_info_);
419 if (!scope_matches(type, scope) || !global_anim_multi_pal_subtile_resolution_strategy_override_.has_value()) {
423 global_anim_multi_pal_subtile_resolution_strategy_override_.value(),
"global_anim_multi_pal_subtile_resolution_strategy", source_info_);
429 if (!scope_matches(type, scope) || !global_frame_linking_override_.has_value()) {
433 global_frame_linking_override_.value(),
"global_frame_linking", source_info_);
439 if (!scope_matches(type, scope) || !per_anim_overrides_override_.has_value()) {
443 per_anim_overrides_override_.value(),
"per_anim_overrides", source_info_);
449 if (!scope_matches(type, scope) || !cross_tileset_anim_linking_override_.has_value()) {
453 cross_tileset_anim_linking_override_.value(),
"cross_tileset_anim_linking", source_info_);
459 if (!scope_matches(type, scope) || !verify_checksums_override_.has_value()) {
463 verify_checksums_override_.value(),
"verify_checksums", source_info_);
469 if (!scope_matches(type, scope) || !primary_pairing_mode_override_.has_value()) {
473 primary_pairing_mode_override_.value(),
"primary_pairing_mode", source_info_);
479 if (!scope_matches(type, scope) || !primary_pairing_partners_override_.has_value()) {
483 primary_pairing_partners_override_.value(),
"primary_pairing_partners", source_info_);
489 if (!scope_matches(type, scope) || !diagnostic_warnings_exclude_override_.has_value()) {
493 diagnostic_warnings_exclude_override_.value(),
"diagnostic_warnings_exclude", source_info_);
499 if (!scope_matches(type, scope) || !diagnostic_warnings_include_override_.has_value()) {
503 diagnostic_warnings_include_override_.value(),
"diagnostic_warnings_include", source_info_);
509 if (!scope_matches(type, scope) || !diagnostic_remarks_exclude_override_.has_value()) {
513 diagnostic_remarks_exclude_override_.value(),
"diagnostic_remarks_exclude", source_info_);
519 if (!scope_matches(type, scope) || !diagnostic_remarks_include_override_.has_value()) {
523 diagnostic_remarks_include_override_.value(),
"diagnostic_remarks_include", source_info_);
529 if (!scope_matches(type, scope) || !tileset_paths_primary_src_override_.has_value()) {
533 tileset_paths_primary_src_override_.value(),
"tileset_paths_primary_src", source_info_);
539 if (!scope_matches(type, scope) || !tileset_paths_primary_bin_override_.has_value()) {
543 tileset_paths_primary_bin_override_.value(),
"tileset_paths_primary_bin", source_info_);
549 if (!scope_matches(type, scope) || !tileset_paths_secondary_src_override_.has_value()) {
553 tileset_paths_secondary_src_override_.value(),
"tileset_paths_secondary_src", source_info_);
559 if (!scope_matches(type, scope) || !tileset_paths_secondary_bin_override_.has_value()) {
563 tileset_paths_secondary_bin_override_.value(),
"tileset_paths_secondary_bin", source_info_);
569 if (!scope_matches(type, scope) || !metatile_attr_size_override_.has_value()) {
573 metatile_attr_size_override_.value(),
"metatile_attr_size", source_info_);
579 if (!scope_matches(type, scope) || !tileset_animations_wire_anim_code_override_.has_value()) {
583 tileset_animations_wire_anim_code_override_.value(),
"tileset_animations_wire_anim_code", source_info_);
LayerValue< std::string > tileset_paths_secondary_bin(ConfigScopeType type, const std::string &scope) const override
void set_num_tiles_total(std::size_t value)
LayerValue< PerAnimOverrides > per_anim_overrides(ConfigScopeType type, const std::string &scope) const override
LayerValue< std::vector< std::string > > diagnostic_remarks_include(ConfigScopeType type, const std::string &scope) const override
LayerValue< std::size_t > metatile_attr_size(ConfigScopeType type, const std::string &scope) const override
void set_global_anim_key_frame_resolution_strategy(AnimKeyFrameResolutionStrategy value)
LayerValue< std::string > tileset_paths_primary_src(ConfigScopeType type, const std::string &scope) const override
LayerValue< std::size_t > max_map_data_size(ConfigScopeType type, const std::string &scope) const override
void set_global_frame_linking(FrameLinking value)
LayerValue< std::vector< PaletteHint > > pal_hints(ConfigScopeType type, const std::string &scope) const override
LayerValue< FrameLinking > global_frame_linking(ConfigScopeType type, const std::string &scope) const override
LayerValue< std::size_t > num_metatiles_in_primary(ConfigScopeType type, const std::string &scope) const override
void set_tileset_paths_secondary_src(std::string value)
LayerValue< AnimMultiPalSubtileResolutionStrategy > global_anim_multi_pal_subtile_resolution_strategy(ConfigScopeType type, const std::string &scope) const override
LayerValue< AnimPalResolutionStrategy > global_anim_pal_resolution_strategy(ConfigScopeType type, const std::string &scope) const override
LayerValue< bool > cross_tileset_anim_linking(ConfigScopeType type, const std::string &scope) const override
void set_num_metatiles_total(std::size_t value)
LayerValue< AnimKeyFrameResolutionStrategy > global_anim_key_frame_resolution_strategy(ConfigScopeType type, const std::string &scope) const override
void set_num_metatiles_in_primary(std::size_t value)
OverrideConfigProvider(ConfigScopeType scope_type, std::string scope, std::string source_info)
Constructs an OverrideConfigProvider scoped to a single config scope.
LayerValue< std::size_t > num_pals_total(ConfigScopeType type, const std::string &scope) const override
void set_primary_pairing_mode(PrimaryPairingMode value)
LayerValue< PackingStrategyType > packing_strategy(ConfigScopeType type, const std::string &scope) const override
void set_pals_edit_mode(ArtifactEditMode value)
void set_packing_strategy(PackingStrategyType value)
LayerValue< std::vector< std::string > > diagnostic_warnings_exclude(ConfigScopeType type, const std::string &scope) const override
void set_tile_sharing_packing(TileSharingPacking value)
void set_diagnostic_warnings_exclude(std::vector< std::string > value)
void set_max_map_data_size(std::size_t value)
void set_extrinsic_transparency(Rgba32 value)
LayerValue< std::size_t > num_pals_in_primary(ConfigScopeType type, const std::string &scope) const override
LayerValue< std::vector< std::string > > diagnostic_warnings_include(ConfigScopeType type, const std::string &scope) const override
void set_cross_tileset_anim_linking(bool value)
void set_tileset_animations_wire_anim_code(bool value)
LayerValue< std::size_t > num_tiles_in_primary(ConfigScopeType type, const std::string &scope) const override
void set_global_anim_multi_pal_subtile_resolution_strategy(AnimMultiPalSubtileResolutionStrategy value)
void set_tiles_edit_mode(ArtifactEditMode value)
LayerValue< TilesPalMode > tiles_pal_mode(ConfigScopeType type, const std::string &scope) const override
LayerValue< bool > tileset_animations_wire_anim_code(ConfigScopeType type, const std::string &scope) const override
void set_num_tiles_per_metatile(std::size_t value)
void set_packing_strategy_params(PackingStrategyParams value)
LayerValue< PrimaryPairingMode > primary_pairing_mode(ConfigScopeType type, const std::string &scope) const override
LayerValue< bool > pal_hints_enabled(ConfigScopeType type, const std::string &scope) const override
LayerValue< std::vector< std::string > > primary_pairing_partners(ConfigScopeType type, const std::string &scope) const override
void set_tileset_paths_primary_src(std::string value)
void set_diagnostic_remarks_include(std::vector< std::string > value)
LayerValue< std::string > tileset_paths_secondary_src(ConfigScopeType type, const std::string &scope) const override
LayerValue< Rgba32 > extrinsic_transparency(ConfigScopeType type, const std::string &scope) const override
void set_metatile_attr_size(std::size_t value)
void set_pal_hints(std::vector< PaletteHint > value)
LayerValue< ArtifactEditMode > pals_edit_mode(ConfigScopeType type, const std::string &scope) const override
void set_per_anim_overrides(PerAnimOverrides value)
void set_diagnostic_remarks_exclude(std::vector< std::string > value)
void set_tileset_paths_secondary_bin(std::string value)
void set_num_pals_in_primary(std::size_t value)
LayerValue< bool > verify_checksums(ConfigScopeType type, const std::string &scope) const override
LayerValue< ArtifactEditMode > tiles_edit_mode(ConfigScopeType type, const std::string &scope) const override
std::string name() const override
Gets the name of this ConfigProvider, useful for diagnostic purposes.
void set_diagnostic_warnings_include(std::vector< std::string > value)
LayerValue< std::size_t > num_tiles_total(ConfigScopeType type, const std::string &scope) const override
void set_num_pals_total(std::size_t value)
LayerValue< TileSharingAlignment > tile_sharing_alignment(ConfigScopeType type, const std::string &scope) const override
LayerValue< std::vector< std::string > > diagnostic_remarks_exclude(ConfigScopeType type, const std::string &scope) const override
LayerValue< std::size_t > num_tiles_per_metatile(ConfigScopeType type, const std::string &scope) const override
void set_verify_checksums(bool value)
LayerValue< TileSharingPacking > tile_sharing_packing(ConfigScopeType type, const std::string &scope) const override
LayerValue< PackingStrategyParams > packing_strategy_params(ConfigScopeType type, const std::string &scope) const override
LayerValue< std::size_t > num_metatiles_total(ConfigScopeType type, const std::string &scope) const override
void set_tile_sharing_alignment(TileSharingAlignment value)
void set_primary_pairing_partners(std::vector< std::string > value)
void set_global_anim_pal_resolution_strategy(AnimPalResolutionStrategy value)
void set_tiles_pal_mode(TilesPalMode value)
void set_tileset_paths_primary_bin(std::string value)
LayerValue< std::string > tileset_paths_primary_bin(ConfigScopeType type, const std::string &scope) const override
void set_num_tiles_in_primary(std::size_t value)
void set_pal_hints_enabled(bool value)
Represents a 32-bit RGBA color.
PrimaryPairingMode
Controls how a secondary tileset finds its partner primary for compilation.
TilesPalMode
Controls how tiles.png is rendered.
AnimPalResolutionStrategy
Strategy for determining which palette to use when decompiling animation tiles.
TileSharingAlignment
Controls palette slot alignment strategy for tile sharing deduplication.
AnimMultiPalSubtileResolutionStrategy
Strategy for handling animation subtiles referenced with multiple palettes.
ArtifactEditMode
Specifies whether artifacts (tiles or palettes) can be modified during patch compilation.
std::unordered_map< std::string, PerAnimOverride > PerAnimOverrides
Per-animation configuration map.
TileSharingPacking
Controls whether palette packing considers tile sharing shape group membership.
AnimKeyFrameResolutionStrategy
Strategy for handling duplicate key frame tiles in animation decompilation.
FrameLinking
Controls how animation frames are linked to metatile entries.
ConfigScopeType
Specifies the scope type for configuration value lookups.
PackingStrategyType
Selects the palette packing algorithm to use during tileset compilation.
A small container that holds an optional-wrapped value, validation state, and metadata about the valu...
static LayerValue valid(T val, std::string source_key, std::string source_info)
Creates a LayerValue representing a valid configuration value.
static LayerValue not_provided()
Creates a LayerValue representing that the provider does not supply this configuration.
Container for per-strategy packing parameters.