|
Porytiles
|
Modifies tileset_anims.c to include Porytiles-managed animation code headers. More...
#include <project_tileset_anims_modifier.hpp>
Public Member Functions | |
| ProjectTilesetAnimsModifier (std::filesystem::path project_root, gsl::not_null< const InfraConfig * > config, gsl::not_null< const UserDiagnostics * > diagnostics) | |
| Constructs a TilesetAnimsModifier with required dependencies. | |
| ChainableResult< void > | wire_include_for_tileset (const std::string &tileset_name, bool is_secondary) const |
| Adds an #include directive for the tileset's generated animation code. | |
| ChainableResult< void > | remove_include_for_tileset (const std::string &tileset_name, bool is_secondary) const |
| Removes the #include directive for the tileset's generated animation code. | |
Modifies tileset_anims.c to include Porytiles-managed animation code headers.
This service adds and removes #include directives in pokeemerald's src/tileset_anims.c that point to Porytiles-generated animation code headers. The include directive follows the pattern:
// [Porytiles] Auto-generated include. Do not remove.
#include "porytiles_generated/tilesets/{tileset_dir}/generated_anim_code.h"
Note: The "include/" prefix is omitted from the directive because pokeemerald's makefile already adds "include" to the include path. The actual file lives at include/porytiles_generated/tilesets/{tileset_dir}/...
All tilesets (primary and secondary) use the same base path. The tileset_dir is the snake_case version of the tileset shorthand (e.g., "general" for gTileset_General, "battle_frontier" for gTileset_BattleFrontier).
The service appends includes at the bottom of the file with a comment indicating they were auto-generated by Porytiles.
Definition at line 36 of file project_tileset_anims_modifier.hpp.
| porytiles::ProjectTilesetAnimsModifier::ProjectTilesetAnimsModifier | ( | std::filesystem::path | project_root, |
| gsl::not_null< const InfraConfig * > | config, | ||
| gsl::not_null< const UserDiagnostics * > | diagnostics | ||
| ) |
Constructs a TilesetAnimsModifier with required dependencies.
| project_root | Path to the pokeemerald project root directory |
| config | Configuration interface for tileset paths (non-owning, must outlive this object) |
| diagnostics | Diagnostics interface for warnings/notes (non-owning, must outlive this object) |
Definition at line 213 of file project_tileset_anims_modifier.cpp.
| ChainableResult< void > porytiles::ProjectTilesetAnimsModifier::remove_include_for_tileset | ( | const std::string & | tileset_name, |
| bool | is_secondary | ||
| ) | const |
Removes the #include directive for the tileset's generated animation code.
Removes the include directive for the specified tileset from tileset_anims.c. Used during restore operations to return the file to its original state.
The operation is idempotent: if the include doesn't exist, a warning is emitted and no changes are made.
| tileset_name | The tileset name (e.g., "gTileset_General") |
| is_secondary | True for secondary tilesets, false for primary |
Definition at line 317 of file project_tileset_anims_modifier.cpp.
| ChainableResult< void > porytiles::ProjectTilesetAnimsModifier::wire_include_for_tileset | ( | const std::string & | tileset_name, |
| bool | is_secondary | ||
| ) | const |
Adds an #include directive for the tileset's generated animation code.
Appends an include directive at the bottom of tileset_anims.c, pointing to the generated animation code header at:
porytiles_generated/tilesets/{snake_case_dir}/generated_anim_code.h
The include is preceded by a comment indicating it was auto-generated by Porytiles.
The operation is idempotent: if the include already exists, a warning is emitted and no changes are made.
| tileset_name | The tileset name (e.g., "gTileset_General") |
| is_secondary | True for secondary tilesets, false for primary (currently unused but kept for API symmetry) |
Definition at line 222 of file project_tileset_anims_modifier.cpp.