mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-05 18:57:14 -04:00
5ffa0945b0
* f_pc_base, one non matching * some of f_pc_manager * f_pc_node OK * f_pc_pause partly * started node_req * more progress * most of node req * delete unused asm * node req header and param names * param renaming * header for manager * review comment struct names * fpcM_Management OK * int -> s32 * merge master * most of f_pc_create_iter * f_pc_stdcreate_req OK * f_pc_fstcreate OK * f_pc_leaf OK * f_pc_draw OK * f_pc_deletor partly * fix parameter type in f_pc_pause * review * review, use cPh enum and fix process_profile_definition struct * convert f_pc files to C * matched more functions * fix global.h * fix variable types * format * mpre Phs enum * fix merge errors * fix gamepad stopPatternedRumble * format * delete leftover files from merge * move asm to correct folder * revert f_pc from C to CPP * remove C hacks and format * format * OK
113 lines
3.0 KiB
C++
113 lines
3.0 KiB
C++
|
|
#include "f/f_pc/f_pc_deletor.h"
|
|
#include "SComponent/c_list_iter.h"
|
|
#include "f/f_pc/f_pc_base.h"
|
|
#include "f/f_pc/f_pc_creator.h"
|
|
#include "f/f_pc/f_pc_executor.h"
|
|
#include "f/f_pc/f_pc_layer.h"
|
|
#include "f/f_pc/f_pc_layer_iter.h"
|
|
#include "f/f_pc/f_pc_node.h"
|
|
|
|
// g_fpcDtTg_Queue
|
|
extern node_list_class lbl_803A39A0;
|
|
// g_fpcNd_type
|
|
extern s32 lbl_80450D40;
|
|
|
|
extern "C" {
|
|
|
|
BOOL fpcLd_Use(s16 procName);
|
|
s32 fpcLd_IsLoaded(s16 procName);
|
|
void fpcLd_Free(s16 procName);
|
|
s32 fpcLd_Load(s16 procName);
|
|
|
|
BOOL fpcDt_IsComplete() {
|
|
return fpcDtTg_IsEmpty();
|
|
}
|
|
|
|
s32 fpcDt_deleteMethod(base_process_class* pProc) {
|
|
layer_class* layer = pProc->mDtTg.mpLayer;
|
|
s16 typeID = pProc->mBsTypeId;
|
|
|
|
fpcLy_SetCurrentLayer(layer);
|
|
fpcLnTg_QueueTo(&pProc->mLnTg);
|
|
if (fpcBs_Delete(pProc) == 1) {
|
|
fpcLy_DeletedMesg(layer);
|
|
fpcLd_Free(typeID);
|
|
return 1;
|
|
} else {
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
void fpcDt_Handler(void) {
|
|
cLsIt_Method(&lbl_803A39A0, (cNdIt_MethodFunc)fpcDtTg_Do, fpcDt_deleteMethod);
|
|
}
|
|
|
|
s32 fpcDt_ToQueue(base_process_class* pProc) {
|
|
if (pProc->mUnk0 != 1 && fpcBs_IsDelete(pProc) == 1) {
|
|
if (fpcPi_IsInQueue(&pProc->mPi) == 1) {
|
|
fpcPi_Delete(&pProc->mPi);
|
|
}
|
|
pProc->mDtTg.mpLayer = pProc->mLyTg.mpLayer;
|
|
fpcDtTg_ToDeleteQ(&pProc->mDtTg);
|
|
fpcLy_DeletingMesg(pProc->mLyTg.mpLayer);
|
|
return 1;
|
|
} else {
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
s32 fpcDt_ToDeleteQ(base_process_class* pProc) {
|
|
if (pProc->mUnk0 == 1) {
|
|
return 0;
|
|
} else {
|
|
if (cTg_IsUse(&pProc->mDtTg.mBase) != 0) {
|
|
return 1;
|
|
} else {
|
|
if (fpcBs_Is_JustOfType(lbl_80450D40, pProc->mSubType) != 0) {
|
|
process_node_class* procNode = (process_node_class*)pProc;
|
|
if (fpcNd_IsDeleteTiming(procNode) == 0) {
|
|
return 0;
|
|
} else {
|
|
layer_class* layer = &procNode->mLayer;
|
|
fpcLy_Cancel(layer);
|
|
if (fpcLyIt_OnlyHereLY(layer, (cNdIt_MethodFunc)fpcDt_ToDeleteQ, NULL) == 0) {
|
|
return 0;
|
|
}
|
|
}
|
|
}
|
|
if (fpcDt_ToQueue(pProc) == 1) {
|
|
// return type has to be BOOL
|
|
if (fpcEx_IsExist(pProc->mBsPcId) == 1) {
|
|
if (fpcEx_ExecuteQTo(pProc) == 0) {
|
|
return 0;
|
|
}
|
|
} else {
|
|
// return type is wrong, has to be BOOL
|
|
if (fpcCt_Abort(pProc) == 0) {
|
|
return 0;
|
|
}
|
|
}
|
|
pProc->mInitState = 3;
|
|
return 1;
|
|
} else {
|
|
return 0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
s32 fpcDt_Delete(base_process_class* pProc) {
|
|
if (pProc != NULL) {
|
|
if (fpcCt_IsDoing(pProc) == 1)
|
|
return 0;
|
|
|
|
if (pProc->mInitState == 3)
|
|
return 0;
|
|
|
|
return fpcDt_ToDeleteQ(pProc);
|
|
} else {
|
|
return 1;
|
|
}
|
|
}
|
|
} |