mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-07-06 18:45:53 +00:00
CGameArea: Make use of std::array where applicable
Same behavior, stronger typing, and optional runtime checking in debug mode.
This commit is contained in:
parent
a433a7852f
commit
b2ec3e7eac
@ -1,5 +1,7 @@
|
|||||||
#include "Runtime/World/CGameArea.hpp"
|
#include "Runtime/World/CGameArea.hpp"
|
||||||
|
|
||||||
|
#include <array>
|
||||||
|
|
||||||
#include "Runtime/CGameState.hpp"
|
#include "Runtime/CGameState.hpp"
|
||||||
#include "Runtime/CSimplePool.hpp"
|
#include "Runtime/CSimplePool.hpp"
|
||||||
#include "Runtime/CStateManager.hpp"
|
#include "Runtime/CStateManager.hpp"
|
||||||
@ -43,8 +45,10 @@ CAreaRenderOctTree::CAreaRenderOctTree(const u8* buf) : x0_buf(buf) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static const u32 ChildCounts[] = {0, 2, 2, 4, 2, 4, 4, 8};
|
u32 CAreaRenderOctTree::Node::GetChildCount() const {
|
||||||
u32 CAreaRenderOctTree::Node::GetChildCount() const { return ChildCounts[x2_flags]; }
|
static constexpr std::array<u32, 8> ChildCounts{0, 2, 2, 4, 2, 4, 4, 8};
|
||||||
|
return ChildCounts[x2_flags];
|
||||||
|
}
|
||||||
|
|
||||||
zeus::CAABox CAreaRenderOctTree::Node::GetNodeBounds(const zeus::CAABox& curAABB, int idx) const {
|
zeus::CAABox CAreaRenderOctTree::Node::GetNodeBounds(const zeus::CAABox& curAABB, int idx) const {
|
||||||
zeus::CVector3f center = curAABB.center();
|
zeus::CVector3f center = curAABB.center();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user