NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
f_manager.cpp
1#include <game/framework/f_manager.hpp>
2#include <game/framework/f_base.hpp>
3
10
13
15 return ((fBase_c *) (mSearchNode.mpOwner))->mUniqueID & 7;
16}
17
19 const fLiNdBa_c *res = m_searchManage[id & 7].searchNodeByID(id);
20 if (res != nullptr) {
21 return res->mpOwner;
22 }
23 return nullptr;
24}
25
27 const fTrNdBa_c *connectNode;
28 if (parent != nullptr) {
29 connectNode = &parent->mMng.mConnectNode;
30 } else {
31 connectNode = nullptr;
32 }
33
34 const fTrNdBa_c *res = m_connectManage.searchNodeByProfName(profName, connectNode);
35 if (res != nullptr) {
36 return res->mpOwner;
37 }
38 return nullptr;
39}
40
41fBase_c *fManager_c::searchBaseByGroupType(u8 groupType, const fBase_c *parent) {
42 const fTrNdBa_c *connectNode;
43 if (parent != nullptr) {
44 connectNode = &parent->mMng.mConnectNode;
45 } else {
46 connectNode = nullptr;
47 }
48
49 const fTrNdBa_c *res = m_connectManage.searchNodeByGroupType(groupType, connectNode);
50 if (res != nullptr) {
51 return res->mpOwner;
52 }
53 return nullptr;
54}
55
57 if ((m_StopProcInf & PROC_FLAG_DELETE) == 0) {
58 m_nowLoopProc = DELETE;
60 }
61
62 if ((m_StopProcInf & PROC_FLAG_CREATE) == 0) {
63 m_nowLoopProc = CREATE;
65 }
66
67 if ((m_StopProcInf & PROC_FLAG_EXECUTE) == 0) {
68 m_nowLoopProc = EXECUTE;
70 }
71
72 if ((m_StopProcInf & PROC_FLAG_DRAW) == 0) {
73 m_nowLoopProc = DRAW;
75 }
76
77 if ((m_StopProcInf & PROC_FLAG_CONNECT) == 0) {
78 m_nowLoopProc = CONNECT;
80 }
81
82 m_nowLoopProc = NONE;
83}
The base class for all scenes, actors and various other processes.
Definition f_base.hpp:119
int createPack()
Executes the create operation. See commonPack.
Definition f_base.cpp:122
int connectProc()
Executes the connect operation.
Definition f_base.cpp:212
fManager_c mMng
The base's process manager.
Definition f_base.hpp:193
int deletePack()
Executes the delete operation. See commonPack.
Definition f_base.cpp:164
int executePack()
Executes the execute operation. See commonPack.
Definition f_base.cpp:184
int drawPack()
Executes the draw operation. See commonPack.
Definition f_base.cpp:204
A base list, made of fLiNdBa_c nodes.
Definition f_list_mg.hpp:13
const fLiNdBa_c * searchNodeByID(fBaseID_e id) const
Searches for a base with the given ID.
Definition f_list.cpp:48
A base list made of fLiNdPrio_c nodes, with a reference to a process function.
bool walkPack()
Calls the process function on each base in the list.
Definition f_list.cpp:31
A base list node.
Definition f_list_nd.hpp:11
fBase_c * mpOwner
The owner of this node.
Definition f_list_nd.hpp:31
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:74
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.
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.
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
const fTrNdBa_c * searchNodeByProfName(ProfileName profName, const fTrNdBa_c *parent) const
Searches for a base with a given profile name, optionally under a given parent.
Definition f_tree.cpp:24
const fTrNdBa_c * searchNodeByGroupType(u8 groupType, const fTrNdBa_c *parent) const
Searches for a base with a given group type, optionally under a given parent.
Definition f_tree.cpp:41
A base tree made of fTrNdBa_c nodes, with a reference to a process function.
bool walkPack()
Calls the process function on each base in the tree.
Definition f_tree.cpp:7
A base tree node.
Definition f_tree_nd.hpp:12
fBase_c * mpOwner
The owner of this node.
Definition f_tree_nd.hpp:45
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