|
Porytiles
|
A ConfigProvider implementation that reads configuration values from #define directives in a header file. More...
#include <header_define_provider.hpp>
Public Member Functions | |
| HeaderDefineProvider (std::filesystem::path project_root, std::filesystem::path header_relative_path, gsl::not_null< const TextFormatter * > format) | |
| Constructs a HeaderDefineProvider that reads #define values from a header file. | |
| HeaderDefineProvider (std::filesystem::path project_root, std::filesystem::path header_relative_path) | |
| Constructs a HeaderDefineProvider with a default PlainTextFormatter. | |
| std::string | name () const override |
| Gets the name of this config layer. | |
| LayerValue< std::size_t > | num_tiles_in_primary (ConfigScopeType type, const std::string &scope) const override |
| LayerValue< std::size_t > | num_tiles_total (ConfigScopeType type, const std::string &scope) const override |
| LayerValue< std::size_t > | num_metatiles_in_primary (ConfigScopeType type, const std::string &scope) const override |
| LayerValue< std::size_t > | num_metatiles_total (ConfigScopeType type, const std::string &scope) const override |
| LayerValue< std::size_t > | num_palettes_in_primary (ConfigScopeType type, const std::string &scope) const override |
| LayerValue< std::size_t > | num_palettes_total (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::size_t > | num_tiles_per_metatile (ConfigScopeType type, const std::string &scope) const override |
Public Member Functions inherited from porytiles::ConfigProvider | |
| virtual | ~ConfigProvider ()=default |
| virtual LayerValue< Rgba32 > | extrinsic_transparency (ConfigScopeType type, const std::string &scope) const |
| virtual LayerValue< bool > | ignore_triple_layer_content (ConfigScopeType type, const std::string &scope) const |
| virtual LayerValue< ArtifactEditMode > | tiles_edit_mode (ConfigScopeType type, const std::string &scope) const |
| virtual LayerValue< ArtifactEditMode > | palettes_edit_mode (ConfigScopeType type, const std::string &scope) const |
| virtual LayerValue< bool > | palette_hints_enabled (ConfigScopeType type, const std::string &scope) const |
| virtual LayerValue< std::vector< PaletteHint > > | palette_hints (ConfigScopeType type, const std::string &scope) const |
| virtual LayerValue< PackingStrategyType > | packing_strategy (ConfigScopeType type, const std::string &scope) const |
| virtual LayerValue< PackingStrategyParams > | packing_strategy_params (ConfigScopeType type, const std::string &scope) const |
| virtual LayerValue< TileSharingPacking > | tile_sharing_packing (ConfigScopeType type, const std::string &scope) const |
| virtual LayerValue< TileSharingAlignment > | tile_sharing_alignment (ConfigScopeType type, const std::string &scope) const |
| virtual LayerValue< TilesPaletteMode > | tiles_palette_mode (ConfigScopeType type, const std::string &scope) const |
| virtual LayerValue< AnimPaletteResolutionStrategy > | global_anim_palette_resolution_strategy (ConfigScopeType type, const std::string &scope) const |
| virtual LayerValue< AnimKeyFrameResolutionStrategy > | global_anim_key_frame_resolution_strategy (ConfigScopeType type, const std::string &scope) const |
| virtual LayerValue< AnimMultiPaletteSubtileResolutionStrategy > | global_anim_multi_palette_subtile_resolution_strategy (ConfigScopeType type, const std::string &scope) const |
| virtual LayerValue< FrameLinking > | global_frame_linking (ConfigScopeType type, const std::string &scope) const |
| virtual LayerValue< PerAnimOverrides > | per_anim_overrides (ConfigScopeType type, const std::string &scope) const |
| virtual LayerValue< bool > | cross_tileset_anim_linking (ConfigScopeType type, const std::string &scope) const |
| virtual LayerValue< bool > | verify_checksums (ConfigScopeType type, const std::string &scope) const |
| virtual LayerValue< PrimaryPairingMode > | primary_pairing_mode (ConfigScopeType type, const std::string &scope) const |
| virtual LayerValue< std::vector< std::string > > | primary_pairing_partners (ConfigScopeType type, const std::string &scope) const |
| virtual LayerValue< std::vector< std::string > > | diagnostic_warnings_exclude (ConfigScopeType type, const std::string &scope) const |
| virtual LayerValue< std::vector< std::string > > | diagnostic_warnings_include (ConfigScopeType type, const std::string &scope) const |
| virtual LayerValue< std::vector< std::string > > | diagnostic_remarks_exclude (ConfigScopeType type, const std::string &scope) const |
| virtual LayerValue< std::vector< std::string > > | diagnostic_remarks_include (ConfigScopeType type, const std::string &scope) const |
| virtual LayerValue< std::string > | tileset_paths_primary_src (ConfigScopeType type, const std::string &scope) const |
| virtual LayerValue< std::string > | tileset_paths_primary_bin (ConfigScopeType type, const std::string &scope) const |
| virtual LayerValue< std::string > | tileset_paths_secondary_src (ConfigScopeType type, const std::string &scope) const |
| virtual LayerValue< std::string > | tileset_paths_secondary_bin (ConfigScopeType type, const std::string &scope) const |
| virtual LayerValue< std::optional< std::size_t > > | metatile_attribute_size (ConfigScopeType type, const std::string &scope) const |
| virtual LayerValue< std::optional< std::size_t > > | metatile_attribute_declaration_size (ConfigScopeType type, const std::string &scope) const |
| virtual LayerValue< MetatileAttributeFieldDefinitions > | metatile_attribute_fields (ConfigScopeType type, const std::string &scope) const |
| virtual LayerValue< MetatileAttributeFieldOverrides > | metatile_attribute_field_overrides (ConfigScopeType type, const std::string &scope) const |
| virtual LayerValue< RolePinDefinitions > | role_pins (ConfigScopeType type, const std::string &scope) const |
| virtual LayerValue< bool > | tileset_animations_wire_anim_code (ConfigScopeType type, const std::string &scope) const |
A ConfigProvider implementation that reads configuration values from #define directives in a header file.
HeaderDefineProvider parses a C/C++ header file looking for #define directives that correspond to configuration values. This is useful for reading configuration from decompilation project headers like include/fieldmap.h.
The provider uses a full C parser that supports:
#define NUM_TILES 512#define FLAGS 0xFF#define SIZE (1 << 10)#define TOTAL (PRIMARY + SECONDARY)The header file is loaded lazily and cached for performance. If the file doesn't exist or a define is not found, methods return LayerValue::not_provided(), allowing graceful fallback to other providers. Config values with no associated header define are not overridden here at all; they defer via the ConfigProvider base class default.
Definition at line 37 of file header_define_provider.hpp.
|
inlineexplicit |
Constructs a HeaderDefineProvider that reads #define values from a header file.
This constructor sets up the provider to read configuration values from #define directives in the specified header file. The header file is loaded lazily when first accessed and cached for subsequent lookups.
| header_relative_path | The path to the header file relative to project_root |
| format | A pointer to the TextFormatter to use |
| project_root | The root directory of the project |
Definition at line 48 of file header_define_provider.hpp.
|
inlineexplicit |
Constructs a HeaderDefineProvider with a default PlainTextFormatter.
This constructor creates an internally owned PlainTextFormatter instance and uses it for formatting. The HeaderDefineProvider will read configuration values from #define directives in the specified header file. The header file is loaded lazily when first accessed and cached for subsequent lookups.
| project_root | The root directory of the project |
| header_relative_path | The path to the header file relative to project_root |
Definition at line 67 of file header_define_provider.hpp.
|
overridevirtual |
Reimplemented from porytiles::ConfigProvider.
Definition at line 94 of file header_define_provider.cpp.
|
overridevirtual |
Gets the name of this config layer.
Implements porytiles::ConfigProvider.
Definition at line 16 of file header_define_provider.cpp.
|
overridevirtual |
Reimplemented from porytiles::ConfigProvider.
Definition at line 44 of file header_define_provider.cpp.
|
overridevirtual |
Reimplemented from porytiles::ConfigProvider.
Definition at line 58 of file header_define_provider.cpp.
|
overridevirtual |
Reimplemented from porytiles::ConfigProvider.
Definition at line 72 of file header_define_provider.cpp.
|
overridevirtual |
Reimplemented from porytiles::ConfigProvider.
Definition at line 86 of file header_define_provider.cpp.
|
overridevirtual |
Reimplemented from porytiles::ConfigProvider.
Definition at line 22 of file header_define_provider.cpp.
|
overridevirtual |
Reimplemented from porytiles::ConfigProvider.
Definition at line 108 of file header_define_provider.cpp.
|
overridevirtual |
Reimplemented from porytiles::ConfigProvider.
Definition at line 36 of file header_define_provider.cpp.