Porytiles
Loading...
Searching...
No Matches
porytiles::MetatilesHeaderProvider Class Referencefinal

A ConfigProvider that auto-detects metatile attribute size from metatiles.h declarations. More...

#include <metatiles_header_provider.hpp>

Inheritance diagram for porytiles::MetatilesHeaderProvider:
[legend]
Collaboration diagram for porytiles::MetatilesHeaderProvider:
[legend]

Public Member Functions

 MetatilesHeaderProvider (std::filesystem::path project_root, gsl::not_null< const TextFormatter * > format)
 Constructs a MetatilesHeaderProvider.
 
std::string name () const override
 Gets the name of this ConfigProvider, useful for diagnostic purposes.
 
LayerValue< std::size_t > metatile_attr_size (ConfigScopeType type, const std::string &scope) const override
 
- Public Member Functions inherited from porytiles::ConfigProvider
virtual ~ConfigProvider ()=default
 
virtual LayerValue< std::size_t > num_tiles_in_primary (ConfigScopeType type, const std::string &scope) const
 
virtual LayerValue< std::size_t > num_tiles_total (ConfigScopeType type, const std::string &scope) const
 
virtual LayerValue< std::size_t > num_metatiles_in_primary (ConfigScopeType type, const std::string &scope) const
 
virtual LayerValue< std::size_t > num_metatiles_total (ConfigScopeType type, const std::string &scope) const
 
virtual LayerValue< std::size_t > num_pals_in_primary (ConfigScopeType type, const std::string &scope) const
 
virtual LayerValue< std::size_t > num_pals_total (ConfigScopeType type, const std::string &scope) const
 
virtual LayerValue< std::size_t > max_map_data_size (ConfigScopeType type, const std::string &scope) const
 
virtual LayerValue< std::size_t > num_tiles_per_metatile (ConfigScopeType type, const std::string &scope) const
 
virtual LayerValue< Rgba32extrinsic_transparency (ConfigScopeType type, const std::string &scope) const
 
virtual LayerValue< ArtifactEditModetiles_edit_mode (ConfigScopeType type, const std::string &scope) const
 
virtual LayerValue< ArtifactEditModepals_edit_mode (ConfigScopeType type, const std::string &scope) const
 
virtual LayerValue< bool > pal_hints_enabled (ConfigScopeType type, const std::string &scope) const
 
virtual LayerValue< std::vector< PaletteHint > > pal_hints (ConfigScopeType type, const std::string &scope) const
 
virtual LayerValue< PackingStrategyTypepacking_strategy (ConfigScopeType type, const std::string &scope) const
 
virtual LayerValue< PackingStrategyParamspacking_strategy_params (ConfigScopeType type, const std::string &scope) const
 
virtual LayerValue< TileSharingPackingtile_sharing_packing (ConfigScopeType type, const std::string &scope) const
 
virtual LayerValue< TileSharingAlignmenttile_sharing_alignment (ConfigScopeType type, const std::string &scope) const
 
virtual LayerValue< TilesPalModetiles_pal_mode (ConfigScopeType type, const std::string &scope) const
 
virtual LayerValue< AnimPalResolutionStrategyglobal_anim_pal_resolution_strategy (ConfigScopeType type, const std::string &scope) const
 
virtual LayerValue< AnimKeyFrameResolutionStrategyglobal_anim_key_frame_resolution_strategy (ConfigScopeType type, const std::string &scope) const
 
virtual LayerValue< AnimMultiPalSubtileResolutionStrategyglobal_anim_multi_pal_subtile_resolution_strategy (ConfigScopeType type, const std::string &scope) const
 
virtual LayerValue< FrameLinkingglobal_frame_linking (ConfigScopeType type, const std::string &scope) const
 
virtual LayerValue< PerAnimOverridesper_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< PrimaryPairingModeprimary_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< bool > tileset_animations_wire_anim_code (ConfigScopeType type, const std::string &scope) const
 

Detailed Description

A ConfigProvider that auto-detects metatile attribute size from metatiles.h declarations.

MetatilesHeaderProvider scans src/data/tilesets/metatiles.h for gMetatileAttributes_ declaration lines and infers the attribute byte size from the C type used:

  • All const u16 -> 2 bytes (pokeemerald / pokeruby)
  • All const u32 -> 4 bytes (pokefirered)
  • Mixed types -> invalid (error)
  • No matching lines or missing file -> not_provided (fall through to next provider)

The file is read lazily on first access and the result is cached.

Definition at line 29 of file metatiles_header_provider.hpp.

Constructor & Destructor Documentation

◆ MetatilesHeaderProvider()

porytiles::MetatilesHeaderProvider::MetatilesHeaderProvider ( std::filesystem::path  project_root,
gsl::not_null< const TextFormatter * >  format 
)
inlineexplicit

Constructs a MetatilesHeaderProvider.

Parameters
project_rootThe root directory of the decomp project
formatA pointer to the TextFormatter to use for error messages

Definition at line 37 of file metatiles_header_provider.hpp.

Member Function Documentation

◆ metatile_attr_size()

LayerValue< std::size_t > porytiles::MetatilesHeaderProvider::metatile_attr_size ( ConfigScopeType  type,
const std::string &  scope 
) const
overridevirtual

Reimplemented from porytiles::ConfigProvider.

Definition at line 81 of file metatiles_header_provider.cpp.

◆ name()

std::string porytiles::MetatilesHeaderProvider::name ( ) const
overridevirtual

Gets the name of this ConfigProvider, useful for diagnostic purposes.

Returns
The name of this ConfigProvider

Implements porytiles::ConfigProvider.

Definition at line 75 of file metatiles_header_provider.cpp.


The documentation for this class was generated from the following files: