diff --git a/CONFIG/MainDlg.cpp b/CONFIG/MainDlg.cpp index 84083892..58560301 100644 --- a/CONFIG/MainDlg.cpp +++ b/CONFIG/MainDlg.cpp @@ -177,7 +177,7 @@ void CMainDialog::UpdateInterface() CheckDlgButton(IDC_CHK_FLIP_VIDEO_MEM_PAGES, currentConfigApp->m_flip_surfaces); CheckDlgButton(IDC_CHK_3D_VIDEO_MEMORY, currentConfigApp->m_3d_video_ram); BOOL full_screen = currentConfigApp->m_full_screen; - currentConfigApp->FUN_00403810(); + currentConfigApp->AdjustDisplayBitDepthBasedOnRenderStatus(); if (currentConfigApp->GetHardwareDeviceColorModel()) { CheckDlgButton(IDC_CHK_DRAW_CURSOR, TRUE); } @@ -198,8 +198,9 @@ void CMainDialog::UpdateInterface() CheckDlgButton(IDC_RAD_PALETTE_16BIT, 0); currentConfigApp->m_display_bit_depth = 0; } - GetDlgItem(IDC_RAD_PALETTE_256)->EnableWindow(full_screen && currentConfigApp->FUN_004037a0()); - GetDlgItem(IDC_RAD_PALETTE_16BIT)->EnableWindow(full_screen && currentConfigApp->FUN_004037e0()); + GetDlgItem(IDC_RAD_PALETTE_256) + ->EnableWindow(full_screen && currentConfigApp->GetConditionalDeviceRenderBitDepth()); + GetDlgItem(IDC_RAD_PALETTE_16BIT)->EnableWindow(full_screen && currentConfigApp->GetDeviceRenderBitStatus()); CheckDlgButton(IDC_CHK_3DSOUND, currentConfigApp->m_3d_sound); CheckDlgButton(IDC_CHK_DRAW_CURSOR, currentConfigApp->m_draw_cursor); switch (currentConfigApp->m_model_quality) { diff --git a/CONFIG/config.cpp b/CONFIG/config.cpp index 78c6b6c2..4e1a2264 100644 --- a/CONFIG/config.cpp +++ b/CONFIG/config.cpp @@ -198,7 +198,7 @@ BOOL CConfigApp::ReadRegInt(LPCSTR p_key, int* p_value) const } // FUNCTION: CONFIG 0x004033d0 -BOOL CConfigApp::FUN_004033d0() const +BOOL CConfigApp::IsDeviceInBasicRGBMode() const { /* * BUG: should be: @@ -286,7 +286,7 @@ BOOL CConfigApp::ValidateSettings() m_full_screen = TRUE; is_modified = TRUE; } - if (FUN_004033d0()) { + if (IsDeviceInBasicRGBMode()) { if (m_3d_video_ram) { m_3d_video_ram = FALSE; is_modified = TRUE; @@ -340,9 +340,9 @@ BOOL CConfigApp::ValidateSettings() } // FUNCTION: CONFIG 0x004037a0 -DWORD CConfigApp::FUN_004037a0() const +DWORD CConfigApp::GetConditionalDeviceRenderBitDepth() const { - if (FUN_004033d0()) { + if (IsDeviceInBasicRGBMode()) { return 0; } if (GetHardwareDeviceColorModel()) { @@ -352,7 +352,7 @@ DWORD CConfigApp::FUN_004037a0() const } // FUNCTION: CONFIG 0x004037e0 -DWORD CConfigApp::FUN_004037e0() const +DWORD CConfigApp::GetDeviceRenderBitStatus() const { if (GetHardwareDeviceColorModel()) { return m_device->m_HWDesc.dwDeviceRenderBitDepth & 0x400; @@ -363,23 +363,23 @@ DWORD CConfigApp::FUN_004037e0() const } // FUNCTION: CONFIG 0x00403810 -BOOL CConfigApp::FUN_00403810() +BOOL CConfigApp::AdjustDisplayBitDepthBasedOnRenderStatus() { if (m_display_bit_depth == 8) { - if (FUN_004037a0()) { + if (GetConditionalDeviceRenderBitDepth()) { return FALSE; } } if (m_display_bit_depth == 16) { - if (FUN_004037e0()) { + if (GetDeviceRenderBitStatus()) { return FALSE; } } - if (FUN_004037a0()) { + if (GetConditionalDeviceRenderBitDepth()) { m_display_bit_depth = 8; return TRUE; } - if (FUN_004037e0()) { + if (GetDeviceRenderBitStatus()) { m_display_bit_depth = 16; return TRUE; } diff --git a/CONFIG/config.h b/CONFIG/config.h index 75195e7e..63f88eaa 100644 --- a/CONFIG/config.h +++ b/CONFIG/config.h @@ -34,14 +34,14 @@ class CConfigApp : public CWinApp { BOOL ReadReg(LPCSTR p_key, LPCSTR p_value, DWORD p_size) const; BOOL ReadRegBool(LPCSTR p_key, BOOL* p_bool) const; BOOL ReadRegInt(LPCSTR p_key, int* p_value) const; - BOOL FUN_004033d0() const; + BOOL IsDeviceInBasicRGBMode() const; D3DCOLORMODEL GetHardwareDeviceColorModel() const; BOOL IsPrimaryDriver() const; BOOL ReadRegisterSettings(); BOOL ValidateSettings(); - DWORD FUN_004037a0() const; - DWORD FUN_004037e0() const; - BOOL FUN_00403810(); + DWORD GetConditionalDeviceRenderBitDepth() const; + DWORD GetDeviceRenderBitStatus() const; + BOOL AdjustDisplayBitDepthBasedOnRenderStatus(); void CConfigApp::WriteRegisterSettings() const; //{{AFX_MSG(CConfigApp) diff --git a/LEGO1/lego/legoomni/include/legocachesoundmanager.h b/LEGO1/lego/legoomni/include/legocachesoundmanager.h index 67d139ff..e8dbc204 100644 --- a/LEGO1/lego/legoomni/include/legocachesoundmanager.h +++ b/LEGO1/lego/legoomni/include/legocachesoundmanager.h @@ -54,8 +54,8 @@ class LegoCacheSoundManager { virtual MxResult Tickle(); // vtable+0x00 - LegoCacheSound* FUN_1003d170(const char* p_key); - LegoCacheSound* FUN_1003d290(LegoCacheSound* p_sound); + LegoCacheSound* FindSoundByKey(const char* p_key); + LegoCacheSound* ManageSoundEntry(LegoCacheSound* p_sound); LegoCacheSound* FUN_1003dae0(const char* p_one, const char* p_two, MxBool p_three); LegoCacheSound* FUN_1003db10(LegoCacheSound* p_one, const char* p_two, MxBool p_three); void FUN_1003dc40(LegoCacheSound** p_und); diff --git a/LEGO1/lego/legoomni/include/skateboard.h b/LEGO1/lego/legoomni/include/skateboard.h index 63a2bb87..c42d3fe0 100644 --- a/LEGO1/lego/legoomni/include/skateboard.h +++ b/LEGO1/lego/legoomni/include/skateboard.h @@ -32,13 +32,13 @@ class SkateBoard : public IslePathActor { MxU32 VTable0xd4(LegoControlManagerEvent& p_param) override; // vtable+0xd4 void VTable0xe4() override; // vtable+0xe4 - void FUN_10010510(); + void ActivateSceneActions(); // SYNTHETIC: LEGO1 0x1000ff60 // SkateBoard::`scalar deleting destructor' private: - void FUN_10010270(MxBool p_enable); + void EnableScenePresentation(MxBool p_enable); MxBool m_unk0x160; // 0x160 Act1State* m_act1state; // 0x164 diff --git a/LEGO1/lego/legoomni/src/actors/helicopter.cpp b/LEGO1/lego/legoomni/src/actors/helicopter.cpp index 0bc064b5..f4a92d51 100644 --- a/LEGO1/lego/legoomni/src/actors/helicopter.cpp +++ b/LEGO1/lego/legoomni/src/actors/helicopter.cpp @@ -340,7 +340,7 @@ MxU32 Helicopter::VTable0xd8(LegoEndAnimNotificationParam& p_param) void Helicopter::VTable0x74(Matrix4& p_transform) { if (m_userNavFlag) { - m_roi->FUN_100a46b0(p_transform); + m_roi->UpdateTransformationRelativeToParent(p_transform); FUN_10010c30(); } else { diff --git a/LEGO1/lego/legoomni/src/actors/skateboard.cpp b/LEGO1/lego/legoomni/src/actors/skateboard.cpp index 352e0bba..8b010eb3 100644 --- a/LEGO1/lego/legoomni/src/actors/skateboard.cpp +++ b/LEGO1/lego/legoomni/src/actors/skateboard.cpp @@ -98,7 +98,7 @@ MxU32 SkateBoard::VTable0xcc() ControlManager()->Register(this); } - FUN_10010270(m_unk0x160); + EnableScenePresentation(m_unk0x160); Vector3 position = m_roi->GetWorldPosition(); AnimationManager()->FUN_10064670(&position); @@ -122,7 +122,7 @@ MxU32 SkateBoard::VTable0xd4(LegoControlManagerEvent& p_param) // FUNCTION: LEGO1 0x10010270 // FUNCTION: BETA10 0x100f5366 -void SkateBoard::FUN_10010270(MxBool p_enable) +void SkateBoard::EnableScenePresentation(MxBool p_enable) { m_act1state = (Act1State*) GameState()->GetState("Act1State"); if (!m_act1state) { @@ -142,12 +142,12 @@ void SkateBoard::FUN_10010270(MxBool p_enable) // FUNCTION: BETA10 0x100f5472 MxU32 SkateBoard::VTable0xd0() { - FUN_10010270(m_unk0x160); + EnableScenePresentation(m_unk0x160); return 1; } // FUNCTION: LEGO1 0x10010510 -void SkateBoard::FUN_10010510() +void SkateBoard::ActivateSceneActions() { if (m_act1state->m_unk0x018 != 3) { PlayMusic(JukeboxScript::c_BeachBlvd_Music); diff --git a/LEGO1/lego/legoomni/src/audio/legocachesoundmanager.cpp b/LEGO1/lego/legoomni/src/audio/legocachesoundmanager.cpp index e611484b..8d645dfd 100644 --- a/LEGO1/lego/legoomni/src/audio/legocachesoundmanager.cpp +++ b/LEGO1/lego/legoomni/src/audio/legocachesoundmanager.cpp @@ -61,7 +61,7 @@ MxResult LegoCacheSoundManager::Tickle() } // STUB: LEGO1 0x1003d170 -LegoCacheSound* LegoCacheSoundManager::FUN_1003d170(const char* p_key) +LegoCacheSound* LegoCacheSoundManager::FindSoundByKey(const char* p_key) { // TODO char* x = new char[strlen(p_key) + 1]; @@ -78,7 +78,7 @@ LegoCacheSound* LegoCacheSoundManager::FUN_1003d170(const char* p_key) } // FUNCTION: LEGO1 0x1003d290 -LegoCacheSound* LegoCacheSoundManager::FUN_1003d290(LegoCacheSound* p_sound) +LegoCacheSound* LegoCacheSoundManager::ManageSoundEntry(LegoCacheSound* p_sound) { Set100d6b4c::iterator it = m_set.find(LegoCacheSoundEntry(p_sound)); if (it != m_set.end()) { @@ -107,7 +107,7 @@ LegoCacheSound* LegoCacheSoundManager::FUN_1003d290(LegoCacheSound* p_sound) LegoCacheSound* LegoCacheSoundManager::FUN_1003dae0(const char* p_one, const char* p_two, MxBool p_three) { // DECOMP: Second parameter is LegoRoi::m_name (0xe4) - return FUN_1003db10(FUN_1003d170(p_one), p_two, p_three); + return FUN_1003db10(FindSoundByKey(p_one), p_two, p_three); } // FUNCTION: LEGO1 0x1003db10 @@ -121,7 +121,7 @@ LegoCacheSound* LegoCacheSoundManager::FUN_1003db10(LegoCacheSound* p_one, const LegoCacheSound* result = p_one->FUN_10006960(); if (result) { - LegoCacheSound* t = FUN_1003d290(result); + LegoCacheSound* t = ManageSoundEntry(result); t->FUN_10006a30(p_two, p_three); return t; } diff --git a/LEGO1/lego/legoomni/src/audio/legoloadcachesoundpresenter.cpp b/LEGO1/lego/legoomni/src/audio/legoloadcachesoundpresenter.cpp index 59ca793b..7bf31340 100644 --- a/LEGO1/lego/legoomni/src/audio/legoloadcachesoundpresenter.cpp +++ b/LEGO1/lego/legoomni/src/audio/legoloadcachesoundpresenter.cpp @@ -79,7 +79,7 @@ MxResult LegoLoadCacheSoundPresenter::PutData() m_criticalSection.Enter(); if (m_currentTickleState == e_done) { - m_cacheSound = SoundManager()->GetCacheSoundManager()->FUN_1003d290(m_cacheSound); + m_cacheSound = SoundManager()->GetCacheSoundManager()->ManageSoundEntry(m_cacheSound); m_unk0x7c = 1; } diff --git a/LEGO1/lego/legoomni/src/build/legobuildingmanager.cpp b/LEGO1/lego/legoomni/src/build/legobuildingmanager.cpp index 5d2c1259..3aeef9bb 100644 --- a/LEGO1/lego/legoomni/src/build/legobuildingmanager.cpp +++ b/LEGO1/lego/legoomni/src/build/legobuildingmanager.cpp @@ -298,7 +298,7 @@ void LegoBuildingManager::UpdatePosition(MxS32 p_index, LegoWorld* p_world) AdjustHeight(p_index); MxMatrix mat = roi->GetLocal2World(); mat[3][1] = g_buildingInfo[p_index].m_unk0x014; - roi->FUN_100a46b0(mat); + roi->UpdateTransformationRelativeToParent(mat); VideoManager()->Get3DManager()->Moved(*roi); } } @@ -618,7 +618,7 @@ void LegoBuildingManager::ScheduleAnimation(LegoEntity* p_entity, MxU32 p_length m_world = CurrentWorld(); if (p_haveSound) { - m_sound = SoundManager()->GetCacheSoundManager()->FUN_1003d170("bcrash"); + m_sound = SoundManager()->GetCacheSoundManager()->FindSoundByKey("bcrash"); m_sound->FUN_10006cb0(35, 60); } @@ -674,7 +674,7 @@ void LegoBuildingManager::FUN_10030590() LegoROI* roi = g_buildingInfo[i].m_entity->GetROI(); MxMatrix mat = roi->GetLocal2World(); mat[3][1] = g_buildingInfo[i].m_unk0x014; - roi->FUN_100a46b0(mat); + roi->UpdateTransformationRelativeToParent(mat); VideoManager()->Get3DManager()->Moved(*roi); } } diff --git a/LEGO1/lego/legoomni/src/common/legocharactermanager.cpp b/LEGO1/lego/legoomni/src/common/legocharactermanager.cpp index 891a6471..856ff777 100644 --- a/LEGO1/lego/legoomni/src/common/legocharactermanager.cpp +++ b/LEGO1/lego/legoomni/src/common/legocharactermanager.cpp @@ -609,7 +609,7 @@ MxBool LegoCharacterManager::FUN_100849a0(LegoROI* p_roi, LegoTextureInfo* p_tex lodList = dupLodList; if (head->GetUnknown0xe0() >= 0) { - VideoManager()->Get3DManager()->GetLego3DView()->GetViewManager()->FUN_100a66a0(head); + VideoManager()->Get3DManager()->GetLego3DView()->GetViewManager()->RemoveROIDetailFromScene(head); } head->SetLODList(lodList); @@ -744,7 +744,7 @@ MxBool LegoCharacterManager::SwitchHat(LegoROI* p_roi) lodList = dupLodList; if (childROI->GetUnknown0xe0() >= 0) { - VideoManager()->Get3DManager()->GetLego3DView()->GetViewManager()->FUN_100a66a0(childROI); + VideoManager()->Get3DManager()->GetLego3DView()->GetViewManager()->RemoveROIDetailFromScene(childROI); } childROI->SetLODList(lodList); diff --git a/LEGO1/lego/legoomni/src/entity/legoentity.cpp b/LEGO1/lego/legoomni/src/entity/legoentity.cpp index 192fc804..c4a09084 100644 --- a/LEGO1/lego/legoomni/src/entity/legoentity.cpp +++ b/LEGO1/lego/legoomni/src/entity/legoentity.cpp @@ -130,7 +130,7 @@ void LegoEntity::SetROI(LegoROI* p_roi, MxBool p_bool1, MxBool p_bool2) mat ); - m_roi->FUN_100a46b0(mat); + m_roi->UpdateTransformationRelativeToParent(mat); } m_roi->SetEntity(this); @@ -170,7 +170,7 @@ void LegoEntity::SetLocation(const Vector3& p_location, const Vector3& p_directi mat ); - m_roi->FUN_100a46b0(mat); + m_roi->UpdateTransformationRelativeToParent(mat); VideoManager()->Get3DManager()->GetLego3DView()->Moved(*m_roi); if (p_und) { diff --git a/LEGO1/lego/legoomni/src/paths/legopathactor.cpp b/LEGO1/lego/legoomni/src/paths/legopathactor.cpp index a893ba53..f332a51e 100644 --- a/LEGO1/lego/legoomni/src/paths/legopathactor.cpp +++ b/LEGO1/lego/legoomni/src/paths/legopathactor.cpp @@ -135,7 +135,7 @@ MxResult LegoPathActor::VTable0x88( } right.EqualsCross(&up, &dir); - m_roi->FUN_100a46b0(matrix); + m_roi->UpdateTransformationRelativeToParent(matrix); if (!m_cameraFlag || !m_userNavFlag) { p5.EqualsCross(p_boundary->GetUnknown0x14(), &p3); @@ -201,7 +201,7 @@ MxResult LegoPathActor::VTable0x84( } right.EqualsCross(&up, &dir); - m_roi->FUN_100a46b0(matrix); + m_roi->UpdateTransformationRelativeToParent(matrix); if (!m_cameraFlag || !m_userNavFlag) { p5.EqualsCross(p_boundary->GetUnknown0x14(), &p3); diff --git a/LEGO1/lego/legoomni/src/video/legomodelpresenter.cpp b/LEGO1/lego/legoomni/src/video/legomodelpresenter.cpp index 79c481c4..7395ccfc 100644 --- a/LEGO1/lego/legoomni/src/video/legomodelpresenter.cpp +++ b/LEGO1/lego/legoomni/src/video/legomodelpresenter.cpp @@ -180,7 +180,7 @@ MxResult LegoModelPresenter::CreateROI(MxDSChunk* p_chunk) Mx3DPointFloat(m_action->GetUp().GetX(), m_action->GetUp().GetY(), m_action->GetUp().GetZ()), mat ); - m_roi->FUN_100a46b0(mat); + m_roi->UpdateTransformationRelativeToParent(mat); result = SUCCESS; diff --git a/LEGO1/lego/legoomni/src/worlds/isle.cpp b/LEGO1/lego/legoomni/src/worlds/isle.cpp index 555d8317..41e1a61c 100644 --- a/LEGO1/lego/legoomni/src/worlds/isle.cpp +++ b/LEGO1/lego/legoomni/src/worlds/isle.cpp @@ -940,7 +940,7 @@ MxLong Isle::HandleTransitionEnd() FUN_10032d30(IsleScript::c_SkatePizza_Bitmap, JukeboxScript::c_MusicTheme1, NULL, TRUE); if (!m_act1state->m_unk0x01f) { - m_skateboard->FUN_10010510(); + m_skateboard->ActivateSceneActions(); } break; case LegoGameState::e_ambulance: diff --git a/LEGO1/omni/include/mxregioncursor.h b/LEGO1/omni/include/mxregioncursor.h index e114c7ed..692ccce9 100644 --- a/LEGO1/omni/include/mxregioncursor.h +++ b/LEGO1/omni/include/mxregioncursor.h @@ -28,10 +28,10 @@ class MxRegionCursor : public MxCore { virtual void Reset(); // vtable+0x3c private: - void FUN_100c46c0(MxRegionLeftRightList& p_leftRightList); + void ResetAndInitializeCursor(MxRegionLeftRightList& p_leftRightList); void UpdateRect(MxS32 p_left, MxS32 p_top, MxS32 p_right, MxS32 p_bottom); - void FUN_100c4a20(MxRect32& p_rect); - void FUN_100c4b50(MxRect32& p_rect); + void ProcessRectOverlapAscending(MxRect32& p_rect); + void ProcessOverlapWithRect(MxRect32& p_rect); MxRegion* m_region; // 0x08 MxRect32* m_rect; // 0x0c diff --git a/LEGO1/omni/include/mxregionlist.h b/LEGO1/omni/include/mxregionlist.h index b7eff3ae..0fe2dc56 100644 --- a/LEGO1/omni/include/mxregionlist.h +++ b/LEGO1/omni/include/mxregionlist.h @@ -64,8 +64,8 @@ struct MxRegionTopBottom { ~MxRegionTopBottom() { delete m_leftRightList; } MxRegionTopBottom* Clone(); - void FUN_100c5280(MxS32 p_left, MxS32 p_right); - MxBool FUN_100c57b0(MxRect32& p_rect); + void MergeOrExpandRegions(MxS32 p_left, MxS32 p_right); + MxBool CheckHorizontalOverlap(MxRect32& p_rect); inline MxS32 GetTop() { return m_top; } inline MxS32 GetBottom() { return m_bottom; } diff --git a/LEGO1/omni/src/video/mxregion.cpp b/LEGO1/omni/src/video/mxregion.cpp index ca3698e9..f499d54e 100644 --- a/LEGO1/omni/src/video/mxregion.cpp +++ b/LEGO1/omni/src/video/mxregion.cpp @@ -67,12 +67,12 @@ void MxRegion::VTable0x18(MxRect32& p_rect) MxRegionTopBottom* newTopBottom = topBottom->Clone(); newTopBottom->SetBottom(rect.GetBottom()); topBottom->SetTop(rect.GetBottom()); - newTopBottom->FUN_100c5280(rect.GetLeft(), rect.GetRight()); + newTopBottom->MergeOrExpandRegions(rect.GetLeft(), rect.GetRight()); cursor.Prepend(newTopBottom); rect.SetTop(rect.GetBottom()); } else { - topBottom->FUN_100c5280(rect.GetLeft(), rect.GetRight()); + topBottom->MergeOrExpandRegions(rect.GetLeft(), rect.GetRight()); rect.SetTop(topBottom->GetBottom()); } } @@ -100,7 +100,7 @@ MxBool MxRegion::VTable0x1c(MxRect32& p_rect) if (topBottom->GetTop() >= p_rect.GetBottom()) { return FALSE; } - if (topBottom->GetBottom() > p_rect.GetTop() && topBottom->FUN_100c57b0(p_rect)) { + if (topBottom->GetBottom() > p_rect.GetTop() && topBottom->CheckHorizontalOverlap(p_rect)) { return TRUE; } } @@ -128,7 +128,7 @@ MxRegionTopBottom::MxRegionTopBottom(MxRect32& p_rect) } // FUNCTION: LEGO1 0x100c5280 -void MxRegionTopBottom::FUN_100c5280(MxS32 p_left, MxS32 p_right) +void MxRegionTopBottom::MergeOrExpandRegions(MxS32 p_left, MxS32 p_right) { MxRegionLeftRightListCursor a(m_leftRightList); MxRegionLeftRightListCursor b(m_leftRightList); @@ -190,7 +190,7 @@ MxRegionTopBottom* MxRegionTopBottom::Clone() } // FUNCTION: LEGO1 0x100c57b0 -MxBool MxRegionTopBottom::FUN_100c57b0(MxRect32& p_rect) +MxBool MxRegionTopBottom::CheckHorizontalOverlap(MxRect32& p_rect) { MxRegionLeftRightListCursor cursor(m_leftRightList); MxRegionLeftRight* leftRight; diff --git a/LEGO1/omni/src/video/mxregioncursor.cpp b/LEGO1/omni/src/video/mxregioncursor.cpp index 6b74ee3f..7fd4ddc8 100644 --- a/LEGO1/omni/src/video/mxregioncursor.cpp +++ b/LEGO1/omni/src/video/mxregioncursor.cpp @@ -34,7 +34,7 @@ MxRect32* MxRegionCursor::VTable0x18() MxRegionTopBottom* topBottom; if (m_topBottomCursor->Current(topBottom)) { - FUN_100c46c0(*topBottom->m_leftRightList); + ResetAndInitializeCursor(*topBottom->m_leftRightList); MxRegionLeftRight* leftRight; m_leftRightCursor->First(leftRight); @@ -55,7 +55,7 @@ MxRect32* MxRegionCursor::VTable0x20() MxRegionTopBottom* topBottom; if (m_topBottomCursor->Current(topBottom)) { - FUN_100c46c0(*topBottom->m_leftRightList); + ResetAndInitializeCursor(*topBottom->m_leftRightList); MxRegionLeftRight* leftRight; m_leftRightCursor->Last(leftRight); @@ -83,7 +83,7 @@ MxRect32* MxRegionCursor::VTable0x28() } if (m_topBottomCursor->Next(topBottom)) { - FUN_100c46c0(*topBottom->m_leftRightList); + ResetAndInitializeCursor(*topBottom->m_leftRightList); m_leftRightCursor->First(leftRight); UpdateRect(leftRight->GetLeft(), topBottom->GetTop(), leftRight->GetRight(), topBottom->GetBottom()); @@ -108,7 +108,7 @@ MxRect32* MxRegionCursor::VTable0x30() } if (m_topBottomCursor->Prev(topBottom)) { - FUN_100c46c0(*topBottom->m_leftRightList); + ResetAndInitializeCursor(*topBottom->m_leftRightList); m_leftRightCursor->Last(leftRight); UpdateRect(leftRight->GetLeft(), topBottom->GetTop(), leftRight->GetRight(), topBottom->GetBottom()); @@ -123,7 +123,7 @@ MxRect32* MxRegionCursor::VTable0x30() MxRect32* MxRegionCursor::VTable0x14(MxRect32& p_rect) { m_topBottomCursor->Reset(); - FUN_100c4a20(p_rect); + ProcessRectOverlapAscending(p_rect); return m_rect; } @@ -131,7 +131,7 @@ MxRect32* MxRegionCursor::VTable0x14(MxRect32& p_rect) MxRect32* MxRegionCursor::VTable0x1c(MxRect32& p_rect) { m_topBottomCursor->Reset(); - FUN_100c4b50(p_rect); + ProcessOverlapWithRect(p_rect); return m_rect; } @@ -150,11 +150,11 @@ MxRect32* MxRegionCursor::VTable0x24(MxRect32& p_rect) m_rect->Intersect(p_rect); } else { - FUN_100c4a20(p_rect); + ProcessRectOverlapAscending(p_rect); } } else { - FUN_100c4a20(p_rect); + ProcessRectOverlapAscending(p_rect); } return m_rect; @@ -175,11 +175,11 @@ MxRect32* MxRegionCursor::VTable0x2c(MxRect32& p_rect) m_rect->Intersect(p_rect); } else { - FUN_100c4b50(p_rect); + ProcessOverlapWithRect(p_rect); } } else { - FUN_100c4b50(p_rect); + ProcessOverlapWithRect(p_rect); } return m_rect; @@ -202,7 +202,7 @@ void MxRegionCursor::Reset() } // FUNCTION: LEGO1 0x100c46c0 -void MxRegionCursor::FUN_100c46c0(MxRegionLeftRightList& p_leftRightList) +void MxRegionCursor::ResetAndInitializeCursor(MxRegionLeftRightList& p_leftRightList) { if (m_leftRightCursor) { delete m_leftRightCursor; @@ -225,7 +225,7 @@ void MxRegionCursor::UpdateRect(MxS32 p_left, MxS32 p_top, MxS32 p_right, MxS32 } // FUNCTION: LEGO1 0x100c4a20 -void MxRegionCursor::FUN_100c4a20(MxRect32& p_rect) +void MxRegionCursor::ProcessRectOverlapAscending(MxRect32& p_rect) { MxRegionTopBottom* topBottom; while (m_topBottomCursor->Next(topBottom)) { @@ -235,7 +235,7 @@ void MxRegionCursor::FUN_100c4a20(MxRect32& p_rect) } if (p_rect.GetTop() < topBottom->GetBottom()) { - FUN_100c46c0(*topBottom->m_leftRightList); + ResetAndInitializeCursor(*topBottom->m_leftRightList); MxRegionLeftRight* leftRight; while (m_leftRightCursor->Next(leftRight)) { @@ -261,7 +261,7 @@ void MxRegionCursor::FUN_100c4a20(MxRect32& p_rect) } // FUNCTION: LEGO1 0x100c4b50 -void MxRegionCursor::FUN_100c4b50(MxRect32& p_rect) +void MxRegionCursor::ProcessOverlapWithRect(MxRect32& p_rect) { MxRegionTopBottom* topBottom; while (m_topBottomCursor->Prev(topBottom)) { @@ -271,7 +271,7 @@ void MxRegionCursor::FUN_100c4b50(MxRect32& p_rect) } if (topBottom->GetTop() < p_rect.GetBottom()) { - FUN_100c46c0(*topBottom->m_leftRightList); + ResetAndInitializeCursor(*topBottom->m_leftRightList); MxRegionLeftRight* leftRight; while (m_leftRightCursor->Prev(leftRight)) { diff --git a/LEGO1/realtime/orientableroi.cpp b/LEGO1/realtime/orientableroi.cpp index 2d86ab5d..21a6b75a 100644 --- a/LEGO1/realtime/orientableroi.cpp +++ b/LEGO1/realtime/orientableroi.cpp @@ -28,7 +28,7 @@ void OrientableROI::WrappedSetLocalTransform(const Matrix4& p_transform) } // FUNCTION: LEGO1 0x100a46b0 -void OrientableROI::FUN_100a46b0(const Matrix4& p_transform) +void OrientableROI::UpdateTransformationRelativeToParent(const Matrix4& p_transform) { MxMatrix mat; diff --git a/LEGO1/realtime/orientableroi.h b/LEGO1/realtime/orientableroi.h index d7b9f998..b707bbe3 100644 --- a/LEGO1/realtime/orientableroi.h +++ b/LEGO1/realtime/orientableroi.h @@ -33,7 +33,7 @@ class OrientableROI : public ROI { virtual void UpdateWorldVelocity(); // vtable+0x2c void WrappedSetLocalTransform(const Matrix4& p_transform); - void FUN_100a46b0(const Matrix4& p_transform); + void UpdateTransformationRelativeToParent(const Matrix4& p_transform); void WrappedVTable0x24(const Matrix4& p_transform); void GetLocalTransform(Matrix4& p_transform); void FUN_100a58f0(const Matrix4& p_transform); diff --git a/LEGO1/viewmanager/viewmanager.cpp b/LEGO1/viewmanager/viewmanager.cpp index e71e3d2f..fe6c00a6 100644 --- a/LEGO1/viewmanager/viewmanager.cpp +++ b/LEGO1/viewmanager/viewmanager.cpp @@ -97,7 +97,7 @@ void ViewManager::Remove(ViewROI* p_roi) rois.erase(it); if (p_roi->GetUnknown0xe0() >= 0) { - FUN_100a66a0(p_roi); + RemoveROIDetailFromScene(p_roi); } const CompoundObject* comp = p_roi->GetComp(); @@ -105,7 +105,7 @@ void ViewManager::Remove(ViewROI* p_roi) if (comp != NULL) { for (CompoundObject::const_iterator it = comp->begin(); !(it == comp->end()); it++) { if (((ViewROI*) *it)->GetUnknown0xe0() >= 0) { - FUN_100a66a0((ViewROI*) *it); + RemoveROIDetailFromScene((ViewROI*) *it); } } } @@ -127,7 +127,7 @@ void ViewManager::RemoveAll(ViewROI* p_roi) } else { if (p_roi->GetUnknown0xe0() >= 0) { - FUN_100a66a0(p_roi); + RemoveROIDetailFromScene(p_roi); } p_roi->SetUnknown0xe0(-1); @@ -144,7 +144,7 @@ void ViewManager::RemoveAll(ViewROI* p_roi) } // FUNCTION: LEGO1 0x100a65b0 -void ViewManager::FUN_100a65b0(ViewROI* p_roi, int p_und) +void ViewManager::UpdateROIDetailBasedOnLOD(ViewROI* p_roi, int p_und) { if (p_roi->GetLODCount() <= p_und) { p_und = p_roi->GetLODCount() - 1; @@ -197,7 +197,7 @@ void ViewManager::FUN_100a65b0(ViewROI* p_roi, int p_und) } // FUNCTION: LEGO1 0x100a66a0 -void ViewManager::FUN_100a66a0(ViewROI* p_roi) +void ViewManager::RemoveROIDetailFromScene(ViewROI* p_roi) { const ViewLOD* lod = (const ViewLOD*) p_roi->GetLOD(p_roi->GetUnknown0xe0()); @@ -218,10 +218,10 @@ void ViewManager::FUN_100a66a0(ViewROI* p_roi) } // FUNCTION: LEGO1 0x100a66f0 -inline void ViewManager::FUN_100a66f0(ViewROI* p_roi, int p_und) +inline void ViewManager::ManageVisibilityAndDetailRecursively(ViewROI* p_roi, int p_und) { if (!p_roi->GetVisibility() && p_und != -2) { - FUN_100a66f0(p_roi, -2); + ManageVisibilityAndDetailRecursively(p_roi, -2); } else { const CompoundObject* comp = p_roi->GetComp(); @@ -235,7 +235,7 @@ inline void ViewManager::FUN_100a66f0(ViewROI* p_roi, int p_und) return; } - FUN_100a66f0(p_roi, -2); + ManageVisibilityAndDetailRecursively(p_roi, -2); return; } @@ -245,19 +245,19 @@ inline void ViewManager::FUN_100a66f0(ViewROI* p_roi, int p_und) if (p_und == -2) { if (p_roi->GetUnknown0xe0() >= 0) { - FUN_100a66a0(p_roi); + RemoveROIDetailFromScene(p_roi); p_roi->SetUnknown0xe0(-2); } if (comp != NULL) { for (CompoundObject::const_iterator it = comp->begin(); !(it == comp->end()); it++) { - FUN_100a66f0((ViewROI*) *it, p_und); + ManageVisibilityAndDetailRecursively((ViewROI*) *it, p_und); } } } else if (comp == NULL) { if (p_roi->GetLODs() != NULL && p_roi->GetLODCount() > 0) { - FUN_100a65b0(p_roi, p_und); + UpdateROIDetailBasedOnLOD(p_roi, p_und); return; } } @@ -265,7 +265,7 @@ inline void ViewManager::FUN_100a66f0(ViewROI* p_roi, int p_und) p_roi->SetUnknown0xe0(-1); for (CompoundObject::const_iterator it = comp->begin(); !(it == comp->end()); it++) { - FUN_100a66f0((ViewROI*) *it, p_und); + ManageVisibilityAndDetailRecursively((ViewROI*) *it, p_und); } } } @@ -284,11 +284,11 @@ void ViewManager::Update(float p_previousRenderTime, float) Unknown(); } else if (flags & c_bit2) { - FUN_100a6b90(); + UpdateViewTransformations(); } for (CompoundObject::iterator it = rois.begin(); it != rois.end(); it++) { - FUN_100a66f0((ViewROI*) *it, -1); + ManageVisibilityAndDetailRecursively((ViewROI*) *it, -1); } stopWatch.Stop(); @@ -343,7 +343,7 @@ inline int ViewManager::Unknown() *unk0x90 = fVar3; // clang-format on - FUN_100a6b90(); + UpdateViewTransformations(); return 0; } } @@ -403,7 +403,7 @@ inline int ViewManager::Unknown3(ViewROI* p_roi) } // FUNCTION: LEGO1 0x100a6b90 -void ViewManager::FUN_100a6b90() +void ViewManager::UpdateViewTransformations() { flags &= ~c_bit2; diff --git a/LEGO1/viewmanager/viewmanager.h b/LEGO1/viewmanager/viewmanager.h index 3f9d1826..860d3b2a 100644 --- a/LEGO1/viewmanager/viewmanager.h +++ b/LEGO1/viewmanager/viewmanager.h @@ -24,17 +24,17 @@ class ViewManager { void Remove(ViewROI* p_roi); void RemoveAll(ViewROI* p_roi); unsigned int FUN_100a6150(const BoundingBox& p_bounding_box); - void FUN_100a65b0(ViewROI* p_roi, int p_und); - void FUN_100a66a0(ViewROI* p_roi); + void UpdateROIDetailBasedOnLOD(ViewROI* p_roi, int p_und); + void RemoveROIDetailFromScene(ViewROI* p_roi); void SetPOVSource(const OrientableROI* point_of_view); float ProjectedSize(const BoundingSphere& p_bounding_sphere); ViewROI* Pick(Tgl::View* p_view, unsigned long x, unsigned long y); void SetResolution(int width, int height); void SetFrustrum(float fov, float front, float back); - inline void FUN_100a66f0(ViewROI* p_roi, int p_und); + inline void ManageVisibilityAndDetailRecursively(ViewROI* p_roi, int p_und); void Update(float p_previousRenderTime, float); inline int Unknown(); - void FUN_100a6b90(); + void UpdateViewTransformations(); inline static int Unknown2(float p_und1, float p_und2, ViewROI* p_roi); inline static int Unknown3(ViewROI* p_roi);