Porytiles
Loading...
Searching...
No Matches
porytiles::ProjectVanillaAnimImporter Class Reference

Imports vanilla animation metadata and frame data as IndexPixel tiles. More...

#include <project_vanilla_anim_importer.hpp>

Public Member Functions

 ProjectVanillaAnimImporter (std::filesystem::path project_root, gsl::not_null< const TextFormatter * > format, gsl::not_null< const UserDiagnostics * > diag)
 Constructs a ProjectVanillaAnimImporter.
 
ChainableResult< std::map< std::string, Animation< IndexPixel > > > import_animations (const std::string &tileset_name) const
 Import animations from a vanilla tileset.
 

Detailed Description

Imports vanilla animation metadata and frame data as IndexPixel tiles.

ProjectVanillaAnimImporter reads animation configuration and frame PNG files from a vanilla pokeemerald project.

Workflow:

  1. Gets tileset metadata (callback function name) from headers.h
  2. Parses tileset_anims.c with AnimCodeParser to get AnimParams
  3. Parses INCBIN declarations to find PNG frame file paths
  4. Loads frame PNG files and extracts IndexPixel tiles

This importer does NOT extract key frames from tiles.png - that responsibility belongs to AnimDecompiler, which needs to understand VRAM layout and palette assignment.

Note
Returned animations will have has_key_frame() == false

Definition at line 34 of file project_vanilla_anim_importer.hpp.

Constructor & Destructor Documentation

◆ ProjectVanillaAnimImporter()

porytiles::ProjectVanillaAnimImporter::ProjectVanillaAnimImporter ( std::filesystem::path  project_root,
gsl::not_null< const TextFormatter * >  format,
gsl::not_null< const UserDiagnostics * >  diag 
)
inline

Constructs a ProjectVanillaAnimImporter.

Parameters
project_rootThe path to the pokeemerald project root directory
formatFormatter for error message styling (non-owning, must outlive importer)
diagUserDiagnostics for warnings and info messages (non-owning, must outlive importer)

Definition at line 43 of file project_vanilla_anim_importer.hpp.

Member Function Documentation

◆ import_animations()

ChainableResult< std::map< std::string, Animation< IndexPixel > > > porytiles::ProjectVanillaAnimImporter::import_animations ( const std::string &  tileset_name) const

Import animations from a vanilla tileset.

Parses tileset_anims.c to discover animation names, parameters, and frame paths. Loads frame PNG files and extracts IndexPixel tiles for each frame. Does not set key_frame.

Parameters
tileset_nameThe name of the tileset (e.g., "gTileset_General")
Precondition
Tileset must exist and have animations defined in tileset_anims.c
Returns
Map of animation names (snake_case) to Animation<IndexPixel> objects, or error
Postcondition
Each returned Animation has has_key_frame() == false
Each returned Animation has frames populated with IndexPixel tile data

Definition at line 38 of file project_vanilla_anim_importer.cpp.


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