mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-27 10:11:15 +00:00
Change braces
This commit is contained in:
parent
fd24daafd6
commit
c80764e04a
@ -269,8 +269,9 @@ void LegoBuildingManager::FUN_1002fa00()
|
|||||||
else {
|
else {
|
||||||
for (i = 0; i < _countof(g_buildingDataHausName); i++) {
|
for (i = 0; i < _countof(g_buildingDataHausName); i++) {
|
||||||
LegoEntity* entity = (LegoEntity*) world->Find("MxEntity", g_buildingDataHausName[i]);
|
LegoEntity* entity = (LegoEntity*) world->Find("MxEntity", g_buildingDataHausName[i]);
|
||||||
if (entity)
|
if (entity) {
|
||||||
entity->GetROI()->SetVisibility(m_nextVariant == i);
|
entity->GetROI()->SetVisibility(m_nextVariant == i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m_unk0x09 = 0;
|
m_unk0x09 = 0;
|
||||||
@ -304,17 +305,22 @@ MxResult LegoBuildingManager::Write(LegoStorage* p_storage)
|
|||||||
MxResult result = FAILURE;
|
MxResult result = FAILURE;
|
||||||
for (MxS32 i = 0; i < _countof(g_buildingData); i++) {
|
for (MxS32 i = 0; i < _countof(g_buildingData); i++) {
|
||||||
LegoBuildingData* data = &g_buildingData[i];
|
LegoBuildingData* data = &g_buildingData[i];
|
||||||
if (p_storage->Write(&data->m_cycle1, 4) != SUCCESS)
|
if (p_storage->Write(&data->m_cycle1, 4) != SUCCESS) {
|
||||||
goto done;
|
goto done;
|
||||||
if (p_storage->Write(&data->m_cycle2, 4) != SUCCESS)
|
}
|
||||||
|
if (p_storage->Write(&data->m_cycle2, 4) != SUCCESS) {
|
||||||
goto done;
|
goto done;
|
||||||
if (p_storage->Write(&data->m_cycle3, 1) != SUCCESS)
|
}
|
||||||
|
if (p_storage->Write(&data->m_cycle3, 1) != SUCCESS) {
|
||||||
goto done;
|
goto done;
|
||||||
if (p_storage->Write(&data->m_initialUnk0x11, 1) != SUCCESS)
|
}
|
||||||
|
if (p_storage->Write(&data->m_initialUnk0x11, 1) != SUCCESS) {
|
||||||
goto done;
|
goto done;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (p_storage->Write(&m_nextVariant, 1) != SUCCESS)
|
if (p_storage->Write(&m_nextVariant, 1) != SUCCESS) {
|
||||||
goto done;
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
result = SUCCESS;
|
result = SUCCESS;
|
||||||
done:
|
done:
|
||||||
@ -328,23 +334,29 @@ MxResult LegoBuildingManager::Read(LegoStorage* p_storage)
|
|||||||
for (MxS32 i = 0; i < _countof(g_buildingData); i++) {
|
for (MxS32 i = 0; i < _countof(g_buildingData); i++) {
|
||||||
LegoBuildingData* data = &g_buildingData[i];
|
LegoBuildingData* data = &g_buildingData[i];
|
||||||
|
|
||||||
if (p_storage->Read(&data->m_cycle1, 4) != SUCCESS)
|
if (p_storage->Read(&data->m_cycle1, 4) != SUCCESS) {
|
||||||
goto done;
|
goto done;
|
||||||
if (p_storage->Read(&data->m_cycle2, 4) != SUCCESS)
|
}
|
||||||
|
if (p_storage->Read(&data->m_cycle2, 4) != SUCCESS) {
|
||||||
goto done;
|
goto done;
|
||||||
if (p_storage->Read(&data->m_cycle3, 1) != SUCCESS)
|
}
|
||||||
|
if (p_storage->Read(&data->m_cycle3, 1) != SUCCESS) {
|
||||||
goto done;
|
goto done;
|
||||||
if (p_storage->Read(&data->m_unk0x11, 1) != SUCCESS)
|
}
|
||||||
|
if (p_storage->Read(&data->m_unk0x11, 1) != SUCCESS) {
|
||||||
goto done;
|
goto done;
|
||||||
|
}
|
||||||
data->m_initialUnk0x11 = data->m_unk0x11;
|
data->m_initialUnk0x11 = data->m_unk0x11;
|
||||||
AdjustHeight(i);
|
AdjustHeight(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p_storage->Read(&m_nextVariant, 1) != SUCCESS)
|
if (p_storage->Read(&m_nextVariant, 1) != SUCCESS) {
|
||||||
goto done;
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
if (g_buildingManagerConfig <= 1)
|
if (g_buildingManagerConfig <= 1) {
|
||||||
m_nextVariant = 0;
|
m_nextVariant = 0;
|
||||||
|
}
|
||||||
|
|
||||||
result = SUCCESS;
|
result = SUCCESS;
|
||||||
done:
|
done:
|
||||||
@ -368,8 +380,9 @@ void LegoBuildingManager::AdjustHeight(int p_i)
|
|||||||
g_buildingDataTemplate[p_i].m_float - g_buildingDataDownshift[p_i] * g_buildingDataDownshiftScale[p_i];
|
g_buildingDataTemplate[p_i].m_float - g_buildingDataDownshift[p_i] * g_buildingDataDownshiftScale[p_i];
|
||||||
if (g_buildingData[p_i].m_pEntity != NULL) {
|
if (g_buildingData[p_i].m_pEntity != NULL) {
|
||||||
LegoROI* roi = g_buildingData[p_i].m_pEntity->GetROI();
|
LegoROI* roi = g_buildingData[p_i].m_pEntity->GetROI();
|
||||||
if (roi != NULL)
|
if (roi != NULL) {
|
||||||
roi->SetVisibility(FALSE);
|
roi->SetVisibility(FALSE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -382,31 +395,36 @@ LegoBuildingData* LegoBuildingManager::GetData(LegoEntity* p_entity)
|
|||||||
{
|
{
|
||||||
MxS32 i;
|
MxS32 i;
|
||||||
for (i = 0; i < _countof(g_buildingData); i++) {
|
for (i = 0; i < _countof(g_buildingData); i++) {
|
||||||
if (g_buildingData[i].m_pEntity == p_entity)
|
if (g_buildingData[i].m_pEntity == p_entity) {
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (i < _countof(g_buildingData))
|
if (i < _countof(g_buildingData)) {
|
||||||
return &g_buildingData[i];
|
return &g_buildingData[i];
|
||||||
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1002fdb0
|
// FUNCTION: LEGO1 0x1002fdb0
|
||||||
MxBool LegoBuildingManager::IncrementVariant(LegoEntity* p_entity)
|
MxBool LegoBuildingManager::IncrementVariant(LegoEntity* p_entity)
|
||||||
{
|
{
|
||||||
if (g_buildingManagerConfig <= 1)
|
if (g_buildingManagerConfig <= 1) {
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
LegoBuildingData* data = GetData(p_entity);
|
LegoBuildingData* data = GetData(p_entity);
|
||||||
if (data != NULL && (data->m_flags & 1) && data->m_unk0x11 == -1) {
|
if (data != NULL && (data->m_flags & 1) && data->m_unk0x11 == -1) {
|
||||||
LegoROI* roi = p_entity->GetROI();
|
LegoROI* roi = p_entity->GetROI();
|
||||||
if (++m_nextVariant >= _countof(g_buildingDataHausName))
|
if (++m_nextVariant >= _countof(g_buildingDataHausName)) {
|
||||||
m_nextVariant = 0;
|
m_nextVariant = 0;
|
||||||
|
}
|
||||||
|
|
||||||
roi->SetVisibility(FALSE);
|
roi->SetVisibility(FALSE);
|
||||||
data->m_hausName = g_buildingDataHausName[m_nextVariant];
|
data->m_hausName = g_buildingDataHausName[m_nextVariant];
|
||||||
UpdatePosition(12, CurrentWorld());
|
UpdatePosition(12, CurrentWorld());
|
||||||
if (data->m_pEntity != NULL)
|
if (data->m_pEntity != NULL) {
|
||||||
data->m_pEntity->GetROI()->SetVisibility(TRUE);
|
data->m_pEntity->GetROI()->SetVisibility(TRUE);
|
||||||
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -487,8 +505,9 @@ void LegoBuildingManager::SetCustomizeAnimFile(const char* p_value)
|
|||||||
MxBool LegoBuildingManager::FUN_10030000(LegoEntity* p_entity)
|
MxBool LegoBuildingManager::FUN_10030000(LegoEntity* p_entity)
|
||||||
{
|
{
|
||||||
LegoBuildingData* data = GetData(p_entity);
|
LegoBuildingData* data = GetData(p_entity);
|
||||||
if (data == NULL)
|
if (data == NULL) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
return FUN_10030030(data - g_buildingData);
|
return FUN_10030030(data - g_buildingData);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user