mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-25 09:24:17 +00:00
Implement/match LegoCarRaceActor::VTable0x6c (#1085)
* Implement/match `LegoCarRaceActor::VTable0x6c` * Rename variable --------- Co-authored-by: jonschz <jonschz@users.noreply.github.com>
This commit is contained in:
@@ -56,7 +56,10 @@ public:
|
|||||||
MxU32 FUN_10057fe0(LegoAnimPresenter* p_presenter);
|
MxU32 FUN_10057fe0(LegoAnimPresenter* p_presenter);
|
||||||
MxU32 FUN_100586e0(LegoAnimPresenter* p_presenter);
|
MxU32 FUN_100586e0(LegoAnimPresenter* p_presenter);
|
||||||
|
|
||||||
|
// FUNCTION: BETA10 0x1001ffb0
|
||||||
LegoPathActorSet& GetActors() { return m_actors; }
|
LegoPathActorSet& GetActors() { return m_actors; }
|
||||||
|
|
||||||
|
// FUNCTION: BETA10 0x10082b10
|
||||||
LegoAnimPresenterSet& GetPresenters() { return m_presenters; }
|
LegoAnimPresenterSet& GetPresenters() { return m_presenters; }
|
||||||
|
|
||||||
// SYNTHETIC: LEGO1 0x10047a80
|
// SYNTHETIC: LEGO1 0x10047a80
|
||||||
@@ -170,6 +173,9 @@ private:
|
|||||||
// TEMPLATE: LEGO1 0x100589a0
|
// TEMPLATE: LEGO1 0x100589a0
|
||||||
// _Distance
|
// _Distance
|
||||||
|
|
||||||
|
// TEMPLATE: LEGO1 0x10081cd0
|
||||||
|
// _Tree<LegoPathActor *,LegoPathActor *,set<LegoPathActor *,LegoPathActorSetCompare,allocator<LegoPathActor *> >::_Kfn,LegoPathActorSetCompare,allocator<LegoPathActor *> >::lower_bound
|
||||||
|
|
||||||
// GLOBAL: LEGO1 0x100f11a4
|
// GLOBAL: LEGO1 0x100f11a4
|
||||||
// _Tree<LegoPathActor *,LegoPathActor *,set<LegoPathActor *,LegoPathActorSetCompare,allocator<LegoPathActor *> >::_Kfn,LegoPathActorSetCompare,allocator<LegoPathActor *> >::_Nil
|
// _Tree<LegoPathActor *,LegoPathActor *,set<LegoPathActor *,LegoPathActorSetCompare,allocator<LegoPathActor *> >::_Kfn,LegoPathActorSetCompare,allocator<LegoPathActor *> >::_Nil
|
||||||
|
|
||||||
|
|||||||
@@ -424,6 +424,7 @@ void LegoPathActor::VTable0x70(float p_time)
|
|||||||
// FUNCTION: BETA10 0x100af2f7
|
// FUNCTION: BETA10 0x100af2f7
|
||||||
void LegoPathActor::SwitchBoundary(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4)
|
void LegoPathActor::SwitchBoundary(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4)
|
||||||
{
|
{
|
||||||
|
assert(m_boundary);
|
||||||
m_boundary->SwitchBoundary(this, p_boundary, p_edge, p_unk0xe4);
|
m_boundary->SwitchBoundary(this, p_boundary, p_edge, p_unk0xe4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -280,7 +280,7 @@ MxResult LegoCarRaceActor::VTable0x9c()
|
|||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
// STUB: LEGO1 0x10081840
|
// FUNCTION: LEGO1 0x10081840
|
||||||
// FUNCTION: BETA10 0x100cf680
|
// FUNCTION: BETA10 0x100cf680
|
||||||
MxU32 LegoCarRaceActor::VTable0x6c(
|
MxU32 LegoCarRaceActor::VTable0x6c(
|
||||||
LegoPathBoundary* p_boundary,
|
LegoPathBoundary* p_boundary,
|
||||||
@@ -291,11 +291,90 @@ MxU32 LegoCarRaceActor::VTable0x6c(
|
|||||||
Vector3& p_v3
|
Vector3& p_v3
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// LegoAnimPresenterSet& presenters = p_boundary->GetPresenters();
|
// STRING: LEGO1 0x100f7af4
|
||||||
|
const char* str_rcdor = "rcdor";
|
||||||
|
|
||||||
// Significant overlap with parent function -> Try to copy-paste LegoPathActor::VTable0x6c here
|
LegoAnimPresenterSet& presenters = p_boundary->GetPresenters();
|
||||||
// and see by how much we diverge
|
|
||||||
|
for (LegoAnimPresenterSet::iterator itap = presenters.begin(); itap != presenters.end(); itap++) {
|
||||||
|
if ((*itap)->VTable0x94(p_v1, p_v2, p_f1, p_f2, p_v3)) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LegoPathActorSet& plpas = p_boundary->GetActors();
|
||||||
|
LegoPathActorSet lpas(plpas);
|
||||||
|
|
||||||
|
for (LegoPathActorSet::iterator itpa = lpas.begin(); itpa != lpas.end(); itpa++) {
|
||||||
|
if (plpas.end() != plpas.find(*itpa)) {
|
||||||
|
LegoPathActor* actor = *itpa;
|
||||||
|
|
||||||
|
if (actor != this) {
|
||||||
|
LegoROI* roi = actor->GetROI();
|
||||||
|
|
||||||
|
if (roi != NULL && (roi->GetVisibility() || actor->GetCameraFlag())) {
|
||||||
|
if (strncmp(roi->GetName(), str_rcdor, 5) == 0) {
|
||||||
|
const CompoundObject* co = roi->GetComp(); // name verified by BETA10 0x100cf8ba
|
||||||
|
|
||||||
|
if (co) {
|
||||||
|
assert(co->size() == 2);
|
||||||
|
|
||||||
|
LegoROI* firstROI = (LegoROI*) co->front();
|
||||||
|
|
||||||
|
if (firstROI->FUN_100a9410(
|
||||||
|
p_v1,
|
||||||
|
p_v2,
|
||||||
|
p_f1,
|
||||||
|
p_f2,
|
||||||
|
p_v3,
|
||||||
|
m_collideBox && actor->GetCollideBox()
|
||||||
|
)) {
|
||||||
|
VTable0x94(actor, TRUE);
|
||||||
|
|
||||||
|
if (actor->VTable0x94(this, FALSE) < 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LegoROI* lastROI = (LegoROI*) co->back();
|
||||||
|
|
||||||
|
if (lastROI->FUN_100a9410(
|
||||||
|
p_v1,
|
||||||
|
p_v2,
|
||||||
|
p_f1,
|
||||||
|
p_f2,
|
||||||
|
p_v3,
|
||||||
|
m_collideBox && actor->GetCollideBox()
|
||||||
|
)) {
|
||||||
|
VTable0x94(actor, TRUE);
|
||||||
|
|
||||||
|
if (actor->VTable0x94(this, FALSE) < 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (roi->FUN_100a9410(p_v1, p_v2, p_f1, p_f2, p_v3, m_collideBox && actor->GetCollideBox())) {
|
||||||
|
VTable0x94(actor, TRUE);
|
||||||
|
if (actor->VTable0x94(this, FALSE) < 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// TODO
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -110,6 +110,8 @@ public:
|
|||||||
return (*lods)[i];
|
return (*lods)[i];
|
||||||
}
|
}
|
||||||
int GetLODCount() const { return lods ? lods->Size() : 0; }
|
int GetLODCount() const { return lods ? lods->Size() : 0; }
|
||||||
|
|
||||||
|
// FUNCTION: BETA10 0x10027110
|
||||||
const CompoundObject* GetComp() const { return comp; }
|
const CompoundObject* GetComp() const { return comp; }
|
||||||
|
|
||||||
unsigned char GetVisibility() { return m_visible; }
|
unsigned char GetVisibility() { return m_visible; }
|
||||||
|
|||||||
Reference in New Issue
Block a user