summaryrefslogtreecommitdiff
path: root/include/SSystem/SComponent/c_bg_s_poly_info.h
blob: 050d16d9371b33730d99bf91e623838262498a07 (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
#ifndef C_BG_S_POLY_INFO_H
#define C_BG_S_POLY_INFO_H

#include "dolphin/types.h"
#include "JSystem/JUtility/JUTAssert.h"
#include "f_pc/f_pc_manager.h"
#include "global.h"

class cBgW;

class cBgS_PolyInfo {
private:
    /* 0x00 */ u16 mPolyIndex;
    /* 0x02 */ u16 mBgIndex;
    /* 0x04 */ cBgW* mpBgW;
    /* 0x08 */ fpc_ProcID mActorId;

public:
    cBgS_PolyInfo() {
        ClearPi();
    }
    void ClearPi() {
        mPolyIndex = -1;
        mBgIndex = 0x100;
        mpBgW = NULL;
        mActorId = fpcM_ERROR_PROCESS_ID_e;
    }
    void SetPolyInfo(const cBgS_PolyInfo& other) {
        *this = other;
    }
    void SetActorInfo(int bg_index, void* bgw, fpc_ProcID actor_id) {
        JUT_ASSERT(0x59, 0 <= bg_index);
        mBgIndex = bg_index;
        mpBgW = (cBgW*)bgw;
        mActorId = actor_id;
    }
    bool ChkSafe(const void* bgw, fpc_ProcID pid) const {
        if (mpBgW == bgw && mActorId == pid)
            return true;
        return false;
    }

    virtual ~cBgS_PolyInfo() {}

    int GetPolyIndex() const { return mPolyIndex; }
    int GetBgIndex() const { return mBgIndex; }
    bool ChkSetInfo() const {
        if (mPolyIndex == 0xFFFF || mBgIndex == 0x100) {
            return false;
        }

        return true;
    }
    bool ChkSetInf() const {
        if (mPolyIndex == 0xFFFF || mBgIndex == 0x100) {
            return false;
        }

        return true;
    }
    bool ChkBgIndex() const {
        if (mBgIndex == 0x100) {
            return false;
        }
        return true;
    }
    void SetPolyIndex(int poly_index) {
        JUT_ASSERT(0x7b, 0 <= poly_index);
        mPolyIndex = poly_index;
    }
};  // Size: 0x10

STATIC_ASSERT(sizeof(cBgS_PolyInfo) == 0x10);

#endif /* C_BG_S_POLY_INFO_H */