|
Porytiles
|
Detects the base game of a decompilation project. More...
#include <base_game_detector.hpp>
Public Member Functions | |
| BaseGameDetector (std::filesystem::path project_root, gsl::not_null< const TextFormatter * > format, gsl::not_null< const UserDiagnostics * > diag) | |
| ChainableResult< BaseGame > | detect () const |
| Detects the base game for the project. | |
Detects the base game of a decompilation project.
Inspects the project's include/global.fieldmap.h header to determine which of the four supported base games the project targets: pokeemerald, pokefirered, pokeruby, or pokeemerald-expansion. Detection is based on content heuristics within the header file:
METATILE_ATTRIBUTE_BEHAVIOR (enum-based) -> pokefireredMETATILE_ATTR_BEHAVIOR_MASK + MAPGRID_METATILE_ID_SHIFT + swapPalettes -> pokeemerald-expansionMETATILE_ATTR_BEHAVIOR_MASK + MAPGRID_METATILE_ID_SHIFT -> pokeemeraldMETATILE_ATTR_BEHAVIOR_MASK only -> pokerubyEmits a diagnostic remark with tag "base-game-detection" on successful detection.
Definition at line 29 of file base_game_detector.hpp.
|
inline |
Definition at line 31 of file base_game_detector.hpp.
| ChainableResult< BaseGame > porytiles::BaseGameDetector::detect | ( | ) | const |
Detects the base game for the project.
Reads include/global.fieldmap.h and scans for content markers that uniquely identify each supported base game. Returns an error if the file is missing, unreadable, or contains no recognized markers.
Definition at line 9 of file base_game_detector.cpp.