Porytiles
Loading...
Searching...
No Matches
override_config_provider.cpp
Go to the documentation of this file.
2
3#include <string>
4#include <utility>
5
6/*
7 * NOTE: DO NOT EDIT THIS FILE DIRECTLY. It is AUTO-GENERATED from config_schema.yaml.
8 * To add new config values or make other changes, edit config_schema.yaml and regenerate via:
9 *
10 * uv run scripts/generate_config.py
11 */
12
13namespace porytiles {
14
16 ConfigScopeType scope_type, std::string scope, std::string source_info)
17 : scope_type_{scope_type}, scope_{std::move(scope)}, source_info_{std::move(source_info)}
18{
19}
20
22{
23 return "OverrideConfigProvider(" + source_info_ + ")";
24}
25
26bool OverrideConfigProvider::scope_matches(ConfigScopeType type, const std::string &scope) const
27{
28 return type == scope_type_ && scope == scope_;
29}
30
32{
33 num_tiles_in_primary_override_ = std::move(value);
34}
35
37{
38 num_tiles_total_override_ = std::move(value);
39}
40
42{
43 num_metatiles_in_primary_override_ = std::move(value);
44}
45
47{
48 num_metatiles_total_override_ = std::move(value);
49}
50
52{
53 num_pals_in_primary_override_ = std::move(value);
54}
55
57{
58 num_pals_total_override_ = std::move(value);
59}
60
62{
63 max_map_data_size_override_ = std::move(value);
64}
65
67{
68 num_tiles_per_metatile_override_ = std::move(value);
69}
70
72{
73 extrinsic_transparency_override_ = std::move(value);
74}
75
77{
78 tiles_edit_mode_override_ = std::move(value);
79}
80
82{
83 pals_edit_mode_override_ = std::move(value);
84}
85
87{
88 pal_hints_enabled_override_ = std::move(value);
89}
90
91void OverrideConfigProvider::set_pal_hints(std::vector<PaletteHint> value)
92{
93 pal_hints_override_ = std::move(value);
94}
95
97{
98 packing_strategy_override_ = std::move(value);
99}
100
102{
103 packing_strategy_params_override_ = std::move(value);
104}
105
107{
108 tile_sharing_packing_override_ = std::move(value);
109}
110
112{
113 tile_sharing_alignment_override_ = std::move(value);
114}
115
117{
118 tiles_pal_mode_override_ = std::move(value);
119}
120
122{
123 global_anim_pal_resolution_strategy_override_ = std::move(value);
124}
125
127{
128 global_anim_key_frame_resolution_strategy_override_ = std::move(value);
129}
130
132{
133 global_anim_multi_pal_subtile_resolution_strategy_override_ = std::move(value);
134}
135
137{
138 global_frame_linking_override_ = std::move(value);
139}
140
142{
143 per_anim_overrides_override_ = std::move(value);
144}
145
147{
148 cross_tileset_anim_linking_override_ = std::move(value);
149}
150
152{
153 verify_checksums_override_ = std::move(value);
154}
155
157{
158 primary_pairing_mode_override_ = std::move(value);
159}
160
162{
163 primary_pairing_partners_override_ = std::move(value);
164}
165
167{
168 diagnostic_warnings_exclude_override_ = std::move(value);
169}
170
172{
173 diagnostic_warnings_include_override_ = std::move(value);
174}
175
177{
178 diagnostic_remarks_exclude_override_ = std::move(value);
179}
180
182{
183 diagnostic_remarks_include_override_ = std::move(value);
184}
185
187{
188 tileset_paths_primary_src_override_ = std::move(value);
189}
190
192{
193 tileset_paths_primary_bin_override_ = std::move(value);
194}
195
197{
198 tileset_paths_secondary_src_override_ = std::move(value);
199}
200
202{
203 tileset_paths_secondary_bin_override_ = std::move(value);
204}
205
207{
208 metatile_attr_size_override_ = std::move(value);
209}
210
212{
213 tileset_animations_wire_anim_code_override_ = std::move(value);
214}
215
218{
219 if (!scope_matches(type, scope) || !num_tiles_in_primary_override_.has_value()) {
221 }
223 num_tiles_in_primary_override_.value(), "num_tiles_in_primary", source_info_);
224}
225
227OverrideConfigProvider::num_tiles_total(ConfigScopeType type, const std::string &scope) const
228{
229 if (!scope_matches(type, scope) || !num_tiles_total_override_.has_value()) {
231 }
233 num_tiles_total_override_.value(), "num_tiles_total", source_info_);
234}
235
238{
239 if (!scope_matches(type, scope) || !num_metatiles_in_primary_override_.has_value()) {
241 }
243 num_metatiles_in_primary_override_.value(), "num_metatiles_in_primary", source_info_);
244}
245
248{
249 if (!scope_matches(type, scope) || !num_metatiles_total_override_.has_value()) {
251 }
253 num_metatiles_total_override_.value(), "num_metatiles_total", source_info_);
254}
255
258{
259 if (!scope_matches(type, scope) || !num_pals_in_primary_override_.has_value()) {
261 }
263 num_pals_in_primary_override_.value(), "num_pals_in_primary", source_info_);
264}
265
267OverrideConfigProvider::num_pals_total(ConfigScopeType type, const std::string &scope) const
268{
269 if (!scope_matches(type, scope) || !num_pals_total_override_.has_value()) {
271 }
273 num_pals_total_override_.value(), "num_pals_total", source_info_);
274}
275
278{
279 if (!scope_matches(type, scope) || !max_map_data_size_override_.has_value()) {
281 }
283 max_map_data_size_override_.value(), "max_map_data_size", source_info_);
284}
285
288{
289 if (!scope_matches(type, scope) || !num_tiles_per_metatile_override_.has_value()) {
291 }
293 num_tiles_per_metatile_override_.value(), "num_tiles_per_metatile", source_info_);
294}
295
298{
299 if (!scope_matches(type, scope) || !extrinsic_transparency_override_.has_value()) {
301 }
303 extrinsic_transparency_override_.value(), "extrinsic_transparency", source_info_);
304}
305
307OverrideConfigProvider::tiles_edit_mode(ConfigScopeType type, const std::string &scope) const
308{
309 if (!scope_matches(type, scope) || !tiles_edit_mode_override_.has_value()) {
311 }
313 tiles_edit_mode_override_.value(), "tiles_edit_mode", source_info_);
314}
315
317OverrideConfigProvider::pals_edit_mode(ConfigScopeType type, const std::string &scope) const
318{
319 if (!scope_matches(type, scope) || !pals_edit_mode_override_.has_value()) {
321 }
323 pals_edit_mode_override_.value(), "pals_edit_mode", source_info_);
324}
325
328{
329 if (!scope_matches(type, scope) || !pal_hints_enabled_override_.has_value()) {
331 }
333 pal_hints_enabled_override_.value(), "pal_hints_enabled", source_info_);
334}
335
337OverrideConfigProvider::pal_hints(ConfigScopeType type, const std::string &scope) const
338{
339 if (!scope_matches(type, scope) || !pal_hints_override_.has_value()) {
341 }
343 pal_hints_override_.value(), "pal_hints", source_info_);
344}
345
348{
349 if (!scope_matches(type, scope) || !packing_strategy_override_.has_value()) {
351 }
353 packing_strategy_override_.value(), "packing_strategy", source_info_);
354}
355
358{
359 if (!scope_matches(type, scope) || !packing_strategy_params_override_.has_value()) {
361 }
363 packing_strategy_params_override_.value(), "packing_strategy_params", source_info_);
364}
365
368{
369 if (!scope_matches(type, scope) || !tile_sharing_packing_override_.has_value()) {
371 }
373 tile_sharing_packing_override_.value(), "tile_sharing_packing", source_info_);
374}
375
378{
379 if (!scope_matches(type, scope) || !tile_sharing_alignment_override_.has_value()) {
381 }
383 tile_sharing_alignment_override_.value(), "tile_sharing_alignment", source_info_);
384}
385
387OverrideConfigProvider::tiles_pal_mode(ConfigScopeType type, const std::string &scope) const
388{
389 if (!scope_matches(type, scope) || !tiles_pal_mode_override_.has_value()) {
391 }
393 tiles_pal_mode_override_.value(), "tiles_pal_mode", source_info_);
394}
395
398{
399 if (!scope_matches(type, scope) || !global_anim_pal_resolution_strategy_override_.has_value()) {
401 }
403 global_anim_pal_resolution_strategy_override_.value(), "global_anim_pal_resolution_strategy", source_info_);
404}
405
408{
409 if (!scope_matches(type, scope) || !global_anim_key_frame_resolution_strategy_override_.has_value()) {
411 }
413 global_anim_key_frame_resolution_strategy_override_.value(), "global_anim_key_frame_resolution_strategy", source_info_);
414}
415
418{
419 if (!scope_matches(type, scope) || !global_anim_multi_pal_subtile_resolution_strategy_override_.has_value()) {
421 }
423 global_anim_multi_pal_subtile_resolution_strategy_override_.value(), "global_anim_multi_pal_subtile_resolution_strategy", source_info_);
424}
425
428{
429 if (!scope_matches(type, scope) || !global_frame_linking_override_.has_value()) {
431 }
433 global_frame_linking_override_.value(), "global_frame_linking", source_info_);
434}
435
438{
439 if (!scope_matches(type, scope) || !per_anim_overrides_override_.has_value()) {
441 }
443 per_anim_overrides_override_.value(), "per_anim_overrides", source_info_);
444}
445
448{
449 if (!scope_matches(type, scope) || !cross_tileset_anim_linking_override_.has_value()) {
451 }
453 cross_tileset_anim_linking_override_.value(), "cross_tileset_anim_linking", source_info_);
454}
455
458{
459 if (!scope_matches(type, scope) || !verify_checksums_override_.has_value()) {
461 }
463 verify_checksums_override_.value(), "verify_checksums", source_info_);
464}
465
468{
469 if (!scope_matches(type, scope) || !primary_pairing_mode_override_.has_value()) {
471 }
473 primary_pairing_mode_override_.value(), "primary_pairing_mode", source_info_);
474}
475
478{
479 if (!scope_matches(type, scope) || !primary_pairing_partners_override_.has_value()) {
481 }
483 primary_pairing_partners_override_.value(), "primary_pairing_partners", source_info_);
484}
485
488{
489 if (!scope_matches(type, scope) || !diagnostic_warnings_exclude_override_.has_value()) {
491 }
493 diagnostic_warnings_exclude_override_.value(), "diagnostic_warnings_exclude", source_info_);
494}
495
498{
499 if (!scope_matches(type, scope) || !diagnostic_warnings_include_override_.has_value()) {
501 }
503 diagnostic_warnings_include_override_.value(), "diagnostic_warnings_include", source_info_);
504}
505
508{
509 if (!scope_matches(type, scope) || !diagnostic_remarks_exclude_override_.has_value()) {
511 }
513 diagnostic_remarks_exclude_override_.value(), "diagnostic_remarks_exclude", source_info_);
514}
515
518{
519 if (!scope_matches(type, scope) || !diagnostic_remarks_include_override_.has_value()) {
521 }
523 diagnostic_remarks_include_override_.value(), "diagnostic_remarks_include", source_info_);
524}
525
528{
529 if (!scope_matches(type, scope) || !tileset_paths_primary_src_override_.has_value()) {
531 }
533 tileset_paths_primary_src_override_.value(), "tileset_paths_primary_src", source_info_);
534}
535
538{
539 if (!scope_matches(type, scope) || !tileset_paths_primary_bin_override_.has_value()) {
541 }
543 tileset_paths_primary_bin_override_.value(), "tileset_paths_primary_bin", source_info_);
544}
545
548{
549 if (!scope_matches(type, scope) || !tileset_paths_secondary_src_override_.has_value()) {
551 }
553 tileset_paths_secondary_src_override_.value(), "tileset_paths_secondary_src", source_info_);
554}
555
558{
559 if (!scope_matches(type, scope) || !tileset_paths_secondary_bin_override_.has_value()) {
561 }
563 tileset_paths_secondary_bin_override_.value(), "tileset_paths_secondary_bin", source_info_);
564}
565
568{
569 if (!scope_matches(type, scope) || !metatile_attr_size_override_.has_value()) {
571 }
573 metatile_attr_size_override_.value(), "metatile_attr_size", source_info_);
574}
575
578{
579 if (!scope_matches(type, scope) || !tileset_animations_wire_anim_code_override_.has_value()) {
581 }
583 tileset_animations_wire_anim_code_override_.value(), "tileset_animations_wire_anim_code", source_info_);
584}
585
586} // namespace porytiles
LayerValue< std::string > tileset_paths_secondary_bin(ConfigScopeType type, const std::string &scope) const override
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
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
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)
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
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_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_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)
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
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
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_tileset_paths_primary_bin(std::string value)
LayerValue< std::string > tileset_paths_primary_bin(ConfigScopeType type, const std::string &scope) const override
Represents a 32-bit RGBA color.
Definition rgba32.hpp:23
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.