Unified draw routine registry. More...
#include <draw_routine_registry.h>
Public Member Functions | |
| void | Initialize () |
| void | RefreshFeatureFlagMappings () |
| bool | CustomObjectsEnabled () const |
| const DrawRoutineInfo * | GetRoutineInfo (int routine_id) const |
| const std::vector< DrawRoutineInfo > & | GetAllRoutines () const |
| bool | RoutineDrawsToBothBGs (int routine_id) const |
| bool | GetRoutineDimensions (int routine_id, int *base_width, int *base_height) const |
| int | GetRoutineIdForObject (int16_t object_id) const |
| int | GetRoutineIdForObject (int16_t object_id, bool custom_objects_enabled) const |
| std::vector< int16_t > | GetMappedObjectIds () const |
Static Public Member Functions | |
| static DrawRoutineRegistry & | Get () |
Private Member Functions | |
| DrawRoutineRegistry () | |
| void | BuildRegistry () |
| void | BuildObjectMapping () |
Private Attributes | |
| std::vector< DrawRoutineInfo > | routines_ |
| std::unordered_map< int, const DrawRoutineInfo * > | routine_map_ |
| std::unordered_map< int16_t, int > | object_to_routine_map_ |
| std::atomic< bool > | custom_objects_enabled_ {false} |
Unified draw routine registry.
Singleton that provides draw routine metadata for both ObjectDrawer and ObjectGeometry. This ensures both systems use the same routine IDs and dimension calculations.
Definition at line 197 of file draw_routine_registry.h.
|
private |
Definition at line 20 of file draw_routine_registry.cc.
References BuildRegistry(), and RefreshFeatureFlagMappings().

|
static |
Definition at line 15 of file draw_routine_registry.cc.
Referenced by yaze::editor::EditorManager::ApplyCurrentProjectRuntimeContext(), yaze::cli::resources::CommandContext::ApplyProjectRuntimeContext(), yaze::zelda3::ObjectGeometry::BuildRegistry(), yaze::zelda3::draw_routines::CustomDraw(), yaze::editor::ObjectCoveragePanel::DrawDetails(), yaze::zelda3::ObjectDrawer::DrawObject(), yaze::zelda3::ObjectDrawer::DrawUsingRegistryRoutine(), yaze::zelda3::ObjectDrawer::GetDrawRoutineId(), yaze::editor::DungeonEditorV2::GetDungeonRenderContextCensus(), yaze::zelda3::ObjectParser::GetObjectDrawInfo(), yaze::zelda3::GetObjectLayerSemantics(), yaze::zelda3::GetSymbologyForObject(), yaze::editor::EditorManager::HandleSessionSwitched(), yaze::editor::anonymous_namespace{dungeon_canvas_connected_view.cc}::IsHeaderBackedInterroomStaircaseObject(), yaze::editor::EditorManager::LoadProjectWithRom(), yaze::zelda3::ObjectGeometry::MeasureByObjectId(), yaze::zelda3::ObjectGeometry::MeasureByObjectIdForState(), yaze::editor::ObjectCoveragePanel::RebuildIndex(), yaze::zelda3::ObjectGeometry::ResolveAnchor(), yaze::cli::resources::CommandContext::RestoreProjectRuntimeContext(), yaze::zelda3::RoomObjectSizeAxisStep(), yaze::zelda3::ObjectDrawer::RoutineDrawsToBothBGs(), yaze::editor::RoomMatrixCensusOverlay::StartComputation(), and yaze::editor::DungeonEditorV2::SynchronizeCustomObjectAssets().
| void yaze::zelda3::DrawRoutineRegistry::Initialize | ( | ) |
Definition at line 25 of file draw_routine_registry.cc.
| void yaze::zelda3::DrawRoutineRegistry::RefreshFeatureFlagMappings | ( | ) |
Definition at line 27 of file draw_routine_registry.cc.
References custom_objects_enabled_, and yaze::core::FeatureFlags::get().
Referenced by yaze::editor::EditorManager::ApplyCurrentProjectRuntimeContext(), yaze::cli::resources::CommandContext::ApplyProjectRuntimeContext(), DrawRoutineRegistry(), yaze::editor::EditorManager::HandleSessionSwitched(), yaze::editor::EditorManager::LoadProjectWithRom(), yaze::cli::resources::CommandContext::RestoreProjectRuntimeContext(), and yaze::editor::DungeonEditorV2::SynchronizeCustomObjectAssets().

|
inline |
Definition at line 210 of file draw_routine_registry.h.
References custom_objects_enabled_.
Referenced by yaze::zelda3::draw_routines::CustomDraw(), and GetRoutineIdForObject().
| const DrawRoutineInfo * yaze::zelda3::DrawRoutineRegistry::GetRoutineInfo | ( | int | routine_id | ) | const |
Definition at line 51 of file draw_routine_registry.cc.
References routine_map_.
Referenced by yaze::zelda3::ObjectDrawer::DrawObject(), yaze::zelda3::ObjectDrawer::DrawUsingRegistryRoutine(), GetRoutineDimensions(), and RoutineDrawsToBothBGs().
|
inline |
Definition at line 218 of file draw_routine_registry.h.
References routines_.
| bool yaze::zelda3::DrawRoutineRegistry::RoutineDrawsToBothBGs | ( | int | routine_id | ) | const |
Definition at line 60 of file draw_routine_registry.cc.
References yaze::zelda3::DrawRoutineInfo::draws_to_both_bgs, and GetRoutineInfo().
Referenced by yaze::zelda3::GetObjectLayerSemantics(), and yaze::zelda3::ObjectDrawer::RoutineDrawsToBothBGs().

| bool yaze::zelda3::DrawRoutineRegistry::GetRoutineDimensions | ( | int | routine_id, |
| int * | base_width, | ||
| int * | base_height ) const |
Definition at line 65 of file draw_routine_registry.cc.
References yaze::zelda3::DrawRoutineInfo::base_height, yaze::zelda3::DrawRoutineInfo::base_width, and GetRoutineInfo().

| int yaze::zelda3::DrawRoutineRegistry::GetRoutineIdForObject | ( | int16_t | object_id | ) | const |
Definition at line 78 of file draw_routine_registry.cc.
References CustomObjectsEnabled(), and GetRoutineIdForObject().
Referenced by yaze::zelda3::GetObjectLayerSemantics(), GetRoutineIdForObject(), yaze::zelda3::GetSymbologyForObject(), yaze::editor::anonymous_namespace{dungeon_canvas_connected_view.cc}::IsHeaderBackedInterroomStaircaseObject(), yaze::zelda3::ObjectGeometry::MeasureByObjectId(), yaze::zelda3::ObjectGeometry::MeasureByObjectIdForState(), and yaze::zelda3::ObjectGeometry::ResolveAnchor().

| int yaze::zelda3::DrawRoutineRegistry::GetRoutineIdForObject | ( | int16_t | object_id, |
| bool | custom_objects_enabled ) const |
Definition at line 82 of file draw_routine_registry.cc.
References yaze::zelda3::DrawRoutineIds::kCustomObject, yaze::zelda3::DrawRoutineIds::kNothing, and object_to_routine_map_.
| std::vector< int16_t > yaze::zelda3::DrawRoutineRegistry::GetMappedObjectIds | ( | ) | const |
Definition at line 95 of file draw_routine_registry.cc.
References object_to_routine_map_.
|
private |
Definition at line 32 of file draw_routine_registry.cc.
References BuildObjectMapping(), yaze::zelda3::draw_routines::RegisterCornerRoutines(), yaze::zelda3::draw_routines::RegisterDiagonalRoutines(), yaze::zelda3::draw_routines::RegisterDownwardsRoutines(), yaze::zelda3::draw_routines::RegisterRightwardsRoutines(), yaze::zelda3::draw_routines::RegisterSpecialRoutines(), routine_map_, and routines_.
Referenced by DrawRoutineRegistry().
|
private |
Definition at line 105 of file draw_routine_registry.cc.
References yaze::zelda3::DrawRoutineIds::kActual4x4, yaze::zelda3::DrawRoutineIds::kAgahnimsAltar, yaze::zelda3::DrawRoutineIds::kBigGrayRock, yaze::zelda3::DrawRoutineIds::kBigWallDecor, yaze::zelda3::DrawRoutineIds::kDamFloodGate, yaze::zelda3::DrawRoutineIds::kDownwardsEdge1x1_1to16plus7, yaze::zelda3::DrawRoutineIds::kDownwardsHasEdge1x1_1to16_plus23, yaze::zelda3::DrawRoutineIds::kFloorLight, yaze::zelda3::DrawRoutineIds::kFortuneTellerRoom, yaze::zelda3::DrawRoutineIds::kMagicBatAltar, yaze::zelda3::DrawRoutineIds::kNothing, yaze::zelda3::DrawRoutineIds::kRightwardsHasEdge1x1_1to16_plus23, yaze::zelda3::DrawRoutineIds::kSanctuaryWall, yaze::zelda3::DrawRoutineIds::kSingle2x2, yaze::zelda3::DrawRoutineIds::kSingle4x3, yaze::zelda3::DrawRoutineIds::kSingle4x4, yaze::zelda3::DrawRoutineIds::kSmithyFurnace, yaze::zelda3::DrawRoutineIds::kTableBowl, yaze::zelda3::DrawRoutineIds::kVitreousGooDamage, yaze::zelda3::DrawRoutineIds::kWaterHopStairsA, yaze::zelda3::DrawRoutineIds::kWaterHopStairsB, yaze::zelda3::DrawRoutineIds::kWeird2x4_1to16, and object_to_routine_map_.
Referenced by BuildRegistry().
|
private |
Definition at line 247 of file draw_routine_registry.h.
Referenced by BuildRegistry(), and GetAllRoutines().
|
private |
Definition at line 248 of file draw_routine_registry.h.
Referenced by BuildRegistry(), and GetRoutineInfo().
|
private |
Definition at line 249 of file draw_routine_registry.h.
Referenced by BuildObjectMapping(), GetMappedObjectIds(), and GetRoutineIdForObject().
|
private |
Definition at line 250 of file draw_routine_registry.h.
Referenced by CustomObjectsEnabled(), and RefreshFeatureFlagMappings().