From a055567fa3207f8a8b369797d3d2df9c80894aa6 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Thu, 15 May 2025 06:59:16 +0200 Subject: [PATCH 1/6] Correct CooperativeLevel endum (#1488) --- CONFIG/detectdx5.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONFIG/detectdx5.cpp b/CONFIG/detectdx5.cpp index 063bc94b..8a308a8d 100644 --- a/CONFIG/detectdx5.cpp +++ b/CONFIG/detectdx5.cpp @@ -114,7 +114,7 @@ void DetectDirectX(unsigned int* p_version, BOOL* p_found) surface_desc.dwSize = sizeof(surface_desc); surface_desc.dwFlags = DDSD_CAPS; surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; - if (FAILED(ddraw2->SetCooperativeLevel(NULL, DISCL_BACKGROUND))) { + if (FAILED(ddraw2->SetCooperativeLevel(NULL, DDSCL_NORMAL))) { ddraw2->Release(); FreeLibrary(ddraw_module); *p_version = 0; From f99da0cea72451b9e2eadc3d730ad4f5dddeb7df Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Thu, 15 May 2025 07:02:35 +0200 Subject: [PATCH 2/6] Correct enums in legotextureinfo.cpp (#1489) --- LEGO1/lego/legoomni/src/common/legotextureinfo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LEGO1/lego/legoomni/src/common/legotextureinfo.cpp b/LEGO1/lego/legoomni/src/common/legotextureinfo.cpp index d2546bce..69970b42 100644 --- a/LEGO1/lego/legoomni/src/common/legotextureinfo.cpp +++ b/LEGO1/lego/legoomni/src/common/legotextureinfo.cpp @@ -112,7 +112,7 @@ LegoTextureInfo* LegoTextureInfo::Create(const char* p_name, LegoTexture* p_text entries[i].peBlue = image->GetPaletteEntry(i).GetBlue(); } else { - entries[i].peFlags = 0x80; + entries[i].peFlags = D3DPAL_RESERVED; } } @@ -193,7 +193,7 @@ LegoResult LegoTextureInfo::FUN_10066010(const LegoU8* p_bits) memset(&desc, 0, sizeof(desc)); desc.dwSize = sizeof(desc); - if (m_surface->Lock(NULL, &desc, 0, NULL) == DD_OK) { + if (m_surface->Lock(NULL, &desc, DDLOCK_SURFACEMEMORYPTR, NULL) == DD_OK) { MxU8* surface = (MxU8*) desc.lpSurface; const LegoU8* bits = p_bits; From dabd404111a6fe646c0b75f9fb08c162b6b6c2e2 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Thu, 15 May 2025 07:03:16 +0200 Subject: [PATCH 3/6] Correct enums in mxdirectdraw.cpp (#1490) --- LEGO1/mxdirectx/mxdirectdraw.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/LEGO1/mxdirectx/mxdirectdraw.cpp b/LEGO1/mxdirectx/mxdirectdraw.cpp index 50628293..ebdfafa7 100644 --- a/LEGO1/mxdirectx/mxdirectdraw.cpp +++ b/LEGO1/mxdirectx/mxdirectdraw.cpp @@ -164,19 +164,19 @@ BOOL MxDirectDraw::SetPaletteEntries(const PALETTEENTRY* pPaletteEntries, int pa } for (i = 0; i < 10; i++) { - m_paletteEntries[i].peFlags = 0x80; + m_paletteEntries[i].peFlags = D3DPAL_RESERVED; } for (; i < 142; i++) { - m_paletteEntries[i].peFlags = 0x44; + m_paletteEntries[i].peFlags = D3DPAL_READONLY | PC_NOCOLLAPSE; } for (; i < 246; i++) { - m_paletteEntries[i].peFlags = 0x84; + m_paletteEntries[i].peFlags = D3DPAL_RESERVED | PC_NOCOLLAPSE; } for (; i < 256; i++) { - m_paletteEntries[i].peFlags = 0x80; + m_paletteEntries[i].peFlags = D3DPAL_RESERVED; } if (paletteEntryCount != 0) { @@ -561,10 +561,10 @@ void MxDirectDraw::FUN_1009e020() memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); - result = m_pBackBuffer->Lock(NULL, &ddsd, 1, NULL); + result = m_pBackBuffer->Lock(NULL, &ddsd, DDLOCK_WAIT, NULL); if (result == DDERR_SURFACELOST) { m_pBackBuffer->Restore(); - result = m_pBackBuffer->Lock(NULL, &ddsd, 1, NULL); + result = m_pBackBuffer->Lock(NULL, &ddsd, DDLOCK_WAIT, NULL); } if (result != DD_OK) { From ad5ccd4e8b9a83be3bd30a8da32f330fb1ce8a1d Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Thu, 15 May 2025 07:03:33 +0200 Subject: [PATCH 4/6] Enums in mxtransitionmanager.cpp (#1491) --- LEGO1/lego/legoomni/src/common/mxtransitionmanager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LEGO1/lego/legoomni/src/common/mxtransitionmanager.cpp b/LEGO1/lego/legoomni/src/common/mxtransitionmanager.cpp index aa091160..7a8b4a45 100644 --- a/LEGO1/lego/legoomni/src/common/mxtransitionmanager.cpp +++ b/LEGO1/lego/legoomni/src/common/mxtransitionmanager.cpp @@ -291,10 +291,10 @@ void MxTransitionManager::MosaicTransition() memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); - HRESULT res = m_ddSurface->Lock(NULL, &ddsd, 1, NULL); + HRESULT res = m_ddSurface->Lock(NULL, &ddsd, DDLOCK_WAIT, NULL); if (res == DDERR_SURFACELOST) { m_ddSurface->Restore(); - res = m_ddSurface->Lock(NULL, &ddsd, 1, NULL); + res = m_ddSurface->Lock(NULL, &ddsd, DDLOCK_WAIT, NULL); } if (res == DD_OK) { From d52af9f4e371d3875ffa55cc84ba99e7218e9949 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Thu, 15 May 2025 07:03:52 +0200 Subject: [PATCH 5/6] Enum in legovideomanager.cpp (#1492) --- LEGO1/lego/legoomni/src/video/legovideomanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LEGO1/lego/legoomni/src/video/legovideomanager.cpp b/LEGO1/lego/legoomni/src/video/legovideomanager.cpp index 4f16cf5a..bc8fa1cb 100644 --- a/LEGO1/lego/legoomni/src/video/legovideomanager.cpp +++ b/LEGO1/lego/legoomni/src/video/legovideomanager.cpp @@ -639,7 +639,7 @@ void LegoVideoManager::SetSkyColor(float p_red, float p_green, float p_blue) colorStrucure.peRed = (p_red * 255.0f); colorStrucure.peGreen = (p_green * 255.0f); colorStrucure.peBlue = (p_blue * 255.0f); - colorStrucure.peFlags = -124; + colorStrucure.peFlags = D3DPAL_RESERVED | PC_NOCOLLAPSE; m_videoParam.GetPalette()->SetSkyColor(&colorStrucure); m_videoParam.GetPalette()->SetOverrideSkyColor(TRUE); m_3dManager->GetLego3DView()->GetView()->SetBackgroundColor(p_red, p_green, p_blue); From 4c754b376c91ffc11e944c8acd852197204de888 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Thu, 15 May 2025 07:08:50 +0200 Subject: [PATCH 6/6] Enums in mxdisplaysurface.cpp (#1493) * Enums in mxdisplaysurface.cpp * Update mxdisplaysurface.cpp --- LEGO1/omni/src/video/mxdisplaysurface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LEGO1/omni/src/video/mxdisplaysurface.cpp b/LEGO1/omni/src/video/mxdisplaysurface.cpp index 32245d81..3e235d9c 100644 --- a/LEGO1/omni/src/video/mxdisplaysurface.cpp +++ b/LEGO1/omni/src/video/mxdisplaysurface.cpp @@ -1050,7 +1050,7 @@ LPDIRECTDRAWSURFACE MxDisplaySurface::CopySurface(LPDIRECTDRAWSURFACE p_src) RECT rect = {0, 0, (LONG) ddsd.dwWidth, (LONG) ddsd.dwHeight}; - if (newSurface->BltFast(0, 0, p_src, &rect, 16) != DD_OK) { + if (newSurface->BltFast(0, 0, p_src, &rect, DDBLTFAST_WAIT) != DD_OK) { newSurface->Release(); return NULL; }