Porytiles
Loading...
Searching...
No Matches
override_config_provider.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <optional>
4#include <string>
5
7
8namespace porytiles {
9
10// NOTE: DO NOT EDIT THIS FILE DIRECTLY. It is AUTO-GENERATED from config_schema.yaml.
11// To add new config values or make other changes, edit config_schema.yaml and regenerate via:
12//
13// uv run scripts/generate_config.py
14
28 public:
36 OverrideConfigProvider(ConfigScopeType scope_type, std::string scope, std::string source_info);
37
38 [[nodiscard]] std::string name() const override;
39
40 void set_num_tiles_in_primary(std::size_t value);
41 void set_num_tiles_total(std::size_t value);
42 void set_num_metatiles_in_primary(std::size_t value);
43 void set_num_metatiles_total(std::size_t value);
44 void set_num_palettes_in_primary(std::size_t value);
45 void set_num_palettes_total(std::size_t value);
46 void set_max_map_data_size(std::size_t value);
47 void set_num_tiles_per_metatile(std::size_t value);
49 void set_ignore_triple_layer_content(bool value);
52 void set_palette_hints_enabled(bool value);
53 void set_palette_hints(std::vector<PaletteHint> value);
64 void set_cross_tileset_anim_linking(bool value);
65 void set_verify_checksums(bool value);
67 void set_primary_pairing_partners(std::vector<std::string> value);
68 void set_diagnostic_warnings_exclude(std::vector<std::string> value);
69 void set_diagnostic_warnings_include(std::vector<std::string> value);
70 void set_diagnostic_remarks_exclude(std::vector<std::string> value);
71 void set_diagnostic_remarks_include(std::vector<std::string> value);
72 void set_tileset_paths_primary_src(std::string value);
73 void set_tileset_paths_primary_bin(std::string value);
74 void set_tileset_paths_secondary_src(std::string value);
75 void set_tileset_paths_secondary_bin(std::string value);
76 void set_metatile_attribute_size(std::optional<std::size_t> value);
77 void set_metatile_attribute_declaration_size(std::optional<std::size_t> value);
82
83 [[nodiscard]] LayerValue<std::size_t>
84 num_tiles_in_primary(ConfigScopeType type, const std::string &scope) const override;
85 [[nodiscard]] LayerValue<std::size_t>
86 num_tiles_total(ConfigScopeType type, const std::string &scope) const override;
87 [[nodiscard]] LayerValue<std::size_t>
88 num_metatiles_in_primary(ConfigScopeType type, const std::string &scope) const override;
89 [[nodiscard]] LayerValue<std::size_t>
90 num_metatiles_total(ConfigScopeType type, const std::string &scope) const override;
91 [[nodiscard]] LayerValue<std::size_t>
92 num_palettes_in_primary(ConfigScopeType type, const std::string &scope) const override;
93 [[nodiscard]] LayerValue<std::size_t>
94 num_palettes_total(ConfigScopeType type, const std::string &scope) const override;
95 [[nodiscard]] LayerValue<std::size_t>
96 max_map_data_size(ConfigScopeType type, const std::string &scope) const override;
97 [[nodiscard]] LayerValue<std::size_t>
98 num_tiles_per_metatile(ConfigScopeType type, const std::string &scope) const override;
99 [[nodiscard]] LayerValue<Rgba32>
100 extrinsic_transparency(ConfigScopeType type, const std::string &scope) const override;
101 [[nodiscard]] LayerValue<bool>
102 ignore_triple_layer_content(ConfigScopeType type, const std::string &scope) const override;
103 [[nodiscard]] LayerValue<ArtifactEditMode>
104 tiles_edit_mode(ConfigScopeType type, const std::string &scope) const override;
105 [[nodiscard]] LayerValue<ArtifactEditMode>
106 palettes_edit_mode(ConfigScopeType type, const std::string &scope) const override;
107 [[nodiscard]] LayerValue<bool> palette_hints_enabled(ConfigScopeType type, const std::string &scope) const override;
109 palette_hints(ConfigScopeType type, const std::string &scope) const override;
111 packing_strategy(ConfigScopeType type, const std::string &scope) const override;
113 packing_strategy_params(ConfigScopeType type, const std::string &scope) const override;
115 tile_sharing_packing(ConfigScopeType type, const std::string &scope) const override;
117 tile_sharing_alignment(ConfigScopeType type, const std::string &scope) const override;
118 [[nodiscard]] LayerValue<TilesPaletteMode>
119 tiles_palette_mode(ConfigScopeType type, const std::string &scope) const override;
121 global_anim_palette_resolution_strategy(ConfigScopeType type, const std::string &scope) const override;
123 global_anim_key_frame_resolution_strategy(ConfigScopeType type, const std::string &scope) const override;
126 ConfigScopeType type, const std::string &scope) const override;
127 [[nodiscard]] LayerValue<FrameLinking>
128 global_frame_linking(ConfigScopeType type, const std::string &scope) const override;
129 [[nodiscard]] LayerValue<PerAnimOverrides>
130 per_anim_overrides(ConfigScopeType type, const std::string &scope) const override;
131 [[nodiscard]] LayerValue<bool>
132 cross_tileset_anim_linking(ConfigScopeType type, const std::string &scope) const override;
133 [[nodiscard]] LayerValue<bool> verify_checksums(ConfigScopeType type, const std::string &scope) const override;
135 primary_pairing_mode(ConfigScopeType type, const std::string &scope) const override;
137 primary_pairing_partners(ConfigScopeType type, const std::string &scope) const override;
139 diagnostic_warnings_exclude(ConfigScopeType type, const std::string &scope) const override;
141 diagnostic_warnings_include(ConfigScopeType type, const std::string &scope) const override;
143 diagnostic_remarks_exclude(ConfigScopeType type, const std::string &scope) const override;
145 diagnostic_remarks_include(ConfigScopeType type, const std::string &scope) const override;
146 [[nodiscard]] LayerValue<std::string>
147 tileset_paths_primary_src(ConfigScopeType type, const std::string &scope) const override;
148 [[nodiscard]] LayerValue<std::string>
149 tileset_paths_primary_bin(ConfigScopeType type, const std::string &scope) const override;
150 [[nodiscard]] LayerValue<std::string>
151 tileset_paths_secondary_src(ConfigScopeType type, const std::string &scope) const override;
152 [[nodiscard]] LayerValue<std::string>
153 tileset_paths_secondary_bin(ConfigScopeType type, const std::string &scope) const override;
155 metatile_attribute_size(ConfigScopeType type, const std::string &scope) const override;
157 metatile_attribute_declaration_size(ConfigScopeType type, const std::string &scope) const override;
159 metatile_attribute_fields(ConfigScopeType type, const std::string &scope) const override;
161 metatile_attribute_field_overrides(ConfigScopeType type, const std::string &scope) const override;
163 role_pins(ConfigScopeType type, const std::string &scope) const override;
164 [[nodiscard]] LayerValue<bool>
165 tileset_animations_wire_anim_code(ConfigScopeType type, const std::string &scope) const override;
166
167 private:
168 [[nodiscard]] bool scope_matches(ConfigScopeType type, const std::string &scope) const;
169
170 ConfigScopeType scope_type_;
171 std::string scope_;
172 std::string source_info_;
173
174 std::optional<std::size_t> num_tiles_in_primary_override_;
175 std::optional<std::size_t> num_tiles_total_override_;
176 std::optional<std::size_t> num_metatiles_in_primary_override_;
177 std::optional<std::size_t> num_metatiles_total_override_;
178 std::optional<std::size_t> num_palettes_in_primary_override_;
179 std::optional<std::size_t> num_palettes_total_override_;
180 std::optional<std::size_t> max_map_data_size_override_;
181 std::optional<std::size_t> num_tiles_per_metatile_override_;
182 std::optional<Rgba32> extrinsic_transparency_override_;
183 std::optional<bool> ignore_triple_layer_content_override_;
184 std::optional<ArtifactEditMode> tiles_edit_mode_override_;
185 std::optional<ArtifactEditMode> palettes_edit_mode_override_;
186 std::optional<bool> palette_hints_enabled_override_;
187 std::optional<std::vector<PaletteHint>> palette_hints_override_;
188 std::optional<PackingStrategyType> packing_strategy_override_;
189 std::optional<PackingStrategyParams> packing_strategy_params_override_;
190 std::optional<TileSharingPacking> tile_sharing_packing_override_;
191 std::optional<TileSharingAlignment> tile_sharing_alignment_override_;
192 std::optional<TilesPaletteMode> tiles_palette_mode_override_;
193 std::optional<AnimPaletteResolutionStrategy> global_anim_palette_resolution_strategy_override_;
194 std::optional<AnimKeyFrameResolutionStrategy> global_anim_key_frame_resolution_strategy_override_;
195 std::optional<AnimMultiPaletteSubtileResolutionStrategy>
196 global_anim_multi_palette_subtile_resolution_strategy_override_;
197 std::optional<FrameLinking> global_frame_linking_override_;
198 std::optional<PerAnimOverrides> per_anim_overrides_override_;
199 std::optional<bool> cross_tileset_anim_linking_override_;
200 std::optional<bool> verify_checksums_override_;
201 std::optional<PrimaryPairingMode> primary_pairing_mode_override_;
202 std::optional<std::vector<std::string>> primary_pairing_partners_override_;
203 std::optional<std::vector<std::string>> diagnostic_warnings_exclude_override_;
204 std::optional<std::vector<std::string>> diagnostic_warnings_include_override_;
205 std::optional<std::vector<std::string>> diagnostic_remarks_exclude_override_;
206 std::optional<std::vector<std::string>> diagnostic_remarks_include_override_;
207 std::optional<std::string> tileset_paths_primary_src_override_;
208 std::optional<std::string> tileset_paths_primary_bin_override_;
209 std::optional<std::string> tileset_paths_secondary_src_override_;
210 std::optional<std::string> tileset_paths_secondary_bin_override_;
211 std::optional<std::optional<std::size_t>> metatile_attribute_size_override_;
212 std::optional<std::optional<std::size_t>> metatile_attribute_declaration_size_override_;
213 std::optional<MetatileAttributeFieldDefinitions> metatile_attribute_fields_override_;
214 std::optional<MetatileAttributeFieldOverrides> metatile_attribute_field_overrides_override_;
215 std::optional<RolePinDefinitions> role_pins_override_;
216 std::optional<bool> tileset_animations_wire_anim_code_override_;
217};
218
219} // namespace porytiles
An interface which config implementations can use to load config values.
A ConfigProvider that overrides selected config values for a single scope.
LayerValue< std::string > tileset_paths_secondary_bin(ConfigScopeType type, const std::string &scope) const override
LayerValue< AnimMultiPaletteSubtileResolutionStrategy > global_anim_multi_palette_subtile_resolution_strategy(ConfigScopeType type, const std::string &scope) const override
void set_role_pins(RolePinDefinitions 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
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< RolePinDefinitions > role_pins(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< 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< std::size_t > num_palettes_in_primary(ConfigScopeType type, const std::string &scope) const override
void set_global_anim_palette_resolution_strategy(AnimPaletteResolutionStrategy value)
void set_metatile_attribute_fields(MetatileAttributeFieldDefinitions value)
LayerValue< bool > cross_tileset_anim_linking(ConfigScopeType type, const std::string &scope) const override
void set_palettes_edit_mode(ArtifactEditMode value)
void set_num_palettes_in_primary(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)
void set_primary_pairing_mode(PrimaryPairingMode value)
void set_palette_hints(std::vector< PaletteHint > value)
LayerValue< PackingStrategyType > packing_strategy(ConfigScopeType type, const std::string &scope) const override
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_tiles_palette_mode(TilesPaletteMode value)
void set_diagnostic_warnings_exclude(std::vector< std::string > value)
void set_metatile_attribute_field_overrides(MetatileAttributeFieldOverrides value)
LayerValue< bool > ignore_triple_layer_content(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_tiles_edit_mode(ArtifactEditMode value)
LayerValue< std::optional< std::size_t > > metatile_attribute_declaration_size(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< 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_metatile_attribute_size(std::optional< std::size_t > 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< std::size_t > num_palettes_total(ConfigScopeType type, const std::string &scope) const override
LayerValue< Rgba32 > extrinsic_transparency(ConfigScopeType type, const std::string &scope) const override
LayerValue< TilesPaletteMode > tiles_palette_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
void set_metatile_attribute_declaration_size(std::optional< 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::vector< PaletteHint > > palette_hints(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)
LayerValue< AnimPaletteResolutionStrategy > global_anim_palette_resolution_strategy(ConfigScopeType type, const std::string &scope) const override
void set_tileset_paths_primary_bin(std::string value)
LayerValue< MetatileAttributeFieldOverrides > metatile_attribute_field_overrides(ConfigScopeType type, const std::string &scope) const override
LayerValue< MetatileAttributeFieldDefinitions > metatile_attribute_fields(ConfigScopeType type, const std::string &scope) const override
LayerValue< ArtifactEditMode > palettes_edit_mode(ConfigScopeType type, const std::string &scope) const override
LayerValue< std::string > tileset_paths_primary_bin(ConfigScopeType type, const std::string &scope) const override
LayerValue< std::optional< std::size_t > > metatile_attribute_size(ConfigScopeType type, const std::string &scope) const override
void set_global_anim_multi_palette_subtile_resolution_strategy(AnimMultiPaletteSubtileResolutionStrategy value)
LayerValue< bool > palette_hints_enabled(ConfigScopeType type, const std::string &scope) const override
Represents a 32-bit RGBA color.
Definition rgba32.hpp:21
PrimaryPairingMode
Controls how a secondary tileset finds its partner primary for compilation.
std::map< std::string, MetatileAttributeFieldOverride > MetatileAttributeFieldOverrides
A map from field name to its override; applied at schema load time.
std::vector< RolePinDefinition > RolePinDefinitions
An ordered list of role pin definitions; order is display/declaration order (also CSV column order).
TileSharingAlignment
Controls palette slot alignment strategy for tile sharing deduplication.
std::vector< MetatileAttributeFieldDefinition > MetatileAttributeFieldDefinitions
An ordered list of metatile attribute field definitions; order is display/declaration order.
TilesPaletteMode
Controls how tiles.png is rendered.
ArtifactEditMode
Specifies whether artifacts (tiles or palettes) can be modified during patch compilation.
AnimPaletteResolutionStrategy
Strategy for determining which palette to use when decompiling animation tiles.
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.
AnimMultiPaletteSubtileResolutionStrategy
Strategy for handling animation subtiles referenced with multiple palettes.
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...
Container for per-strategy packing parameters.