summaryrefslogtreecommitdiff
path: root/src/f_op/f_op_scene_mng.cpp
blob: 08ac462557cd52ef806af3ac68f33417bb053b50 (plain)
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
/**
 * f_op_scene_mng.cpp
 * Framework - Scene Process Manager
 */

#include "f_op/f_op_scene_mng.h"
#include "f_op/f_op_scene_iter.h"
#include "f_op/f_op_scene_req.h"
#include "f_pc/f_pc_searcher.h"
#include "JSystem/JUtility/JUTAssert.h"

scene_class* fopScnM_SearchByID(fpc_ProcID id) {
    return (scene_class*)fopScnIt_Judge((fop_ScnItFunc)fpcSch_JudgeByID, &id);
}

static uint l_scnRqID = -1;

BOOL fopScnM_ChangeReq(scene_class* i_scene, s16 procName, s16 fadeProcName, u16 fadePeekTime) {
    uint sceneRequestID = fopScnRq_Request(2, i_scene, procName, 0, fadeProcName, fadePeekTime);

    if (sceneRequestID == -1) {
        return FALSE;
    }

    l_scnRqID = sceneRequestID;
    return TRUE;
}

BOOL fopScnM_DeleteReq(scene_class* i_scene) {
    uint sceneRequestID = fopScnRq_Request(1, i_scene, fpcNm_INVALID_e, 0, fpcNm_INVALID_e, 0);
    return sceneRequestID != -1;
}

BOOL fopScnM_CreateReq(s16 procName, s16 fadeProcName, u16 fadePeekTime, u32 user) {
    uint sceneRequestID = fopScnRq_Request(0, 0, procName, (void*)user, fadeProcName, fadePeekTime);
    return sceneRequestID != -1;
}

u32 fopScnM_ReRequest(s16 procName, u32 user) {
    if (l_scnRqID == -1) {
        return 0;
    }

    return fopScnRq_ReRequest(l_scnRqID, procName, (void*)user);
}

void fopScnM_Management() {
    if (!fopScnRq_Handler())
        JUT_ASSERT(DEMO_SELECT(284, 326), FALSE);
}

void fopScnM_Init() {
}