mirror of https://github.com/AxioDL/metaforce.git
CCollidable*: Make use of static inline variables where applicable
Allows relocating initialization with the rest of the variables.
This commit is contained in:
parent
55da593e59
commit
88e6a04f13
|
@ -7,7 +7,6 @@
|
|||
|
||||
namespace urde {
|
||||
constexpr CCollisionPrimitive::Type sType(CCollidableAABox::SetStaticTableIndex, "CCollidableAABox");
|
||||
u32 CCollidableAABox::sTableIndex = -1;
|
||||
|
||||
CCollidableAABox::CCollidableAABox() = default;
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ bool AABox_AABox_Bool(const CInternalCollisionStructure&);
|
|||
} // namespace Collide
|
||||
|
||||
class CCollidableAABox : public CCollisionPrimitive {
|
||||
static u32 sTableIndex;
|
||||
static inline u32 sTableIndex = UINT32_MAX;
|
||||
|
||||
zeus::CAABox x10_aabox;
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
namespace urde {
|
||||
constexpr CCollisionPrimitive::Type sType(CCollidableCollisionSurface::SetStaticTableIndex,
|
||||
"CCollidableCollisionSurface");
|
||||
u32 CCollidableCollisionSurface::sTableIndex = -1;
|
||||
|
||||
const CCollisionPrimitive::Type& CCollidableCollisionSurface::GetType() { return sType; }
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
namespace urde {
|
||||
class CCollidableCollisionSurface {
|
||||
static u32 sTableIndex;
|
||||
static inline u32 sTableIndex = UINT32_MAX;
|
||||
|
||||
public:
|
||||
static const CCollisionPrimitive::Type& GetType();
|
||||
|
|
|
@ -9,8 +9,6 @@
|
|||
|
||||
namespace urde {
|
||||
|
||||
u32 CCollidableOBBTree::sTableIndex = 0;
|
||||
|
||||
CCollidableOBBTree::CCollidableOBBTree(const COBBTree* tree, const urde::CMaterialList& material)
|
||||
: CCollisionPrimitive(material), x10_tree(tree) {}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ class CCollidableOBBTree : public CCollisionPrimitive {
|
|||
u32 x14_tries = 0;
|
||||
u32 x18_misses = 0;
|
||||
u32 x1c_hits = 0;
|
||||
static u32 sTableIndex;
|
||||
static inline u32 sTableIndex = 0;
|
||||
bool LineIntersectsLeaf(const COBBTree::CLeafData& leaf, CRayCastInfo& info) const;
|
||||
bool LineIntersectsOBBTree(const COBBTree::CNode& n0, const COBBTree::CNode& n1, CRayCastInfo& info) const;
|
||||
bool LineIntersectsOBBTree(const COBBTree::CNode& node, CRayCastInfo& info) const;
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
|
||||
namespace urde {
|
||||
constexpr CCollisionPrimitive::Type sType(CCollidableOBBTreeGroup::SetStaticTableIndex, "CCollidableOBBTreeGroup");
|
||||
u32 CCollidableOBBTreeGroup::sTableIndex = -1;
|
||||
|
||||
CCollidableOBBTreeGroupContainer::CCollidableOBBTreeGroupContainer(CInputStream& in) {
|
||||
const u32 treeCount = in.readUint32Big();
|
||||
|
|
|
@ -24,7 +24,7 @@ public:
|
|||
};
|
||||
|
||||
class CCollidableOBBTreeGroup : public CCollisionPrimitive {
|
||||
static u32 sTableIndex;
|
||||
static inline u32 sTableIndex = UINT32_MAX;
|
||||
const CCollidableOBBTreeGroupContainer* x10_container;
|
||||
|
||||
public:
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
|
||||
namespace urde {
|
||||
constexpr CCollisionPrimitive::Type sType(CCollidableSphere::SetStaticTableIndex, "CCollidableSphere");
|
||||
u32 CCollidableSphere::sTableIndex = -1;
|
||||
|
||||
namespace Collide {
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ bool Sphere_Sphere_Bool(const CInternalCollisionStructure&);
|
|||
} // namespace Collide
|
||||
|
||||
class CCollidableSphere : public CCollisionPrimitive {
|
||||
static u32 sTableIndex;
|
||||
static inline u32 sTableIndex = UINT32_MAX;
|
||||
|
||||
zeus::CSphere x10_sphere;
|
||||
|
||||
|
|
Loading…
Reference in New Issue