f_pc_layer: Fix struct (#22)

Co-authored-by: Pheenoh <pheenoh@gmail.com>
This commit is contained in:
Jasper St. Pierre 2020-12-07 11:51:49 -08:00 committed by GitHub
parent a0304f5917
commit 81e70882bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 9 deletions

View File

@ -35,8 +35,8 @@ struct base_process_class {
extern "C" {
extern int fpcBs_Is_JustOfType(int a, int b);
extern int fpcBs_Execute(base_process_class *pProc);
int fpcBs_Is_JustOfType(int a, int b);
int fpcBs_Execute(base_process_class *pProc);
};

View File

@ -15,8 +15,7 @@ struct layer_class {
u32 mLayerID;
node_lists_tree_class mNodeListTree;
process_node_class *mpPcNode;
node_lists_tree_class mCancelListTree;
s32 mpUnk0;
node_list_class mCancelList;
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;
};

View File

@ -23,8 +23,7 @@ void fpcLy_CancelQTo(process_method_tag_class *pMthd) {
}
void fpcLy_ToCancelQ(layer_class *pLayer, process_method_tag_class *pMthd) {
// this is obviously wrong
fpcMtdTg_ToMethodQ((node_list_class*)&pLayer->mCancelListTree, pMthd);
fpcMtdTg_ToMethodQ(&pLayer->mCancelList, pMthd);
}
bool fpcLy_CancelMethod(process_method_tag_class *pLayer) {
@ -109,7 +108,7 @@ void fpcLy_Regist(layer_class *pLayer) {
}
int fpcLy_Delete(layer_class *pLayer) {
if (pLayer->mNodeListTree.mpLists->mSize == 0 && pLayer->mpUnk0 == NULL) {
if (pLayer->mNodeListTree.mpLists->mSize == 0 && pLayer->mCancelList.mSize == 0) {
cLs_SingleCut(&pLayer->mNode);
*pLayer = lbl_803A39B0;
return 1;
@ -119,8 +118,7 @@ int fpcLy_Delete(layer_class *pLayer) {
}
void fpcLy_Cancel(layer_class *pLayer) {
// data structures are messed up?
fpcMtdIt_Method((node_list_class*)&pLayer->mCancelListTree, (cNdIt_MethodFunc)fpcLy_CancelMethod);
fpcMtdIt_Method(&pLayer->mCancelList, (cNdIt_MethodFunc)fpcLy_CancelMethod);
}
void fpcLy_Create(layer_class *pLayer, process_node_class *pPcNode, node_list_class *pLists, int listNum) {