From 4a3d5ec8ac14b0fbda8ec7fbe5cf9401cdd2bf15 Mon Sep 17 00:00:00 2001 From: VoxelTek <53562267+VoxelTek@users.noreply.github.com> Date: Tue, 17 Jun 2025 14:17:36 +1000 Subject: [PATCH] Fix Draw Cursor option in Config tool Allow the Draw Cursor checkbox to be changed regardless of video mode. Additionally, add a line to the CMake script so that, during the long wait for SDL3 to download, users don't think the process has frozen. --- CMakeLists.txt | 2 ++ CONFIG/MainDlg.cpp | 16 ++++++++++++++++ CONFIG/config.cpp | 3 +++ 3 files changed, 21 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 55007410..f8697def 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,6 +50,8 @@ message(STATUS "Internal miniwin: ${ISLE_MINIWIN}") message(STATUS "Isle debugging: ${ISLE_DEBUG}") message(STATUS "Compile shaders: ${ISLE_COMPILE_SHADERS}") +message(STATUS "Fetching SDL3, please wait...") + if (DOWNLOAD_DEPENDENCIES) # FetchContent downloads and configures dependencies include(FetchContent) diff --git a/CONFIG/MainDlg.cpp b/CONFIG/MainDlg.cpp index 19d7d462..01b6a80b 100644 --- a/CONFIG/MainDlg.cpp +++ b/CONFIG/MainDlg.cpp @@ -121,6 +121,10 @@ void CMainDialog::OnList3DevicesSelectionChanged(int selected) { LegoDeviceEnumerate* device_enumerator = currentConfigApp->m_device_enumerator; device_enumerator->GetDevice(selected, currentConfigApp->m_driver, currentConfigApp->m_device); + /* The code below originally forced the drawCursorCheckBox to be enabled (not necessarily checked) in any hardware mode. + * Oddly enough, this same condition is also run in UpdateInterface(), so it ends up doing this check twice. + * Additionally, some of the actions taken were weirdly split between them. + * Disabling the Draw Cursor checkbox on software modes is no longer relevant, nor is forcing it on with hardware modes. if (currentConfigApp->GetHardwareDeviceColorModel() != D3DCOLOR_NONE) { m_ui->drawCursorCheckBox->setEnabled(true); } @@ -130,6 +134,14 @@ void CMainDialog::OnList3DevicesSelectionChanged(int selected) m_ui->videomemoryCheckBox->setChecked(currentConfigApp->m_3d_video_ram); m_ui->flipVideoMemoryPagesCheckBox->setChecked(currentConfigApp->m_flip_surfaces); } + */ + if (currentConfigApp->GetHardwareDeviceColorModel() == D3DCOLOR_NONE) { + currentConfigApp->m_3d_video_ram = FALSE; + currentConfigApp->m_flip_surfaces = FALSE; + m_ui->videomemoryCheckBox->setChecked(currentConfigApp->m_3d_video_ram); + m_ui->flipVideoMemoryPagesCheckBox->setChecked(currentConfigApp->m_flip_surfaces); + } + // The above code was rewritten so that the Draw Cursor checkbox is always enabled, in any mode. m_modified = true; UpdateInterface(); } @@ -159,6 +171,9 @@ void CMainDialog::UpdateInterface() m_ui->videomemoryCheckBox->setChecked(currentConfigApp->m_3d_video_ram); bool full_screen = currentConfigApp->m_full_screen; currentConfigApp->AdjustDisplayBitDepthBasedOnRenderStatus(); + /* The code below is used to force the Draw Cursor checkbox on in any hardware mode, but still have it enabled. + * Additionally, it disables it in software mode, and forces it to be off. + * This is not relevant on modern platforms. if (currentConfigApp->GetHardwareDeviceColorModel() != D3DCOLOR_NONE) { m_ui->drawCursorCheckBox->setChecked(true); } @@ -167,6 +182,7 @@ void CMainDialog::UpdateInterface() currentConfigApp->m_draw_cursor = FALSE; m_ui->drawCursorCheckBox->setEnabled(false); } + */ if (full_screen) { if (currentConfigApp->m_display_bit_depth == 8) { m_ui->colorPalette256RadioButton->setChecked(true); diff --git a/CONFIG/config.cpp b/CONFIG/config.cpp index b00bece1..a06a36fc 100644 --- a/CONFIG/config.cpp +++ b/CONFIG/config.cpp @@ -175,10 +175,13 @@ bool CConfigApp::ValidateSettings() is_modified = TRUE; } } + /* This code disables Draw Cursor whenever a software mode is selected. + * This isn't relevant on modern platforms. if (GetHardwareDeviceColorModel() == D3DCOLOR_NONE) { m_draw_cursor = FALSE; is_modified = TRUE; } + */ else { if (!m_3d_video_ram) { m_3d_video_ram = TRUE;