f_pc_layer (#16)

* f_op_actor_tag OK

* f_pc_layer_tag OK

* f_pc_layer_iter

* forgot a return

* identation and extern var name comments

* fix struct member name

Co-authored-by: Pheenoh <pheenoh@gmail.com>
This commit is contained in:
lepelog
2020-12-06 05:58:12 +01:00
committed by GitHub
parent 74faaee32a
commit ccab99f398
20 changed files with 378 additions and 754 deletions
+2 -1
View File
@@ -7,7 +7,8 @@
#include "SComponent/c_list.h"
#include "SComponent/c_tree.h"
struct create_tag_class : public node_class {
struct create_tag_class {
node_class pNode;
void *mpTagData;
s8 mbIsUse;
};
+15
View File
@@ -0,0 +1,15 @@
#ifndef F_OP_ACTOR_TAG_H
#define F_OP_ACTOR_TAG_H
#include "global.h"
#include "SComponent/c_tag.h"
extern "C" {
u32 fopAcTg_ToActorQ(create_tag_class* c);
u32 fopAcTg_ActorQTo(create_tag_class* c);
u32 fopAcTg_Init(create_tag_class* c, void* data);
}
#endif
+13 -12
View File
@@ -10,14 +10,15 @@
struct process_method_tag_class;
struct process_node_class;
struct layer_class : public node_class {
struct layer_class {
node_class mNode; // generates different asm for struct copy if using inheritance
u32 mLayerID;
node_lists_tree_class mNodeListTree;
process_node_class *mpPcNode;
node_lists_tree_class mCancelListTree;
void *mpUnk0;
short mCreatingCount;
short mDeletingCount;
s32 mpUnk0;
s32 mCreatingCount:16;// for some reason, the compiler only optimized these into a single word load/store instead of 2 halfword load/store, but only if they are written like this
s32 mDeletingCount:16;
};
extern "C" {
@@ -33,21 +34,21 @@ void fpcLy_CreatedMesg(layer_class *pLayer);
void fpcLy_CreatingMesg(layer_class *pLayer);
void fpcLy_DeletedMesg(layer_class *pLayer);
void fpcLy_DeletingMesg(layer_class *pLayer);
int fpcLy_IsCreatingMesg(layer_class *pLayer);
int fpcLy_IsDeletingMesg(layer_class *pLayer);
bool fpcLy_IsCreatingMesg(layer_class *pLayer);
bool fpcLy_IsDeletingMesg(layer_class *pLayer);
void fpcLy_IntoQueue(layer_class *pLayer, int treeListIdx, create_tag_class *pTag, int idx);
void fpcLy_ToQueue(layer_class *pLayer, int treeListIdx, create_tag_class *pTag);
void fpcLy_QueueTo(layer_class *pLayer, create_tag_class *pTag);
int fpcLy_IntoQueue(layer_class *pLayer, int treeListIdx, create_tag_class *pTag, int idx);
int fpcLy_ToQueue(layer_class *pLayer, int treeListIdx, create_tag_class *pTag);
int fpcLy_QueueTo(layer_class *pLayer, create_tag_class *pTag);
void fpcLy_Cancel(layer_class *pLayer);
int fpcLy_CancelMethod(layer_class *pLayer);
bool fpcLy_CancelMethod(process_method_tag_class *pLayer);
void fpcLy_CancelQTo(process_method_tag_class *pMthd);
void fpcLy_ToCancelQ(layer_class *pLayer, process_method_tag_class *pMthd);
void fpcLy_Create(layer_class *pLayer, void *pPcNode, node_list_class *pLists, int listNum);
void fpcLy_Delete(layer_class *pLayer);
void fpcLy_Create(layer_class *pLayer, process_node_class *pPcNode, node_list_class *pLists, int listNum);
int fpcLy_Delete(layer_class *pLayer);
};
+22
View File
@@ -0,0 +1,22 @@
#ifndef F_PC_LAYER_ITER_H
#define F_PC_LAYER_ITER_H
#include "global.h"
#include "f/f_pc/f_pc_layer.h"
#include "SComponent/c_node_iter.h"
struct layer_iter {
void* mpFunc;
void* mpUserData;
};
extern "C" {
int fpcLyIt_OnlyHere(layer_class *pLayer, cNdIt_MethodFunc pFunc, void *pUserData);
int fpcLyIt_OnlyHereLY(layer_class *pLayer, cNdIt_MethodFunc pFunc, void *pUserData);
void * fpcLyIt_Judge(layer_class *pLayer, cNdIt_MethodFunc pFunc, void *pUserData);
void * fpcLyIt_AllJudge(cNdIt_MethodFunc pFunc, void *pUserData);
}
#endif
+13 -3
View File
@@ -7,10 +7,20 @@
struct layer_class;
struct layer_management_tag_class : public create_tag_class {
struct layer_management_tag_class {
create_tag_class mCreateTag;
layer_class *mpLayer;
s16 mNodeListID;
s16 mNodeListIdx;
u16 mNodeListID;
u16 mNodeListIdx;
};
extern "C" {
s32 fpcLyTg_QueueTo(layer_management_tag_class *pTag);
s32 fpcLyTg_ToQueue(layer_management_tag_class *pTag, u32 layerID, u16 listID, u16 listPrio);
s32 fpcLyTg_Move(layer_management_tag_class *, u32, u16, u16);
s32 fpcLyTg_Init(layer_management_tag_class *, u32, void *);
}
#endif
+2
View File
@@ -13,7 +13,9 @@ struct process_method_tag_class : public create_tag_class {
extern "C" {
int fpcMtdTg_Do(process_method_tag_class *pMthd);
void fpcMtdTg_MethodQTo(process_method_tag_class *pMthd);
void fpcMtdTg_ToMethodQ(node_list_class *pList, process_method_tag_class *pMthd);
int fpcMtdTg_Init(process_method_tag_class *pMthd, process_method_tag_func pFunc, void *pMthdData);
};
+1 -1
View File
@@ -164,4 +164,4 @@ lbl_80005D34:
/* 80005D3C 00002C7C 80 01 00 34 */ lwz r0, 0x34(r1)
/* 80005D40 00002C80 7C 08 03 A6 */ mtlr r0
/* 80005D44 00002C84 38 21 00 30 */ addi r1, r1, 0x30
/* 80005D48 00002C88 4E 80 00 20 */ blr
/* 80005D48 00002C88 4E 80 00 20 */ blr