Porytiles
Loading...
Searching...
No Matches
porytiles::PrimaryTilesetImporter Class Referenceabstract

Domain service interface for importing vanilla (non-Porytiles-managed) tilesets into a PorymapTilesetComponent. More...

#include <primary_tileset_importer.hpp>

Inheritance diagram for porytiles::PrimaryTilesetImporter:
[legend]

Public Member Functions

virtual ~PrimaryTilesetImporter ()=default
 
virtual ChainableResult< std::unique_ptr< PorymapTilesetComponent > > import_porymap_component_from_vanilla (const std::string &tileset_name) const =0
 Imports vanilla Porymap assets for the given tileset into a PorymapTilesetComponent.
 

Detailed Description

Domain service interface for importing vanilla (non-Porytiles-managed) tilesets into a PorymapTilesetComponent.

Definition at line 22 of file primary_tileset_importer.hpp.

Constructor & Destructor Documentation

◆ ~PrimaryTilesetImporter()

virtual porytiles::PrimaryTilesetImporter::~PrimaryTilesetImporter ( )
virtualdefault

Member Function Documentation

◆ import_porymap_component_from_vanilla()

virtual ChainableResult< std::unique_ptr< PorymapTilesetComponent > > porytiles::PrimaryTilesetImporter::import_porymap_component_from_vanilla ( const std::string &  tileset_name) const
pure virtual

Imports vanilla Porymap assets for the given tileset into a PorymapTilesetComponent.

This is the Template Method hook that infra-layer implementations override to provide backing-store-specific asset loading. The method reads existing Porymap tileset artifacts from a "vanilla" tileset that is not yet managed by Porytiles (the "first-time import" case).

For vanilla tilesets, asset locations are scattered (determined by INCBIN declarations in C headers). This method handles that "discovery chaos" by parsing the relevant C files to find actual file paths.

The returned PorymapTilesetComponent should contain:

  • tile data (the indexed-color tileset image, tiles.png)
  • palette data (00.pal through 15.pal)
  • raw metatile TilemapEntry (metatiles.bin)
  • metatile behavior/terrain attributes (metatile_attributes.bin)
  • animations (anim/ folder contents)
Parameters
tileset_nameThe name of the tileset to import (e.g., "gTileset_General")
Precondition
Tileset entry must exist in src/data/tilesets/headers.h
Animation arrays in tileset_anims.c must follow gTilesetAnims_{TilesetName}_{AnimName} naming convention
Returns
A ChainableResult containing a unique_ptr to the populated PorymapTilesetComponent on success
Postcondition
The returned component has tiles_png, pals, metatile_entries, and metatile_attributes populated
Animation frames are populated as Animation<IndexPixel> (key frames NOT extracted by this method)
See also
ProjectPrimaryTilesetImporter for the pokeemerald project-based implementation
ProjectVanillaAnimImporter for animation import details

Implemented in porytiles::ProjectPrimaryTilesetImporter.


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