2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-14 22:06:10 +00:00

CCollisionSurface: Return std::array by reference from GetVerts()

Same behavior, facilitates better static analysis for out-of-bounds
accesses, and also even allows size querying if necessary.
This commit is contained in:
Lioncash
2020-04-06 06:02:49 -04:00
parent ecf3cfdb49
commit c97fedd989
5 changed files with 16 additions and 12 deletions

View File

@@ -9,7 +9,11 @@
namespace urde {
class CCollisionSurface {
std::array<zeus::CVector3f, 3> x0_data;
public:
using Vertices = std::array<zeus::CVector3f, 3>;
private:
Vertices x0_data;
u32 x24_flags;
public:
@@ -17,7 +21,7 @@ public:
zeus::CVector3f GetNormal() const;
const zeus::CVector3f& GetVert(s32 idx) const { return x0_data[idx]; }
const zeus::CVector3f* GetVerts() const { return x0_data.data(); }
const Vertices& GetVerts() const { return x0_data; }
zeus::CPlane GetPlane() const;
u32 GetSurfaceFlags() const { return x24_flags; }
};