1#pragma once
2
3#include <basis/seadTypes.h>
4
5// TODO: bring this up to sanae
6// temp solution to figure out a solution to bitflag enums (stole this right from nvn headers)
7#define AL_BITS(CLASS) \
8public: \
9 CLASS() : m_value(-1) {} \
10 CLASS(const CLASS& c) : m_value(c.m_value) {} \
11 CLASS(s32 i) : m_value(i) {} \
12 CLASS(Enum e) : m_value(e) {} \
13 operator s32() const { \
14 return m_value; \
15 } \
16 bool operator==(const CLASS& c) const { \
17 return m_value == c.m_value; \
18 } \
19 bool operator==(const Enum& e) const { \
20 return m_value == e; \
21 } \
22 bool isSet(const Enum& e) const { \
23 return (m_value & e) != 0; \
24 } \
25 bool operator!=(const CLASS& c) const { \
26 return m_value != c.m_value; \
27 } \
28 bool operator!=(const Enum& e) const { \
29 return m_value != e; \
30 } \
31 CLASS operator|(const CLASS& c) const { \
32 return CLASS(m_value | c.m_value); \
33 } \
34 CLASS operator|(const Enum& e) const { \
35 return CLASS(m_value | e); \
36 } \
37 CLASS operator&(const CLASS& c) const { \
38 return CLASS(m_value & c.m_value); \
39 } \
40 CLASS operator&(const Enum& e) const { \
41 return CLASS(m_value & e); \
42 } \
43 CLASS operator^(const CLASS& c) const { \
44 return CLASS(m_value ^ c.m_value); \
45 } \
46 CLASS operator^(const Enum& e) const { \
47 return CLASS(m_value ^ e); \
48 } \
49 CLASS& operator|=(const CLASS& c) { \
50 m_value |= c.m_value; \
51 return *this; \
52 } \
53 CLASS& operator|=(const Enum& e) { \
54 m_value |= e; \
55 return *this; \
56 } \
57 CLASS& operator&=(const CLASS& c) { \
58 m_value &= c.m_value; \
59 return *this; \
60 } \
61 CLASS& operator&=(const Enum& e) { \
62 m_value &= e; \
63 return *this; \
64 } \
65 CLASS& operator^=(const CLASS& c) { \
66 m_value ^= c.m_value; \
67 return *this; \
68 } \
69 CLASS& operator^=(const Enum& e) { \
70 m_value ^= e; \
71 return *this; \
72 } \
73 CLASS& operator=(const CLASS& c) { \
74 m_value = c.m_value; \
75 return *this; \
76 } \
77 void set(const Enum& e) { \
78 m_value |= e; \
79 } \
80 void unset(const Enum& e) { \
81 if (isSet(e)) \
82 m_value &= ~e; \
83 } \
84 \
85private: \
86 s32 m_value;
87
88namespace al {
89class LiveActor;
90struct ActorInitInfo;
91
92struct SubActorSync {
93 enum Enum {
94 cNone = 0, // 0
95 cAppear = 1 << 0, // 1
96 cClipping = 1 << 1, // 2
97 cHide = 1 << 2, // 4
98 cAlphaMask = 1 << 3, // 8
99 cAll = cAppear | cClipping | cHide | cAlphaMask // 15
100 };
101
102 AL_BITS(SubActorSync)
103};
104
105struct SubActorInfo {
106public:
107 SubActorInfo();
108
109 SubActorInfo(LiveActor* actor, SubActorSync syncType) : subActor(actor), syncType(syncType) {}
110
111 LiveActor* subActor = nullptr;
112 void* field_8 = nullptr;
113 SubActorSync syncType = SubActorSync::cNone;
114};
115
116} // namespace al
117