NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
f_manager.hpp
1#pragma once
3#include <dol/framework/f_list_mg_ptmf.hpp>
4#include <dol/framework/f_list_mg.hpp>
5#include <dol/framework/f_list_nd.hpp>
6#include <dol/framework/f_list_nd_prio.hpp>
7#include <dol/framework/f_tree_mg_ptmf.hpp>
8#include <dol/framework/f_tree_nd.hpp>
10
11#define GET_PROC_FLAG(proc) (1 << (proc - 1))
12
13class fBase_c;
14
69private:
70
73 NONE, CONNECT, CREATE, EXECUTE, DELETE, DRAW
74 };
75
78 PROC_FLAG_NONE = 0,
79 PROC_FLAG_CONNECT = GET_PROC_FLAG(CONNECT),
80 PROC_FLAG_CREATE = GET_PROC_FLAG(CREATE),
81 PROC_FLAG_EXECUTE = GET_PROC_FLAG(EXECUTE),
82 PROC_FLAG_DELETE = GET_PROC_FLAG(DELETE),
83 PROC_FLAG_DRAW = GET_PROC_FLAG(DRAW)
84 };
85
89 mConnectNode(owner),
90 mMainNode(owner),
91 mDrawNode(owner),
92 mSearchNode(owner) {}
93
96
97public:
101 static void mainLoop();
102
105 static fBase_c *searchBaseByID(fBaseID_e id);
106
109 static fBase_c *searchBaseByProfName(ProfileName profID, const fBase_c *parent);
110
113 static fBase_c *searchBaseByGroupType(unsigned char groupType, const fBase_c *parent);
114
115private:
117
123
129
134
137 static u32 m_StopProcInf;
138
143
144 friend class fBase_c;
145};
The base class for all scenes, actors and various other processes.
Definition f_base.hpp:117
A base list, made of fLiNdBa_c nodes.
Definition f_list_mg.hpp:13
A base list made of fLiNdPrio_c nodes, with a reference to a process function.
A base list node.
Definition f_list_nd.hpp:11
A base list node, with priority fields for reordering.
Manages the execution of base operations.
Definition f_manager.hpp:68
static fLiMgPTMF_c m_drawManage
A list of all the bases scheduled for drawing.
static fTrMgPTMF_c m_connectManage
A tree that connects all loaded bases.
static fLiMgBa_c m_searchManage[8]
An array of lists used for base lookup.
static LOOP_PROC_e m_nowLoopProc
The current operation being globally executed. See mainLoop.
static fBase_c * searchBaseByGroupType(unsigned char groupType, const fBase_c *parent)
Searches for a base with a given group type, optionally under a given parent.
Definition f_manager.cpp:41
LOOP_PROC_e
The operation types.
Definition f_manager.hpp:72
PROC_FLAGS_e
The operation disable flags, induced from LOOP_PROC_e.
Definition f_manager.hpp:77
static fLiMgPTMF_c m_executeManage
A list of all the bases scheduled for execution.
static u32 m_StopProcInf
[Unused]. The operations which should be globally skipped this frame.
int getSearchTableNum()
Gets the index of the search list the owning base was added to. See m_searchManage.
Definition f_manager.cpp:14
static fLiMgPTMF_c m_deleteManage
A list of all the bases scheduled for deletion.
fLiNdPrio_c mDrawNode
The node in the draw list.
static void mainLoop()
Executes the currently enabled operations on all the bases in the respective lists.
Definition f_manager.cpp:56
fTrNdBa_c mConnectNode
The node in the connect tree.
static fLiMgPTMF_c m_createManage
A list of all the bases scheduled for creation.
fLiNdBa_c mSearchNode
The node in the search lists.
fLiNdPrio_c mMainNode
The node in the create, execute or delete list.
static fBase_c * searchBaseByID(fBaseID_e id)
Searches for a base with the given ID.
Definition f_manager.cpp:18
static fBase_c * searchBaseByProfName(ProfileName profID, const fBase_c *parent)
Searches for a base with a given profile name, optionally under a given parent.
Definition f_manager.cpp:26
fManager_c(fBase_c *owner)
Constructs a new manager.
Definition f_manager.hpp:88
A base tree made of fTrNdBa_c nodes, with a reference to a process function.
A base tree node.
Definition f_tree_nd.hpp:12
fBaseID_e
A unique identifier for each base.
Definition f_base_id.hpp:6
u16 ProfileName
The name of a profile. Value is a fProfile::PROFILE_NAME_e.
Definition f_profile.hpp:32