From 7b34eea690ec1bc7581a034932e0c95b744fc849 Mon Sep 17 00:00:00 2001 From: Erik Schulze <30333186+estchd@users.noreply.github.com> Date: Mon, 19 May 2025 01:36:25 +0200 Subject: [PATCH 1/4] Use SUCCESS and FAILURE in MxPalette::SetSkyColor (#1506) --- LEGO1/omni/src/video/mxpalette.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LEGO1/omni/src/video/mxpalette.cpp b/LEGO1/omni/src/video/mxpalette.cpp index 7738a198..e93169ee 100644 --- a/LEGO1/omni/src/video/mxpalette.cpp +++ b/LEGO1/omni/src/video/mxpalette.cpp @@ -238,14 +238,14 @@ MxResult MxPalette::SetEntries(LPPALETTEENTRY p_entries) // FUNCTION: BETA10 0x101442aa MxResult MxPalette::SetSkyColor(LPPALETTEENTRY p_skyColor) { - MxResult status = 0; + MxResult status = SUCCESS; if (m_palette != NULL) { m_entries[141].peRed = p_skyColor->peRed; m_entries[141].peGreen = p_skyColor->peGreen; m_entries[141].peBlue = p_skyColor->peBlue; m_skyColor = m_entries[141]; if (m_palette->SetEntries(0, 141, 1, &m_skyColor)) { - status = -1; + status = FAILURE; } } return status; From 6808669da0743d361976d8f2e74b2b864a434392 Mon Sep 17 00:00:00 2001 From: MS Date: Mon, 19 May 2025 00:47:00 -0400 Subject: [PATCH 2/4] Use argument file for reccmp-aggregate samples (#1507) --- .github/workflows/compare.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/compare.yml b/.github/workflows/compare.yml index b4819b72..a0cf4276 100644 --- a/.github/workflows/compare.yml +++ b/.github/workflows/compare.yml @@ -172,9 +172,12 @@ jobs: - name: Aggregate Accuracy shell: bash run: | - reccmp-aggregate --samples $(find build-entropy -type f -name "CONFIGPROGRESS*.json") --output CONFIGPROGRESS-agg.json --html CONFIGPROGRESS-agg.html - reccmp-aggregate --samples $(find build-entropy -type f -name "ISLEPROGRESS*.json") --output ISLEPROGRESS-agg.json --html ISLEPROGRESS-agg.html - reccmp-aggregate --samples $(find build-entropy -type f -name "LEGO1PROGRESS*.json") --output LEGO1PROGRESS-agg.json --html LEGO1PROGRESS-agg.html + find build-entropy -type f -name "CONFIGPROGRESS*.json" > configsamples.txt + find build-entropy -type f -name "ISLEPROGRESS*.json" > islesamples.txt + find build-entropy -type f -name "LEGO1PROGRESS*.json" > lego1samples.txt + reccmp-aggregate --samples @configsamples.txt --output CONFIGPROGRESS-agg.json --html CONFIGPROGRESS-agg.html + reccmp-aggregate --samples @islesamples.txt --output ISLEPROGRESS-agg.json --html ISLEPROGRESS-agg.html + reccmp-aggregate --samples @lego1samples.txt --output LEGO1PROGRESS-agg.json --html LEGO1PROGRESS-agg.html - name: Compare Aggregate Accuracy With Current Master shell: bash From d67318e78b5a2fe382843786abd4cea1280cc55b Mon Sep 17 00:00:00 2001 From: Erik Schulze <30333186+estchd@users.noreply.github.com> Date: Mon, 19 May 2025 21:25:52 +0200 Subject: [PATCH 3/4] propagate name changes from commit fce97ea (#1508) * propagate name changes from commit fce97ea * remove dependency on omni types * rename parameter too --- ISLE/isleapp.cpp | 8 ++++---- ISLE/isleapp.h | 2 +- LEGO1/lego/legoomni/src/video/legovideomanager.cpp | 2 +- LEGO1/viewmanager/viewroi.cpp | 8 ++++---- LEGO1/viewmanager/viewroi.h | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ISLE/isleapp.cpp b/ISLE/isleapp.cpp index 78c3cb12..3f5f485a 100644 --- a/ISLE/isleapp.cpp +++ b/ISLE/isleapp.cpp @@ -87,7 +87,7 @@ IsleApp::IsleApp() m_backBuffersInVram = TRUE; m_using8bit = FALSE; m_using16bit = TRUE; - m_unk0x24 = 0; + m_hasLightSupport = FALSE; m_drawCursor = FALSE; m_use3dSound = TRUE; m_useMusic = TRUE; @@ -209,7 +209,7 @@ void IsleApp::SetupVideoFlags( BOOL backBuffers, BOOL using8bit, BOOL using16bit, - BOOL param_6, + BOOL hasLightSupport, BOOL param_7, BOOL wideViewAngle, char* deviceId @@ -218,7 +218,7 @@ void IsleApp::SetupVideoFlags( m_videoParam.Flags().SetFullScreen(fullScreen); m_videoParam.Flags().SetFlipSurfaces(flipSurfaces); m_videoParam.Flags().SetBackBuffers(!backBuffers); - m_videoParam.Flags().SetLacksLightSupport(!param_6); + m_videoParam.Flags().SetLacksLightSupport(!hasLightSupport); m_videoParam.Flags().SetF1bit7(param_7); m_videoParam.Flags().SetWideViewAngle(wideViewAngle); m_videoParam.Flags().SetF2bit1(1); @@ -550,7 +550,7 @@ MxResult IsleApp::SetupWindow(HINSTANCE hInstance, LPSTR lpCmdLine) m_backBuffersInVram, m_using8bit, m_using16bit, - m_unk0x24, + m_hasLightSupport, FALSE, m_wideViewAngle, m_deviceId diff --git a/ISLE/isleapp.h b/ISLE/isleapp.h index 6a8289ce..0e8ad0e5 100644 --- a/ISLE/isleapp.h +++ b/ISLE/isleapp.h @@ -56,7 +56,7 @@ class IsleApp { BOOL m_backBuffersInVram; // 0x18 BOOL m_using8bit; // 0x1c BOOL m_using16bit; // 0x20 - int m_unk0x24; // 0x24 + BOOL m_hasLightSupport; // 0x24 BOOL m_use3dSound; // 0x28 BOOL m_useMusic; // 0x2c BOOL m_useJoystick; // 0x30 diff --git a/LEGO1/lego/legoomni/src/video/legovideomanager.cpp b/LEGO1/lego/legoomni/src/video/legovideomanager.cpp index bc8fa1cb..82430bcb 100644 --- a/LEGO1/lego/legoomni/src/video/legovideomanager.cpp +++ b/LEGO1/lego/legoomni/src/video/legovideomanager.cpp @@ -132,7 +132,7 @@ MxResult LegoVideoManager::Create(MxVideoParam& p_videoParam, MxU32 p_frequencyM p_videoParam.Flags().SetLacksLightSupport(FALSE); } - ViewROI::SetUnk101013d8(p_videoParam.Flags().GetLacksLightSupport() == FALSE); + ViewROI::SetLightSupport(p_videoParam.Flags().GetLacksLightSupport() == FALSE); if (!m_direct3d->Create( hwnd, diff --git a/LEGO1/viewmanager/viewroi.cpp b/LEGO1/viewmanager/viewroi.cpp index 8d8cbb6b..626fe311 100644 --- a/LEGO1/viewmanager/viewroi.cpp +++ b/LEGO1/viewmanager/viewroi.cpp @@ -7,7 +7,7 @@ DECOMP_SIZE_ASSERT(ViewROI, 0xe4) // GLOBAL: LEGO1 0x101013d8 -undefined g_unk101013d8 = 0; +unsigned char g_lightSupport = FALSE; // FUNCTION: LEGO1 0x100a9eb0 float ViewROI::IntrinsicImportance() const @@ -78,9 +78,9 @@ void ViewROI::VTable0x1c() } // FUNCTION: LEGO1 0x100aa500 -undefined ViewROI::SetUnk101013d8(undefined p_flag) +unsigned char ViewROI::SetLightSupport(unsigned char p_lightSupport) { - undefined oldFlag = g_unk101013d8; - g_unk101013d8 = p_flag; + unsigned char oldFlag = g_lightSupport; + g_lightSupport = p_lightSupport; return oldFlag; } diff --git a/LEGO1/viewmanager/viewroi.h b/LEGO1/viewmanager/viewroi.h index 444e18f0..a6d2da11 100644 --- a/LEGO1/viewmanager/viewroi.h +++ b/LEGO1/viewmanager/viewroi.h @@ -59,7 +59,7 @@ class ViewROI : public OrientableROI { int GetUnknown0xe0() { return m_unk0xe0; } void SetUnknown0xe0(int p_unk0xe0) { m_unk0xe0 = p_unk0xe0; } - static undefined SetUnk101013d8(undefined p_flag); + static unsigned char SetLightSupport(unsigned char p_lightSupport); protected: void UpdateWorldData(const Matrix4& parent2world) override; // vtable+0x28 From 0b9c1756c70d2f30fb5f30b2294f583ff6eb41d2 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Tue, 20 May 2025 02:15:30 +0200 Subject: [PATCH 4/4] Fix inclusion guards of 3 files (#1509) * Fix inclusion guards of 3 files * Apply suggestions from code review Co-authored-by: Christian Semmler --------- Co-authored-by: Christian Semmler --- LEGO1/library_msvc.h | 2 +- LEGO1/library_smack.h | 2 +- LEGO1/tgl/d3drm/impl.h | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/LEGO1/library_msvc.h b/LEGO1/library_msvc.h index 60f5988c..b0542e13 100644 --- a/LEGO1/library_msvc.h +++ b/LEGO1/library_msvc.h @@ -1,4 +1,4 @@ -#ifdef 0 +#if 0 // For LEGO1 symbols only // aka `operator new` diff --git a/LEGO1/library_smack.h b/LEGO1/library_smack.h index 0967aeab..56d00db6 100644 --- a/LEGO1/library_smack.h +++ b/LEGO1/library_smack.h @@ -1,4 +1,4 @@ -#ifdef 0 +#if 0 // LIBRARY: LEGO1 0x100cd782 // LIBRARY: BETA10 0x1015fb82 diff --git a/LEGO1/tgl/d3drm/impl.h b/LEGO1/tgl/d3drm/impl.h index 555d8432..9bf95668 100644 --- a/LEGO1/tgl/d3drm/impl.h +++ b/LEGO1/tgl/d3drm/impl.h @@ -1,3 +1,5 @@ +#ifndef TGL_D3DRM_IMPL_H +#define TGL_D3DRM_IMPL_H #include "compat.h" #include "decomp.h" @@ -819,3 +821,5 @@ inline D3DRMLIGHTTYPE Translate(LightType tglLightType) // IID_IDirect3DRMMeshBuilder } /* namespace TglImpl */ + +#endif