mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-23 08:24:16 +00:00
Implement/match LegoPathActor::SwitchBoundary (#943)
* Implement/match LegoPathActor::SwitchBoundary * Rename var
This commit is contained in:

committed by
GitHub

parent
7538988f50
commit
bc91fd2189
@@ -72,7 +72,7 @@ void LegoCarRaceActor::VTable0x70(float p_float)
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10081d20
|
||||
void LegoCarRaceActor::VTable0x98(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4)
|
||||
void LegoCarRaceActor::SwitchBoundary(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
@@ -71,7 +71,7 @@ MxResult LegoJetski::VTable0x94(LegoPathActor* p_actor, MxBool p_bool)
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x100141c0
|
||||
void LegoJetski::VTable0x98(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4)
|
||||
void LegoJetski::SwitchBoundary(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
@@ -38,7 +38,7 @@ void LegoJetskiRaceActor::VTable0x70(float p_float)
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x100822d0
|
||||
void LegoJetskiRaceActor::VTable0x98(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4)
|
||||
void LegoJetskiRaceActor::SwitchBoundary(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
@@ -109,19 +109,19 @@ MxU32 LegoExtraActor::VTable0x90(float p_time, Matrix4& p_transform)
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1002aa90
|
||||
void LegoExtraActor::VTable0xa4(MxU8& p_und1, MxS32& p_und2)
|
||||
void LegoExtraActor::VTable0xa4(MxBool& p_und1, MxS32& p_und2)
|
||||
{
|
||||
switch (m_unk0x0c) {
|
||||
case 1:
|
||||
p_und1 = 1;
|
||||
p_und1 = TRUE;
|
||||
p_und2 = 1;
|
||||
break;
|
||||
case 2:
|
||||
p_und1 = 0;
|
||||
p_und1 = FALSE;
|
||||
p_und2 = 1;
|
||||
break;
|
||||
default:
|
||||
p_und1 = 1;
|
||||
p_und1 = TRUE;
|
||||
p_und2 = rand() % p_und2 + 1;
|
||||
break;
|
||||
}
|
||||
|
@@ -417,11 +417,11 @@ void LegoPathActor::VTable0x70(float p_time)
|
||||
}
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x1002e8b0
|
||||
// FUNCTION: LEGO1 0x1002e8b0
|
||||
// FUNCTION: BETA10 0x100af2f7
|
||||
void LegoPathActor::VTable0x98(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4)
|
||||
void LegoPathActor::SwitchBoundary(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4)
|
||||
{
|
||||
// TODO
|
||||
m_boundary->SwitchBoundary(this, p_boundary, p_edge, p_unk0xe4);
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1002e8d0
|
||||
@@ -576,7 +576,7 @@ MxResult LegoPathActor::VTable0x9c()
|
||||
}
|
||||
|
||||
if (local1c != 0) {
|
||||
VTable0x98(m_boundary, m_destEdge, m_unk0xe4);
|
||||
SwitchBoundary(m_boundary, m_destEdge, m_unk0xe4);
|
||||
}
|
||||
|
||||
if (local20 != 0) {
|
||||
@@ -629,7 +629,7 @@ MxResult LegoPathActor::VTable0x9c()
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x1002f650
|
||||
void LegoPathActor::VTable0xa4(MxU8&, MxS32&)
|
||||
void LegoPathActor::VTable0xa4(MxBool&, MxS32&)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
@@ -80,6 +80,103 @@ void LegoPathBoundary::FUN_100575b0(Vector3& p_point1, Vector3& p_point2, LegoPa
|
||||
}
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10057720
|
||||
// FUNCTION: BETA10 0x100b17ef
|
||||
void LegoPathBoundary::SwitchBoundary(
|
||||
LegoPathActor* p_actor,
|
||||
LegoPathBoundary*& p_boundary,
|
||||
LegoUnknown100db7f4*& p_edge,
|
||||
float& p_unk0xe4
|
||||
)
|
||||
{
|
||||
LegoUnknown100db7f4* e = p_edge;
|
||||
|
||||
if (p_edge->Unknown2(*p_boundary)) {
|
||||
LegoPathBoundary* newBoundary = (LegoPathBoundary*) p_edge->OtherFace(p_boundary);
|
||||
|
||||
if (newBoundary == NULL) {
|
||||
newBoundary = p_boundary;
|
||||
}
|
||||
|
||||
MxS32 local10 = 0;
|
||||
MxU8 userNavFlag;
|
||||
|
||||
if (e->Unknown(*newBoundary, 1)) {
|
||||
userNavFlag = p_actor->GetUserNavFlag();
|
||||
}
|
||||
else {
|
||||
userNavFlag = TRUE;
|
||||
}
|
||||
|
||||
do {
|
||||
p_edge = (LegoUnknown100db7f4*) p_edge->GetCounterclockwiseEdge(*newBoundary);
|
||||
LegoPathBoundary* local20 = (LegoPathBoundary*) p_edge->OtherFace(newBoundary);
|
||||
|
||||
if (p_edge->GetMask0x03() && (userNavFlag || p_edge->Unknown(*local20, 1))) {
|
||||
local10++;
|
||||
}
|
||||
} while (p_edge != e);
|
||||
|
||||
MxBool localc = TRUE;
|
||||
MxS32 local8 = local10 - 1;
|
||||
|
||||
if (local10 <= 1) {
|
||||
local8 = 0;
|
||||
}
|
||||
else if (local10 == 2) {
|
||||
local8 = 1;
|
||||
}
|
||||
else {
|
||||
p_actor->VTable0xa4(localc, local8);
|
||||
}
|
||||
|
||||
while (local8 > 0) {
|
||||
if (localc) {
|
||||
p_edge = (LegoUnknown100db7f4*) p_edge->GetCounterclockwiseEdge(*newBoundary);
|
||||
}
|
||||
else {
|
||||
p_edge = (LegoUnknown100db7f4*) p_edge->GetClockwiseEdge(*newBoundary);
|
||||
}
|
||||
|
||||
LegoPathBoundary* local20 = (LegoPathBoundary*) p_edge->OtherFace(newBoundary);
|
||||
|
||||
if (p_edge->GetMask0x03() && (userNavFlag || p_edge->Unknown(*local20, 1))) {
|
||||
local8--;
|
||||
}
|
||||
}
|
||||
|
||||
if (p_edge == e) {
|
||||
p_edge = (LegoUnknown100db7f4*) p_edge->GetCounterclockwiseEdge(*newBoundary);
|
||||
p_edge = (LegoUnknown100db7f4*) p_edge->GetCounterclockwiseEdge(*newBoundary);
|
||||
}
|
||||
|
||||
if (p_boundary != newBoundary) {
|
||||
p_boundary->RemoveActor(p_actor);
|
||||
p_boundary = newBoundary;
|
||||
p_boundary->AddActor(p_actor);
|
||||
}
|
||||
else {
|
||||
p_unk0xe4 = 1.0 - p_unk0xe4;
|
||||
}
|
||||
}
|
||||
else {
|
||||
do {
|
||||
p_edge = (LegoUnknown100db7f4*) p_edge->GetCounterclockwiseEdge(*p_boundary);
|
||||
|
||||
if (p_edge->GetMask0x03()) {
|
||||
break;
|
||||
}
|
||||
} while (p_edge != e);
|
||||
|
||||
if (p_edge == e) {
|
||||
p_edge = (LegoUnknown100db7f4*) p_edge->GetCounterclockwiseEdge(*p_boundary);
|
||||
p_edge = (LegoUnknown100db7f4*) p_edge->GetCounterclockwiseEdge(*p_boundary);
|
||||
}
|
||||
|
||||
p_unk0xe4 = 1.0 - p_unk0xe4;
|
||||
}
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10057950
|
||||
// FUNCTION: BETA10 0x100b1adc
|
||||
MxU32 LegoPathBoundary::Intersect(
|
||||
|
@@ -91,7 +91,7 @@ MxResult LegoRaceCar::VTable0x94(LegoPathActor* p_actor, MxBool p_bool)
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10014550
|
||||
void LegoRaceCar::VTable0x98(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4)
|
||||
void LegoRaceCar::SwitchBoundary(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
Reference in New Issue
Block a user