From 7eb52b153e8e7a31156604aa95a9cd5b86a51140 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Fri, 20 Dec 2024 16:50:27 +0100 Subject: [PATCH 1/3] Implement GroupImpl::RemoveAll (81.30%) --- LEGO1/tgl/d3drm/group.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/LEGO1/tgl/d3drm/group.cpp b/LEGO1/tgl/d3drm/group.cpp index a9df8fd65d..cb995c4431 100644 --- a/LEGO1/tgl/d3drm/group.cpp +++ b/LEGO1/tgl/d3drm/group.cpp @@ -106,10 +106,24 @@ Result GroupImpl::Remove(const Group* pGroup) return ResultVal(m_data->DeleteVisual(pGroupImpl->m_data)); } -// STUB: LEGO1 0x100a34b0 +// FUNCTION: LEGO1 0x100a34b0 Result GroupImpl::RemoveAll() { - return Error; + IDirect3DRMVisualArray *visuals; + int i; + IDirect3DRMFrame2 *frame = m_data; + Result result = (Result)SUCCEEDED(frame->GetVisuals(&visuals)); + if (result) { + for (i = 0; i < (int)visuals->GetSize(); ) { + IDirect3DRMVisual *visual; + result = (Result)SUCCEEDED(visuals->GetElement(i, &visual)); + frame->DeleteVisual(visual); + i += 1; + visual->Release(); + } + visuals->Release(); + } + return result; } // STUB: LEGO1 0x100a3540 From fcc05618a958b0dc37485339d8d4c3de8730a415 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Fri, 20 Dec 2024 09:44:30 -0700 Subject: [PATCH 2/3] Minor improvement --- LEGO1/tgl/d3drm/group.cpp | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/LEGO1/tgl/d3drm/group.cpp b/LEGO1/tgl/d3drm/group.cpp index cb995c4431..854788b8ba 100644 --- a/LEGO1/tgl/d3drm/group.cpp +++ b/LEGO1/tgl/d3drm/group.cpp @@ -109,20 +109,22 @@ Result GroupImpl::Remove(const Group* pGroup) // FUNCTION: LEGO1 0x100a34b0 Result GroupImpl::RemoveAll() { - IDirect3DRMVisualArray *visuals; - int i; - IDirect3DRMFrame2 *frame = m_data; - Result result = (Result)SUCCEEDED(frame->GetVisuals(&visuals)); - if (result) { - for (i = 0; i < (int)visuals->GetSize(); ) { - IDirect3DRMVisual *visual; - result = (Result)SUCCEEDED(visuals->GetElement(i, &visual)); - frame->DeleteVisual(visual); - i += 1; - visual->Release(); - } - visuals->Release(); - } + IDirect3DRMVisualArray* visuals; + IDirect3DRMFrame2* frame = m_data; + Result result = (Result) SUCCEEDED(frame->GetVisuals(&visuals)); + + if (result == Success) { + for (int i = 0; i < (int) visuals->GetSize(); i++) { + IDirect3DRMVisual* visual; + + result = (Result) SUCCEEDED(visuals->GetElement(i, &visual)); + frame->DeleteVisual(visual); + visual->Release(); + } + + visuals->Release(); + } + return result; } From d25d3bd95cff30f0039874d8ae2633ac69033b84 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Fri, 20 Dec 2024 09:44:45 -0700 Subject: [PATCH 3/3] Add 2 to total function count --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 36a7db9a9b..a946f00531 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -139,7 +139,7 @@ jobs: run: | reccmp-reccmp -S CONFIGPROGRESS.SVG --svg-icon assets/config.png --target CONFIG | tee CONFIGPROGRESS.TXT reccmp-reccmp -S ISLEPROGRESS.SVG --svg-icon assets/isle.png --target ISLE | tee ISLEPROGRESS.TXT - reccmp-reccmp -S LEGO1PROGRESS.SVG -T 4352 --svg-icon assets/lego1.png --target LEGO1 | tee LEGO1PROGRESS.TXT + reccmp-reccmp -S LEGO1PROGRESS.SVG -T 4354 --svg-icon assets/lego1.png --target LEGO1 | tee LEGO1PROGRESS.TXT - name: Compare Accuracy With Current Master shell: bash