#ifndef D_LYT_MAP_CAPTURE_H
#define D_LYT_MAP_CAPTURE_H

#include "common.h"
#include "m/m_vec.h"
#include "nw4r/lyt/lyt_picture.h"
#include "s/s_State.hpp"
#include "s/s_StateID.hpp"

class dLytMapCapture_c {
public:
    dLytMapCapture_c() : mStateMgr(*this), mpPicture(nullptr) {
        mRenderRequest = false;
        mIsBusyRendering = false;
        field_0x06C = 0.0f;
        field_0x068 = 0.0f;
        field_0x064 = 0.0f;
        mStateMgr.changeState(StateID_RenderingWait);
    }
    virtual ~dLytMapCapture_c() {}

    STATE_FUNC_DECLARE(dLytMapCapture_c, RenderingWait);
    STATE_FUNC_DECLARE(dLytMapCapture_c, RenderingWaitStep2);

    void renderRequest() {
        mRenderRequest = true;
    }

    void setPicture(nw4r::lyt::Picture *pic) {
        mpPicture = pic;
    }

    void execute();
    bool isBusyRendering() const;
    void fn_8012D610(mVec3_c *out);
    void fn_8012D670(mVec3_c *out);
    void fn_8012D6D0(mVec3_c *out);

private:
    void fn_8012D6F0();
    void fn_8012D800(nw4r::lyt::Pane *pane, GXTexObj *texObj);

    /* 0x004 */ UI_STATE_MGR_DECLARE(dLytMapCapture_c);
    /* 0x040 */ nw4r::lyt::Picture *mpPicture;
    /* 0x044 */ u8 _0x040[0x064 - 0x044];
    /* 0x064 */ f32 field_0x064;
    /* 0x068 */ f32 field_0x068;
    /* 0x06C */ f32 field_0x06C;
    /* 0x070 */ nw4r::lyt::Size field_0x070;
    /* 0x078 */ bool mRenderRequest;
    /* 0x079 */ bool mIsBusyRendering;
};

#endif
