summaryrefslogtreecommitdiff
path: root/include/d/d_cs_base.h
blob: 0ac075b9cbd23f55fc18e0c93454728663f621b8 (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
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
#ifndef D_C_BASE_H
#define D_C_BASE_H

#include "common.h"
#include "d/d_cs.h"
#include "d/d_cursor_hit_check.h"
#include "d/lyt/d2d.h"
#include "d/lyt/d_lyt_cursor_stick.h"
#include "m/m2d.h"
#include "m/m_angle.h"
#include "m/m_vec.h"
#include "nw4r/lyt/lyt_pane.h"

class dCsBase_c : public dCs_c {
public:
    dCsBase_c();
    virtual ~dCsBase_c();
    virtual int create() override;
    virtual int doDelete() override;
    virtual int draw() override;
    virtual int execute() override;

    int update();
    bool drawDirectly();

    void setVisible(bool val) {
        mVisible = val;
    }
    bool isVisible() const {
        return mVisible;
    }
    void setDrawDirectly(bool val) {
        mDrawDirectly = val;
    }
    bool getDrawDirectly() const {
        return mDrawDirectly;
    }
    void setCalibrationPointCenterEnabled(bool val) {
        mCalibrationPointCenterEnabled = val;
    }

    dCursorHitCheck_c *getHitCheck() const {
        return mCursorIf.getHit();
    }

    dCursorInterface_c *getCursorIf() {
        return &mCursorIf;
    }

    static dCsBase_c *GetInstance() {
        return sInstance;
    }

    void setCursorStickVisible(bool visible) {
        mCursorStick.setShouldBeOn(visible);
    }

    void setCursorStickPriority(u8 priority) {
        mCursorStick.setPriority(priority);
    }

    void setCursorStickPriority2(u8 priority) {
        mCursorStick.setPriority2(priority);
    }

    bool isCursorStickVisible() const {
        return mCursorStick.getShouldBeOn();
    }

    void setCursorStickTargetPane(const nw4r::lyt::Pane *target) {
        mCursorStick.setTargetPane(target);
    }

    const nw4r::lyt::Pane *getCursorStickAllPane() const {
        return mCursorStick.getAllPane();
    }

private:
    static dCsBase_c *sInstance;
    void setCurrentLyt(int lyt);

    /* 0x068 */ m2d::ResAccIf_c mResAcc;
    /* 0x11C */ d2d::LytBase_c mLyts[2];
    /* 0x23C */ d2d::LytBase_c *mpCurrLyt;
    /* 0x240 */ dCursorInterface_c mCursorIf;
    /* 0x254 */ dLytCursorStick_c mCursorStick;
    /* 0x6F0 */ mVec2_c mCsPosition;
    /* 0x6F8 */ mVec2_c mCsVelocity;
    /* 0x700 */ mAng field_0x700;
    /* 0x702 */ u8 mAlpha;
    /* 0x703 */ bool mVisible;
    /* 0x704 */ bool mDrawDirectly;
    /* 0x705 */ bool mCalibrationPointCenterEnabled;
};

#endif