mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-26 09:54:18 +00:00
Clear unknowns in LegoCarBuildAnimPresenter (#1683)
This commit is contained in:
@@ -855,8 +855,8 @@ undefined4 LegoCarBuild::SelectPartFromMousePosition(MxLong p_x, MxLong p_y)
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (m_animPresenter->FUN_10079c30(m_selectedPart->GetName())) {
|
||||
m_unk0x114 = m_animPresenter->FUN_10079e20();
|
||||
if (m_animPresenter->IsNextPartToPlace(m_selectedPart->GetName())) {
|
||||
m_unk0x114 = m_animPresenter->GetTargetBoundingSphere();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -902,7 +902,7 @@ undefined4 LegoCarBuild::FUN_100246e0(MxLong p_x, MxLong p_y)
|
||||
m_PlaceBrick_Sound->Enable(TRUE);
|
||||
m_animPresenter->SetShelfState(LegoCarBuildAnimPresenter::e_stopped);
|
||||
}
|
||||
else if (m_animPresenter->FUN_10079c30(m_selectedPart->GetName())) {
|
||||
else if (m_animPresenter->IsNextPartToPlace(m_selectedPart->GetName())) {
|
||||
if (SpheresIntersect(m_unk0x114, m_selectedPart->GetWorldBoundingSphere())) {
|
||||
m_PlaceBrick_Sound->Enable(FALSE);
|
||||
m_PlaceBrick_Sound->Enable(TRUE);
|
||||
@@ -1418,7 +1418,7 @@ void LegoCarBuild::FUN_10025450()
|
||||
else {
|
||||
const LegoChar* wiredName;
|
||||
|
||||
if (!m_animPresenter->FUN_10079c30(m_selectedPart->GetName())) {
|
||||
if (!m_animPresenter->IsNextPartToPlace(m_selectedPart->GetName())) {
|
||||
wiredName = m_animPresenter->GetWiredNameByPartName(m_selectedPart->GetName());
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include "mxtimer.h"
|
||||
#include "realtime/realtime.h"
|
||||
|
||||
DECOMP_SIZE_ASSERT(LegoCarBuildAnimPresenter::UnknownListEntry, 0x0c)
|
||||
DECOMP_SIZE_ASSERT(LegoCarBuildAnimPresenter::CarBuildPart, 0x0c)
|
||||
DECOMP_SIZE_ASSERT(LegoCarBuildAnimPresenter, 0x150)
|
||||
|
||||
// FUNCTION: LEGO1 0x10078400
|
||||
@@ -32,7 +32,7 @@ LegoCarBuildAnimPresenter::LegoCarBuildAnimPresenter()
|
||||
m_shelfFrameBuffer = 0;
|
||||
m_shelfFrameMax = 0;
|
||||
m_shelfFrameInterval = 0;
|
||||
m_unk0x13c = 0;
|
||||
m_flashingPartTimeState = 0;
|
||||
m_carBuildEntity = NULL;
|
||||
m_unk0x144 = -1;
|
||||
m_unk0x148 = -1;
|
||||
@@ -60,28 +60,28 @@ LegoCarBuildAnimPresenter::~LegoCarBuildAnimPresenter()
|
||||
}
|
||||
|
||||
// FUNCTION: BETA10 0x100733d0
|
||||
inline void LegoCarBuildAnimPresenter::Beta10Inline0x100733d0()
|
||||
inline void LegoCarBuildAnimPresenter::UpdateFlashingPartVisibility()
|
||||
{
|
||||
MxLong time = Timer()->GetTime();
|
||||
MxLong bvar5;
|
||||
MxLong showFlashingPart;
|
||||
|
||||
if (m_unk0x13c < time) {
|
||||
bvar5 = FALSE;
|
||||
if (m_flashingPartTimeState < time) {
|
||||
showFlashingPart = FALSE;
|
||||
|
||||
// I have no idea why this conditional is so convoluted
|
||||
if (m_unk0x13c & c_bit1) {
|
||||
bvar5 = TRUE;
|
||||
m_unk0x13c = time + 400;
|
||||
if (m_flashingPartTimeState & c_bit1) {
|
||||
showFlashingPart = TRUE;
|
||||
m_flashingPartTimeState = time + 400;
|
||||
}
|
||||
else {
|
||||
m_unk0x13c = time + 200;
|
||||
m_flashingPartTimeState = time + 200;
|
||||
}
|
||||
|
||||
if (bvar5) {
|
||||
m_unk0x13c &= ~c_bit1;
|
||||
if (showFlashingPart) {
|
||||
m_flashingPartTimeState &= ~c_bit1;
|
||||
}
|
||||
else {
|
||||
m_unk0x13c |= c_bit1;
|
||||
m_flashingPartTimeState |= c_bit1;
|
||||
}
|
||||
|
||||
if (m_placedPartCount < m_numberOfParts) {
|
||||
@@ -96,7 +96,7 @@ inline void LegoCarBuildAnimPresenter::Beta10Inline0x100733d0()
|
||||
const LegoChar* name = roi->GetName();
|
||||
|
||||
if (name && stricmp(wiredName, name) == 0) {
|
||||
if (bvar5) {
|
||||
if (showFlashingPart) {
|
||||
roi->SetVisibility(TRUE);
|
||||
}
|
||||
else {
|
||||
@@ -127,7 +127,7 @@ void LegoCarBuildAnimPresenter::PutFrame()
|
||||
break;
|
||||
}
|
||||
|
||||
Beta10Inline0x100733d0();
|
||||
UpdateFlashingPartVisibility();
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100788c0
|
||||
@@ -209,7 +209,7 @@ void LegoCarBuildAnimPresenter::StreamingTickle()
|
||||
}
|
||||
|
||||
if (i < m_placedPartCount) {
|
||||
FUN_10079050(i);
|
||||
MakePartPlaced(i);
|
||||
ShowBuildPartByName(m_parts[i].m_name);
|
||||
}
|
||||
|
||||
@@ -316,7 +316,7 @@ MxResult LegoCarBuildAnimPresenter::Serialize(LegoStorage* p_storage)
|
||||
|
||||
// FUNCTION: LEGO1 0x10079050
|
||||
// FUNCTION: BETA10 0x1007151e
|
||||
void LegoCarBuildAnimPresenter::FUN_10079050(MxS16 p_index)
|
||||
void LegoCarBuildAnimPresenter::MakePartPlaced(MxS16 p_index)
|
||||
{
|
||||
SwapNodesByName(m_parts[p_index].m_wiredName, m_parts[p_index].m_name);
|
||||
HideBuildPartByName(m_parts[p_index].m_wiredName);
|
||||
@@ -382,7 +382,7 @@ void LegoCarBuildAnimPresenter::InitBuildPlatform()
|
||||
}
|
||||
|
||||
assert(m_numberOfParts);
|
||||
m_parts = new UnknownListEntry[m_numberOfParts];
|
||||
m_parts = new CarBuildPart[m_numberOfParts];
|
||||
assert(m_parts);
|
||||
|
||||
// Go through and add the wired name of each part
|
||||
@@ -551,7 +551,7 @@ void LegoCarBuildAnimPresenter::AddPartToBuildByName(const LegoChar* p_name)
|
||||
strcpy(m_parts[i].m_name, buffer);
|
||||
Swap(m_parts[m_placedPartCount].m_objectId, m_parts[i].m_objectId);
|
||||
}
|
||||
FUN_10079050(m_placedPartCount);
|
||||
MakePartPlaced(m_placedPartCount);
|
||||
m_placedPartCount++;
|
||||
|
||||
((LegoCarBuild*) m_currentWorld)->SetPlacedPartCount(m_placedPartCount);
|
||||
@@ -644,7 +644,7 @@ MxBool LegoCarBuildAnimPresenter::StringEqualsShelf(const LegoChar* p_string)
|
||||
|
||||
// FUNCTION: LEGO1 0x10079c30
|
||||
// FUNCTION: BETA10 0x100726a6
|
||||
MxBool LegoCarBuildAnimPresenter::FUN_10079c30(const LegoChar* p_name)
|
||||
MxBool LegoCarBuildAnimPresenter::IsNextPartToPlace(const LegoChar* p_name)
|
||||
{
|
||||
if (PartIsPlaced(p_name)) {
|
||||
return FALSE;
|
||||
@@ -708,7 +708,7 @@ void LegoCarBuildAnimPresenter::SetPartObjectIdByName(const LegoChar* p_name, Mx
|
||||
|
||||
// FUNCTION: LEGO1 0x10079e20
|
||||
// FUNCTION: BETA10 0x10072959
|
||||
const BoundingSphere& LegoCarBuildAnimPresenter::FUN_10079e20()
|
||||
const BoundingSphere& LegoCarBuildAnimPresenter::GetTargetBoundingSphere()
|
||||
{
|
||||
LegoROI* roi = m_carBuildEntity->GetROI();
|
||||
return roi->FindChildROI(m_parts[m_placedPartCount].m_wiredName, roi)->GetWorldBoundingSphere();
|
||||
|
||||
Reference in New Issue
Block a user