yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::zelda3::DrawRoutineRegistry Class Reference

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}
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ DrawRoutineRegistry()

yaze::zelda3::DrawRoutineRegistry::DrawRoutineRegistry ( )
private

Definition at line 20 of file draw_routine_registry.cc.

References BuildRegistry(), and RefreshFeatureFlagMappings().

Here is the call graph for this function:

Member Function Documentation

◆ Get()

◆ Initialize()

void yaze::zelda3::DrawRoutineRegistry::Initialize ( )

Definition at line 25 of file draw_routine_registry.cc.

◆ RefreshFeatureFlagMappings()

◆ CustomObjectsEnabled()

bool yaze::zelda3::DrawRoutineRegistry::CustomObjectsEnabled ( ) const
inline

◆ GetRoutineInfo()

const DrawRoutineInfo * yaze::zelda3::DrawRoutineRegistry::GetRoutineInfo ( int routine_id) const

◆ GetAllRoutines()

const std::vector< DrawRoutineInfo > & yaze::zelda3::DrawRoutineRegistry::GetAllRoutines ( ) const
inline

Definition at line 218 of file draw_routine_registry.h.

References routines_.

◆ RoutineDrawsToBothBGs()

bool yaze::zelda3::DrawRoutineRegistry::RoutineDrawsToBothBGs ( int routine_id) const

◆ GetRoutineDimensions()

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().

Here is the call graph for this function:

◆ GetRoutineIdForObject() [1/2]

◆ GetRoutineIdForObject() [2/2]

int yaze::zelda3::DrawRoutineRegistry::GetRoutineIdForObject ( int16_t object_id,
bool custom_objects_enabled ) const

◆ GetMappedObjectIds()

std::vector< int16_t > yaze::zelda3::DrawRoutineRegistry::GetMappedObjectIds ( ) const

Definition at line 95 of file draw_routine_registry.cc.

References object_to_routine_map_.

◆ BuildRegistry()

◆ BuildObjectMapping()

Member Data Documentation

◆ routines_

std::vector<DrawRoutineInfo> yaze::zelda3::DrawRoutineRegistry::routines_
private

Definition at line 247 of file draw_routine_registry.h.

Referenced by BuildRegistry(), and GetAllRoutines().

◆ routine_map_

std::unordered_map<int, const DrawRoutineInfo*> yaze::zelda3::DrawRoutineRegistry::routine_map_
private

Definition at line 248 of file draw_routine_registry.h.

Referenced by BuildRegistry(), and GetRoutineInfo().

◆ object_to_routine_map_

std::unordered_map<int16_t, int> yaze::zelda3::DrawRoutineRegistry::object_to_routine_map_
private

◆ custom_objects_enabled_

std::atomic<bool> yaze::zelda3::DrawRoutineRegistry::custom_objects_enabled_ {false}
private

Definition at line 250 of file draw_routine_registry.h.

Referenced by CustomObjectsEnabled(), and RefreshFeatureFlagMappings().


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