Add BETA10 assertions in LegoPathController (#1555)

* Add BETA10 assertions in LegoPathController

* formatting

---------

Co-authored-by: jonschz <jonschz@users.noreply.github.com>
This commit is contained in:
jonschz 2025-06-12 08:52:56 +02:00 committed by GitHub
parent 9aa8dbfc46
commit 596ebde9d3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 0 deletions

View File

@ -559,27 +559,32 @@ MxResult LegoPathController::ReadEdges(LegoStorage* p_storage)
if (p_storage->Read(&s, sizeof(MxU16)) != SUCCESS) {
return FAILURE;
}
assert(s < m_numN);
edge.m_pointA = &m_nodes[s];
if (p_storage->Read(&s, sizeof(MxU16)) != SUCCESS) {
return FAILURE;
}
assert(s < m_numN);
edge.m_pointB = &m_nodes[s];
if (edge.m_flags & LegoOrientedEdge::c_hasFaceA) {
if (p_storage->Read(&s, sizeof(MxU16)) != SUCCESS) {
return FAILURE;
}
assert(s < m_numL);
edge.m_faceA = &m_boundaries[s];
if (p_storage->Read(&s, sizeof(MxU16)) != SUCCESS) {
return FAILURE;
}
assert(s < m_numE);
edge.m_ccwA = &m_edges[s];
if (p_storage->Read(&s, sizeof(MxU16)) != SUCCESS) {
return FAILURE;
}
assert(s < m_numE);
edge.m_cwA = &m_edges[s];
}
@ -587,16 +592,19 @@ MxResult LegoPathController::ReadEdges(LegoStorage* p_storage)
if (p_storage->Read(&s, sizeof(MxU16)) != SUCCESS) {
return FAILURE;
}
assert(s < m_numL);
edge.m_faceB = &m_boundaries[s];
if (p_storage->Read(&s, sizeof(MxU16)) != SUCCESS) {
return FAILURE;
}
assert(s < m_numE);
edge.m_ccwB = &m_edges[s];
if (p_storage->Read(&s, sizeof(MxU16)) != SUCCESS) {
return FAILURE;
}
assert(s < m_numE);
edge.m_cwB = &m_edges[s];
}
@ -617,6 +625,9 @@ MxResult LegoPathController::ReadEdges(LegoStorage* p_storage)
MxResult LegoPathController::ReadBoundaries(LegoStorage* p_storage)
{
for (MxS32 i = 0; i < m_numL; i++) {
#ifdef BETA10
Mx4DPointFloat unused;
#endif
LegoPathBoundary& boundary = m_boundaries[i];
MxU8 numE;
MxU16 s;
@ -626,6 +637,8 @@ MxResult LegoPathController::ReadBoundaries(LegoStorage* p_storage)
return FAILURE;
}
assert(numE > 2);
boundary.m_edgeNormals = new Mx4DPointFloat[numE];
LegoOrientedEdge** edges = new LegoOrientedEdge*[numE];
@ -636,6 +649,8 @@ MxResult LegoPathController::ReadBoundaries(LegoStorage* p_storage)
return FAILURE;
}
assert(s < m_numE);
edges[j] = &m_edges[s];
}
@ -693,6 +708,8 @@ MxResult LegoPathController::ReadBoundaries(LegoStorage* p_storage)
return FAILURE;
}
assert(s < m_numT);
boundary.m_pathTrigger[j].m_pathStruct = &m_structs[s];
if (p_storage->Read(&boundary.m_pathTrigger[j].m_data, sizeof(boundary.m_pathTrigger[j].m_data)) !=

View File

@ -25,6 +25,7 @@ public:
// FUNCTION: BETA10 0x100373f0
LegoU32 IsEqual(LegoWEEdge* p_other) { return this == p_other; }
// FUNCTION: BETA10 0x100bd410
void SetEdges(LegoOrientedEdge** p_edges, LegoU8 p_numEdges)
{
m_edges = p_edges;