summaryrefslogtreecommitdiff
path: root/src/d/lyt/d_lyt_map_capture.cpp
blob: c8ead0c9e0d25055f41df2f37a0e97c5d3881436 (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
#include "d/lyt/d_lyt_map_capture.h"
#include "common.h"
#include "d/d_stage.h"

STATE_DEFINE(dLytMapCapture_c, RenderingWait);
STATE_DEFINE(dLytMapCapture_c, RenderingWaitStep2);

void dLytMapCapture_c::initializeState_RenderingWait() {}
void dLytMapCapture_c::executeState_RenderingWait() {
    if (mRenderRequest && !mIsBusyRendering) {
        fn_8012D6F0();
        mRenderRequest = false;
        mIsBusyRendering = true;
        mStateMgr.changeState(StateID_RenderingWaitStep2);
    }
}
void dLytMapCapture_c::finalizeState_RenderingWait() {}

void dLytMapCapture_c::initializeState_RenderingWaitStep2() {}
void dLytMapCapture_c::executeState_RenderingWaitStep2() {
    if (mIsBusyRendering && dStage_c::GetInstance() != nullptr && !dStage_c::GetInstance()->getMapRelated()->getField_0x1EE()) {
        mIsBusyRendering = false;
        if (mRenderRequest) {
            fn_8012D6F0();
            mRenderRequest = false;
            mIsBusyRendering = true;
        } else {
            mStateMgr.changeState(StateID_RenderingWait);
        }
    }
}
void dLytMapCapture_c::finalizeState_RenderingWaitStep2() {}

bool dLytMapCapture_c::isBusyRendering() const{
    return mIsBusyRendering;
}

void dLytMapCapture_c::execute() {
    mStateMgr.executeState();
}