1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
|
/**
* f_op_scene_req.cpp
* Scene Process Request
*/
#include "f_op/f_op_scene_req.h"
#include "f_op/f_op_overlap_mng.h"
#include "f_op/f_op_scene.h"
#include "f_op/f_op_scene_pause.h"
#include "f_pc/f_pc_executor.h"
static cPhs_State fopScnRq_phase_ClearOverlap(scene_request_class* i_sceneReq) {
return fopOvlpM_ClearOfReq() == TRUE ? cPhs_NEXT_e : cPhs_INIT_e;
}
static cPhs_State fopScnRq_phase_Execute(scene_request_class* i_sceneReq) {
return fpcNdRq_Execute(&i_sceneReq->mCrtReq);
}
static cPhs_State fopScnRq_phase_IsDoingOverlap(scene_request_class* i_sceneReq) {
return fopOvlpM_IsDoingReq() == TRUE ? cPhs_NEXT_e : cPhs_INIT_e;
}
static cPhs_State fopScnRq_phase_IsDoneOverlap(scene_request_class* i_sceneReq) {
return fopOvlpM_IsDone() == TRUE ? cPhs_NEXT_e : cPhs_INIT_e;
}
static s32 l_fopScnRq_IsUsingOfOverlap;
static cPhs_State fopScnRq_phase_Done(scene_request_class* i_sceneReq) {
if (i_sceneReq->mCrtReq.mParameter != 1) {
fopScnPause_Disable((scene_class*)fpcEx_SearchByID(i_sceneReq->mCrtReq.mCreatingID));
}
l_fopScnRq_IsUsingOfOverlap = 0;
return cPhs_NEXT_e;
}
static void fopScnRq_Execute(scene_request_class* i_sceneReq) {
cPhs_State phase_state = cPhs_Do(&i_sceneReq->mReqPhsProcCls, i_sceneReq);
switch (phase_state) {
case cPhs_NEXT_e:
fopScnRq_Execute(i_sceneReq);
break;
}
}
static int fopScnRq_PostMethod(void* param_1, scene_request_class* i_sceneReq) {
fopScnPause_Enable((scene_class*)param_1);
if (i_sceneReq->mFadeRequest) {
fopOvlpM_ToldAboutID(((scene_class*)param_1)->base.base.mBsPcId);
}
return 1;
}
static int fopScnRq_Cancel(scene_request_class* i_sceneReq) {
if (i_sceneReq->mFadeRequest && !fopOvlpM_Cancel()) {
return 0;
} else {
return 1;
}
}
static scene_request_class* fopScnRq_FadeRequest(s16 procName, u16 peekTime) {
request_base_class* req = NULL;
if (l_fopScnRq_IsUsingOfOverlap == 0 && (req = fopOvlpM_Request(procName, peekTime), req != NULL))
l_fopScnRq_IsUsingOfOverlap = 1;
return (scene_request_class*)req;
}
uint fopScnRq_Request(int reqType, scene_class* i_scene, s16 procName, void* user, s16 fadeProcName, u16 fadePeekTime) {
static node_create_request_method_class submethod = {
(process_method_func)fopScnRq_Execute,
(process_method_func)fopScnRq_Cancel,
NULL,
(process_method_func)fopScnRq_PostMethod,
};
static cPhs__Handler noFadeFase[8] = {
(cPhs__Handler)fopScnRq_phase_Execute,
(cPhs__Handler)fopScnRq_phase_Done,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
};
static cPhs__Handler fadeFase[8] = {
(cPhs__Handler)fopScnRq_phase_IsDoingOverlap,
(cPhs__Handler)fopScnRq_phase_IsDoneOverlap,
(cPhs__Handler)fopScnRq_phase_Execute,
(cPhs__Handler)fopScnRq_phase_ClearOverlap,
(cPhs__Handler)fopScnRq_phase_IsDoneOverlap,
(cPhs__Handler)fopScnRq_phase_Done,
NULL,
NULL,
};
uint ret;
scene_request_class* fade = NULL;
cPhs__Handler* phase_handler_table;
phase_handler_table = noFadeFase;
scene_request_class* pScnReq = (scene_request_class*)fpcNdRq_Request(
sizeof(scene_request_class), reqType, (process_node_class*)i_scene, procName, user,
&submethod);
if (!pScnReq) {
ret = -1;
} else {
if (fadeProcName != 0x7fff) {
phase_handler_table = fadeFase;
fade = fopScnRq_FadeRequest(fadeProcName, fadePeekTime);
if (!fade) {
fpcNdRq_Delete(&pScnReq->mCrtReq);
return -1;
}
}
pScnReq->mFadeRequest = fade;
cPhs_Set(&pScnReq->mReqPhsProcCls, phase_handler_table);
ret = pScnReq->mCrtReq.mRequestId;
}
return ret;
}
s32 fopScnRq_ReRequest(uint i_requestID, s16 i_procName, void* i_data) {
return fpcNdRq_ReRequest(i_requestID, i_procName, i_data);
}
s32 fopScnRq_Handler() {
return fpcNdRq_Handler();
}
|