summaryrefslogtreecommitdiff
path: root/src/f_op/f_op_scene_pause.cpp
blob: 71cb3d63324e89785a9ce83db4afa45ae5050464 (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
/**
 * f_op_scene_pause.cpp
 * Scene Process Pause
 */

#include "f_op/f_op_scene_pause.h"
#include "f_op/f_op_scene.h"
#include "f_pc/f_pc_manager.h"

int fopScnPause_Enable(scene_class* i_scene) {
    if (i_scene) {
        fpcM_PauseEnable(i_scene, 1);
        fpcM_PauseEnable(i_scene, 2);
        return 1;
    }

    return 0;
}

int fopScnPause_Disable(scene_class* i_scene) {
    if (i_scene) {
        void* tmp = (void*)i_scene->base.base.mLyTg.mpLayer->mpPcNode;

        if (!tmp) {
            fpcM_PauseDisable(i_scene, 1);
            fpcM_PauseDisable(i_scene, 2);
        } else if (fpcEx_IsExist((s32)((int*)tmp)[1]) == 1) {
            if (!fpcM_IsPause(tmp, 1)) {
                fpcM_PauseDisable(i_scene, 1);
            }

            if (!fpcM_IsPause(tmp, 2)) {
                fpcM_PauseDisable(i_scene, 2);
            }
        }

        return 1;
    }

    return 0;
}